You need to create a number of virtual hosts in your virtual machine.
These should go into a new file somewhere in /etc/httpd/conf.d.
For the purposes of this tutorial, create and use the file "/etc/httpd/conf.d/zvirtual.conf".
Using <VirtualHost> create two VirtualHosts in the
file /etc/httpd/conf.d/zvirtual.conf. Below is an example of a VirtualHost
definition which may help you remember what is needed.
<VirtualHost *:80>
ServerAdmin me@grussell.org
DocumentRoot /home/gordon/public_html/grussell.org
ServerName sql.grussell.org
ErrorLog logs/sql-error_log
CustomLog logs/sql-access_log common
</VirtualHost>
The names of your virtual hosts have to be worked out by yourself from
your current hostname. Type in the command "hostname" and you will get
something like:
host-3-2.linuxzoo.net
Your machine is known by this name in DNS. It is also known by two other
names, where the word "host" has been replaced with "web" and "vm".
In this example of host-3-2, this machine is also known as:
web-3-2.linuxzoo.net
vm-3-2.linuxzoo.net
IMPORTANT: Do not just copy this example, as your machine number is likely
to be entirely different. Use "hostname" and work your machine names out for
yourself. Note too that your hostname can change each time you reboot, so
double check each time you reboot!
Once you have your web and vm machine names, create two virtual host entries,
one for each of web-?-?.linuxzoo.net and vm-?-?.linuxzoo.net, so that the
DocumentRoot of web is /home/dave/public_html/web and the DocumentRoot
of vm is /home/dave/public_html/vm.
Each VirtualHost tagged area (you need 2) needs to be configured, with
their own ServerName and DocumentRoot.
like:
The other fields are not important in this question.
It is easy to make a syntax error in the config file. If you have problems
you can check for syntax errors using the command:
httpd -t
...and if you make changes to a configuration file remember to tell httpd.service!
Once again you can verify this works manually by pointing your browser to
web-?-?.linuxzoo.net or the vm equivalent (remembering to put the right things
in for the "?" characters). This is important, as in an assessment you may need
to verify this yourself.