Which httpd.conf file

fdhbox

Verified User
Joined
Sep 2, 2019
Messages
11
Hello,

What is /etc/httpd/conf/httpd.conf for?
and What is /usr/local/directadmin/data/users/account_name/httpd.conf for?

Does each config file independent to each other?


Any help is highly appreciated.


fdhbox
 
  • Like
Reactions: Kal
Hello,

/etc/httpd/conf/httpd.conf - global Apache's config
/usr/local/directadmin/data/users/account_name/httpd.conf - Apache virtual hosts of users
 
  • Like
Reactions: Kal
so any /etc/httpd/conf/httpd.conf entries will also affect the virtual hosts?


Thank you.
 
/etc/httpd/conf/httpd.conf is the Apache configuration file that Apache actually reads.

Inside that /etc/httpd/conf/httpd.conf file is a series of Include files, one of which is:

/etc/httpd/conf/extra/directadmin-vhosts.conf


When you create a new user, an httpd.conf file is created at /usr/local/directadmin/data/users/%user%/httpd.conf AND an include line is added to /etc/httpd/conf/extra/directadmin-vhosts.conf which includes this /usr/local/directadmin/data/users/%user%/httpd.conf file.

This /usr/local/directadmin/data/users/%user%/httpd.conf file contains all of the VirtualHost entries for the domains associated with %user%,

So when Apache is reloaded:

It reads /etc/httpd/conf/httpd.conf which leads to reading /etc/httpd/conf/extra/directadmin-vhosts.conf which leads to reading /usr/local/directadmin/data/users/%user%/httpd.conf

That is how VirtualHost entries get read by Apache.
 
  • Like
Reactions: Kal
Back
Top