Monday, November 25, 2013

apache with security

Ubuntu Linux

#### installation
  • apt-get install apache2-mpm-itk
  • apt-get install acl
  • set acl in /etc/fstab

    e.g. LABEL=cloudimg-rootfs   /        ext4   defaults,acl    0 0
#### instructions for setting up new virtual host

useradd --home /vhdocs/your_web --shell /bin/false your_web
# default permissions
chown -R ubuntu.your_web your_web
chmod -R o-rwx your_web
chmod -R g+rx your_web
chmod -R g-w your_web
setfacl -R -d -m "g:developers:rwx" your_web
setfacl -R -d -m "g:your_web:r-x" your_web

# allow read/write/execute to developers
setfacl -R -m "g:developers:rwx" your_web

# allow write to certain directories
setfacl -R -m "g:your_web:rwx" writable_dir

# everytime after deployment
setfacl -R -m "g:developers:rwx" *

cd /vhdocs/ ; git init

0 comments:

Post a Comment