# Setting up virtual hosts Apache 2.4



## andrewm659 (Jul 22, 2015)

Is there a way to setup separate config files for my virtual hosts?  I know this is done in different varitations of Linux by using /etc/httpd/conf.d/vhost.conf.

Is there something I need to enable in Apache 2.4 on FreeBSD 10.1 to make this happen?


----------



## scottro (Jul 22, 2015)

We always do it by putting each in its own .conf file under /usr/local/etc/apache24/Includes/

I'm pretty sure that the config file already has a line to check any file under there with a .conf suffix.   I'm not on FreeBSD with apache24 installed right now, so I can't confirm that, but I'm pretty sure that you can just configure each vhost as a separate file--it just have to have the .conf suffix.

Look towards the end of /usr/local/etc/apache24/httpd.conf--or search for the word Includes in it.  (with a capital I)  I know that Red Hat and friends has something like that in their default files, though I think in their case it is something like include conf.d/*conf or something like that.


----------



## andrewm659 (Jul 22, 2015)

thank you!


----------



## scottro (Jul 23, 2015)

My pleasure hope it helped.


----------

