3

Getting local devel environment setup with Apache 2.4. Looks like things have changed compared to 2.2

In particular, conf.d/ directory is gone and now we have just conf/ directory with a single entry for virtual hosts file in httpd.conf:

#Include conf/extra/httpd-vhosts.conf

How then to get multiple virtual host config files in place and recognized by this, the latest version of Apache?

I'd prefer not to chuck all my virtual host entries in a single file. The conf.d directory solution is nice in that you only virtual host files in there, nothing else config-wise to filter out (minor detail, but cleaner, imo)

7

You can always put Include conf.d/*.conf in your httpd.conf if you want...

2
  • doh, that was rather silly, right there in 2.2 httpd.conf, thanks for the clue in ;-) – virtualeyes Mar 5 '12 at 9:42
  • if not httpd.conf, can also be added in /etc/apache2/apache2.conf depending on the system. – TryTryAgain Nov 10 '15 at 21:43
5

In Apache 2.4, the new directories "conf-available" and "conf-enabled" replace "conf.d/".

When migrating from Apache 2.2 to 2.4, move the files in "conf.d" to the directory "conf-available". Then, create corresponding symbolic links in "conf-enabled".

(Putting the line "Include conf.d/*.conf" back into in "apache2.conf" "httpd.conf" is not a good idea. The next update is likely going replace this file and you will have to edit it again.)

3

Whoever finds this, here's a 2016 update

On my Debian 8.2 copy the folder appears to be replaced with conf-available and conf-enabled setup.

https://help.ubuntu.com/lts/serverguide/httpd.html#http-configuration:

conf-available: this directory contains available configuration files. All files that were previously in /etc/apache2/conf.d should be moved to /etc/apache2/conf-available.

0

In Apache 2.4 to enable vhost you need to uncomment below lines in httpd.conf(apache\conf)

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.