How to Install and Configure Samba SWAT on CentOS 5.5

Share this Article :

SWATSWAT is the Samba Web Administration Tool that enable us to configure Samba from Web browser. In this post i will show simple steps to get Samba SWAT running on your CentOS 5.5 server. With SWAT, you can easily manage your samba server without messing with command line. You just need to install xinetd first, and then proceed to install samba-SWAT.

1. Install xinetd

    [[email protected] ~]# yum -y install xinetd
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * addons: ossm.utm.my
     * base: ossm.utm.my
     * epel: mirror01.idc.hinet.net
     * extras: ossm.utm.my
     * updates: ossm.utm.my
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package xinetd.i386 2:2.3.14-10.el5 set to be updated
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ==========================================================================================
     Package            Arch             Version                       Repository        Size
    ==========================================================================================
    Installing:
     xinetd             i386             2:2.3.14-10.el5               base             124 k
    
    Transaction Summary
    ==========================================================================================
    Install       1 Package(s)
    Upgrade       0 Package(s)
    
    Total download size: 124 k
    Downloading Packages:
    xinetd-2.3.14-10.el5.i386.rpm                                      | 124 kB     00:02
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing     : xinetd                                                             1/1
    
    Installed:
      xinetd.i386 2:2.3.14-10.el5
    
    Complete!
    

2. Start xinetd

    [[email protected] ~]# /etc/rc.d/init.d/xinetd start
    Starting xinetd:                                           [  OK  ]
    

3. Install SWAT

    [[email protected] ~]# yum -y install samba-swat
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * addons: ossm.utm.my
     * base: ossm.utm.my
     * epel: mirror01.idc.hinet.net
     * extras: ossm.utm.my
     * updates: ossm.utm.my
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package samba-swat.i386 0:3.0.33-3.29.el5_6.2 set to be updated
    --> Processing Dependency: samba = 3.0.33-3.29.el5_6.2 for package: samba-swat
    --> Running transaction check
    ---> Package samba.i386 0:3.0.33-3.29.el5_6.2 set to be updated
    --> Processing Dependency: samba-common = 3.0.33-3.29.el5_6.2 for package: samba
    --> Running transaction check
    ---> Package samba-common.i386 0:3.0.33-3.29.el5_6.2 set to be updated
    --> Processing Dependency: libsmbclient = 3.0.33-3.29.el5_6.2 for package: samba-common
    --> Running transaction check
    ---> Package libsmbclient.i386 0:3.0.33-3.29.el5_6.2 set to be updated
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ==========================================================================================
     Package               Arch          Version                       Repository        Size
    ==========================================================================================
    Installing:
     samba-swat            i386          3.0.33-3.29.el5_6.2           updates          8.2 M
    Installing for dependencies:
     samba                 i386          3.0.33-3.29.el5_6.2           updates           16 M
    Updating for dependencies:
     libsmbclient          i386          3.0.33-3.29.el5_6.2           updates          908 k
     samba-common          i386          3.0.33-3.29.el5_6.2           updates          6.7 M
    
    Transaction Summary
    ==========================================================================================
    Install       2 Package(s)
    Upgrade       2 Package(s)
    
    Total download size: 32 M
    Downloading Packages:
    (1/4): libsmbclient-3.0.33-3.29.el5_6.2.i386.rpm                   | 908 kB     00:16
    (2/4): samba-common-3.0.33-3.29.el5_6.2.i386.rpm                   | 6.7 MB     02:01
    (3/4): samba-swat-3.0.33-3.29.el5_6.2.i386.rpm                     | 8.2 MB     02:28
    (4/4): samba-3.0.33-3.29.el5_6.2.i386.rpm                          |  16 MB     05:11
    ------------------------------------------------------------------------------------------
    Total                                                      55 kB/s |  32 MB     09:59
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Updating       : libsmbclient                                                       1/6
      Updating       : samba-common                                                       2/6
      Installing     : samba                                                              3/6
      Installing     : samba-swat                                                         4/6
      Cleanup        : libsmbclient                                                       5/6
      Cleanup        : samba-common                                                       6/6
    
    Installed:
      samba-swat.i386 0:3.0.33-3.29.el5_6.2
    
    Dependency Installed:
      samba.i386 0:3.0.33-3.29.el5_6.2
    
    Dependency Updated:
      libsmbclient.i386 0:3.0.33-3.29.el5_6.2     samba-common.i386 0:3.0.33-3.29.el5_6.2
    
    Complete!
    

4. Configure swat as below. Change Line 10 and 14 only.

    [[email protected] ~]# vi /etc/xinetd.d/swat
    
    # default: off
    # description: SWAT is the Samba Web Admin Tool. Use swat \
    #              to configure your Samba server. To use SWAT, \
    #              connect to port 901 with your favorite web browser.
    service swat
    {
            port            = 901
            socket_type     = stream
            wait            = no
            only_from       = 127.0.0.1 192.168.2.0/16
            user            = root
            server          = /usr/sbin/swat
            log_on_failure  += USERID
            disable         = no
    }
    

5. Restart xinetd

    [[email protected] ~]# /etc/rc.d/init.d/xinetd restart
    Stopping xinetd:                                           [  OK  ]
    Starting xinetd:                                           [  OK  ]
    

One Response

Leave a Reply