Forum Moderators: phranque

Message Too Old, No Replies

Virtual Hosts configuration

Configure Apache to work with virtual hosts without restarting

         

athos

8:41 pm on Sep 4, 2007 (gmt 0)

10+ Year Member



Hi!

I am using Apache 2.2.4 on Windows XP and I want to host multiple domains on the same IP.
I configured Apache for working with an external vhosts.map containing the domain name and the path were is hosted.
For example:
-- vhosts.map --
www.domain1.com /user1/public_html
www.domain2.com /user2/public_html

I found some RewriteCond on the Apache website and made it work. But if exists a .htaccess file containing a RewriteRule in /user1/public_html I get a 404 Error.

Can you please tell me a method to use Virtual Hosts with Apache without restarting Apache after I add or remove some hosts?

Regards,

DRAGOS PANOIU

kewlhand

12:04 am on Sep 19, 2007 (gmt 0)

10+ Year Member



Yes, you need to switch to dynamic virtual hosting using the:
VirtualDocumentRoot "/home/www/%0"
directive.

This is not as flexible as maps, but at least you only need to ensure
the underlaying directory is created and content in place, no httpd restarts! This is mainly used by ISP's offering home page services.

One drawback is you are forced to use a single log file for all sites!