Apache 2.4 :: What happened to conf.d/ virtual hosts?

15,238

Solution 1

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

Solution 2

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.)

Solution 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.

Share:
15,238

Related videos on Youtube

Karnan Kurup
Author by

Karnan Kurup

Updated on September 18, 2022

Comments

  • Karnan Kurup
    Karnan Kurup almost 2 years

    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)

  • Karnan Kurup
    Karnan Kurup over 12 years
    doh, that was rather silly, right there in 2.2 httpd.conf, thanks for the clue in ;-)
  • TryTryAgain
    TryTryAgain over 8 years
    if not httpd.conf, can also be added in /etc/apache2/apache2.conf depending on the system.