1

I've been on various different VPS servers and they sometimes automatically setup separate conf files for each virtual host.

I'm trying to achieve the same on my local machine (that runs Ubuntu 11.04 on xampp 1.7.3). How would you go about doing this. Would you edit the http.conf file? Does apache already does this automatically?

How would one setup separate .conf files for each virtual host in a specified folder (say /opt/lampp/etc/extra/hosts)?

1 Answer 1

3

You can include a directory of config files by adding a line like this to the bottom of your apache2.conf / httpd.conf file:

Include /opt/lampp/etc/extra/hosts/

Where /opt/lampp/etc/extra/hosts/ would contain the conf files.

The conf files would each look like a normal virtual host definition:

<VirtualHost *:80>
ServerName foo.dom.com
ServerAdmin [email protected]
DocumentRoot /path/to/docroot
</VirtualHost>

(etc, etc)

That behavior is typical of a Debian installation where config files are split into smaller, more manageable files.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .