Despite my previous attempts at getting virtual websites going, they never worked.
So today I started trying it again. Here's what I added to the bottom of: my Apache
configuration file (/usr/local/etc/apache/httpd.conf)
<VirtualHost 192.168.0.45>
DocumentRoot /usr/local/www/data/test.freebsddiary.org
ServerName test.freebsddiary.org
ErrorLog /var/log/apache/freebsddiary.org-error.log
TransferLog /var/log/apache/freebsddiary.org-access.log
</VirtualHost>
<VirtualHost 192.168.0.45>
DocumentRoot /usr/local/www/data/www.test.freebsddiary.org
ServerName freebsddiary.yi.org
ErrorLog /var/log/apache/www.test.freebsddiary.org-error.log
TransferLog /var/log/apache/www.test.freebsddiary.org-access.log
</VirtualHost>
Where 192.168.0.45 is the IP address of my FreeBSD box. Then I restarted apache.
Then I browsed to the following two locations:
http://www.test.freebsddiary.org/
http://test.freebsddiary.org/
You will note that the IP address for each of these domains is the same. That's
the benefit of virtual servers. |