Page tree

Versions Compared

Key

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

...

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

...

Setup 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 acheived using .htaccess or <Directory>.

Looking in /etc/apache2/apache2.conf you will see a reference to the directory, /etc/apache2/sites-enabled/. Apache will look in this directory and load any virtual host file configurations.

Setup Virtual Hosting Directories

Assuming you are logged in as a member of the staff group, we will be creating groups and users with reserved ids as mentioned in the basic setup,

...

Code Block
languagebash
sudo useradd -d /home/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 /home/jorel -m -u 2501 -G wgkryptonian -c "Client" -s /bin/bash jorel

sudo passwd kalel
sudo passwd jorel

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

sudo passwd loislane
sudo passwd jimmyolsen

Create Virtual Host Configuration File

Next you create your physical virtual host file in /etc/apache2/sites-available and then create a symbolic link in /etc/apache2/sites-enabled/.

...