debian with apache2 configuration for many VirtualHosts
Hello all. I just got finished bangin my head against Apache documentation, forum posts, and my monitor and here is what I've come up with (and confirmed as working)
Debian by default uses a2ensite/a2dissite to link Virtual Host files (you create) in the /etc/apache2/sites-available to /etc/apache2/sites-enabled. This is fine if you have one site or even two (and are really careful). But if you, like me, host many sites off the same IP address, then you will find the following information very helpful. By the way, if I am wrong, PLEASE tell me. at the end of /etc/apache2/apache2.conf there is an Include /etc/apache2/sites-enabled directive. Comment this out and replace it with Include /etc/apache2/vhosts.conf now, with your favorite editor create a file /etc/apache2/vhosts.conf. In this file, the first line will be NamedVirtualHost <Some IP you have> where <Some IP you have> is an actual interface's IP address (if you are NATing, use your internal address). the following lines should follow the normal VirtualHost Directives like: Code:
NameVirtualHost 192.168.254.4 I hope this helps... please feel free to comment and complain. |
All times are GMT -5. The time now is 03:21 PM. |