...
Code Block | ||
---|---|---|
| ||
cd /opt/web sudo mkdir www.krypton.com # Home directory for the website. cd /opt/web/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 /opt/web sudo chown -R serveradmin:wgkryptonian ./www.krypton.com/ sudo chmod -R o-wx ./www.krypton.com/ # Make sure others can't change files. sudo chown -R serveradmin.wgkryptonian ./www.krypton.com/ # Ensure setgid bit is setup so new files created will have same groups. # Repeat for www.earth.com cd /opt/web sudo mkdir -p www.earth.com/www # Makes both directories with one command sudo addgroup --gid 3101 wgearthling sudo chown -R serveradmin:wgearthling ./www.earth.com/ sudo chown -R serveradmin.wgearthling ./www.earth.com/ |
Now we create users that will have access to their respective websites,
...