Forum Moderators: phranque

Message Too Old, No Replies

Apache, Different Config File for each virtual host

Using diffrent config file for each virtual host in Apache

         

dele

10:06 pm on Jan 21, 2004 (gmt 0)

10+ Year Member



I saw it briefly somewhere and could not remember where. But i sit possible to use different config file for each virtual host and what is/are the advantages and disadvantages of doing so?

dmorison

8:16 pm on Jan 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Each virtual host can have its own .htaccess file; so you can change any setting that Apache allows to be changed via .htaccess.

dele

8:42 pm on Jan 22, 2004 (gmt 0)

10+ Year Member



And how can this be implemented?

Thanks for the response.

bsterz

8:52 pm on Jan 22, 2004 (gmt 0)

10+ Year Member



Ensim does it like this (and I like it)

in /etc/httpd/conf
# Include all the virtual host config files
Include /etc/httpd/conf/virtual

Then in /etc/httpd/conf/virtual - create a file called example.com (or whatever)
# Example.com
<VirtualHost 1.1.1.1:80>
ServerName www.example.com
ServerAlias example.com
ServerAdmin me@example.com
DocumentRoot /home/virtual/example.com/www/html
# Include other config files if necessary - this would be a directory
Include /etc/httpd/conf/example.com
</VirtualHost>

dele

9:20 pm on Jan 22, 2004 (gmt 0)

10+ Year Member



Going on to give it a trial and thanks a lot. While on that another problem is my inability to open cgi script in another directory outside the cgi-bin, even when I created another cgi-bin folder in each virtual domain and set the permission in Apache conf.

When I loaded the pages in my browser it just showed the whole cgi code. Any known reason for this. I am Windows 2003.