Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
cd /homeopt/web
sudo mkdir www.krypton.com # Home directory for the website.
 
cd /homeopt/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 /homeopt/web
sudo chown -R serveradmin:wgkryptonian ./www.krypton.com/

# Repeat for www.earth.com
cd /homeopt/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/

...

Code Block
languagebash
sudo useradd -d /homeopt/web/kalel -m -u 2500 -G wgkryptonian -c "Client" -s /bin/bash kalel # Add user kalel with additional group and make the user's home directory
sudo useradd -d /homeopt/web/jorel -m -u 2501 -G wgkryptonian -c "Client" -s /bin/bash jorel

sudo passwd kalel
sudo passwd jorel

sudo useradd -d /homeopt/web/loislane -u 2502 -m -G wgearthling -c "Client" -s /bin/bash loislane
sudo useradd -d /homeopt/web/jimmyolsen -u 2503 -m -G wgearthling -c "Client" -s /bin/bash jimmyolsen

sudo passwd loislane
sudo passwd jimmyolsen

...

Code Block
languagexml
<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    ServerName www.krypton.com
    ServerAlias krypton.com

    DocumentRoot /homeopt/web/www.krypton.com/www

    # This restrictive a precedence for ALL directory blocks.
    <Directory />
        Options FollowSymLinks
        # This prevents use of .htaccess
        AllowOverride None
    </Directory>

    # Main location of static content for the websites.
    <Directory /homeopt/web/www.krypton.com/www/>
        Options +MultiViews
        Order Allow,Deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/www.krypton.com.error.log

    # Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/www.krypton.com.access.log combined

</VirtualHost>

...

Type in your browser, www.krypton.com. Because directory listing is enabled and there is no default html page usually index.html you should see an directory page listing the contents of /homeopt/web/serveradmin/www.krypton.com/.

...