Schotsl
Schotsl

Reputation: 227

Split httpd-vhosts.conf into multiple virtual host files

I have experience setting up virtual hosts with Apache2 on Ubuntu, but recently I started using Manjaro, when I tried to set up multiple virtual hosts I had to put the configuration into the httpd-vhosts.conf file.

I have 30 + virtual hosts configured so having this all in one file doesn't seem very clear. How would I split this up into multiple files and get Apache2 to read them all?

Upvotes: 0

Views: 1320

Answers (2)

Fernando Valler
Fernando Valler

Reputation: 121

for debian/ubuntu

In the main file, include the other files

in /etc/apache2/sites-available/vhosts.conf

in each file has the virtual hosts settings

... 
# Project1
Include /etc/apache2/sites-available/project1-vhosts.conf

# Project2
Include /etc/apache2/sites-available/project2-vhosts.conf
...

Upvotes: 0

Hades
Hades

Reputation: 126

You can find info about this on the Arch wiki. You can make to folder yourself and add the config files to the httpd.conf using Include <confFile>

https://wiki.archlinux.org/index.php/Apache_HTTP_Server#Managing_many_virtual_hosts

Upvotes: 1

Related Questions