9. Samba

Samba is used to share the DocumentRoot of the web server, so that everybody in the local network can update the content of the web pages from their windows machines.

  1. Modify the following variables in /etc/samba/smb.conf , in the group [global] , like this:

    [global]
       workgroup = WERELD
       server string = Web Server
       hosts allow = 10.10.3. 192.168. 127.
       guest account = samba
       security = share
    
  2. Add the group [public] at the end of it:

    [public]
       path = /var/www/html/
       public = yes
       only guest = yes
       writable = yes
       printable = no
    
  3. Create the user samba and set permissions to /var/www/html :

    bash# /usr/sbin/useradd samba
    bash# chgrp samba /var/www/html
    bash# chmod 775 /var/www/html
    
  4. Start the samba service:

    bash# /sbin/chkconfig --level 2345 smb on
    bash# /sbin/service smb start
    
  5. Don't forget that the samba ports should be accepted in firewall:

    bash# vi /etc/sysconfig/iptables
    
    ### accept samba ports
    -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
    -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
    -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
    -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT