Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Non need to set permissions as defaults match what is required.

...

I find this approach is complex enough to address the needs of most applications and at the same simple enough to implement for the intermediate level user.

For more advanced security and shared hosting you should implement ACLs.

Virtual Hosting

Note

There is another approach to this (provided most virtual hosts have the same requirements) where virtual hosts are created through mod rewrite, convention and customization is achieved using .htaccess or <Directory>.

...

Code Block
languagebash
cd /home
sudo mkdir www.krypton.com # Home directory for the website.
 
cd /home/www.krypton.com
sudo mkdir www # Folder for static content
sudo addgroup --gid 3100 wgkryptonian # Special work group to distinguish users who should have access to the website.
 
cd /home
sudo chown -R serveradmin:wgkryptonian ./www.krypton.com/
sudo
chmod -R g+wX,o-wX www.krypton.com # Only svradm and users in the kryptonian group can manage. Apache(other's) still need to be able to read and browse.

# Repeat for www.earth.com
cd /home
sudo mkdir -p www.earth.com
cd /home/www.earth.com sudo# mkdirMakes wwwboth #directories Folderwith forone staticcommand
content
sudo addgroup --gid 3101 wgearthling
cd /home
sudo chown -R serveradmin:wgearthling ./www.earth.com/
sudo chmod -R g+wX,o-wX www.earth.com

Now we create users that will have access to their respective websites,

...