Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Apache know which file to use in /etc/httpd/conf.d?

I installed https://github.com/gitlabhq/gitlab-recipes/tree/master/install/centos.

One of the steps was to delete /etc/httpd/conf.d/ssl.conf (actually rename to ssl.conf.bak), and add a new gitlab.conf file.

How does Apache know which file to use in /etc/httpd/conf.d? I would have thought that I would have had to edit /etc/httpd/conf/httpd.conf, and specify the file, but this does not appear to be the case. Does Apache just use any file with a .conf extension located in /etc/httpd/conf.d/? If so, would an error occur if there was more than one?

like image 423
user1032531 Avatar asked Mar 19 '14 22:03

user1032531


People also ask

Which httpd conf file is Apache using?

All the configuration files for Apache are located in /etc/httpd/conf and /etc/httpd/conf.

How does httpd conf work?

The main configuration file is usually called httpd. conf . The location of this file is set at compile-time, but may be overridden with the -f command line flag. In addition, other configuration files may be added using the Include directive, and wildcards can be used to include many configuration files.

What is D in httpd?

HTTPd stands for Hypertext Transfer Protocol daemon. It usually is the main software part of an HTTP server better known as a web server.

What is the default location of httpd conf file?

If you installed httpd from source, the default location of the configuration files is /usr/local/apache2/conf . The default configuration file is usually called httpd. conf .


1 Answers

It depends on how the server is configured. But it's common to have a line similar to this:

Include conf.d/*.conf

in the main config (or some other config file included by it). That will include all the .conf files in the conf.d directory.

Other groups of files could be set up the same way, by simply adding a similar line(with a different directory name, of course). Ubuntu, for example, has a directory named sites-enabled that contains files to set up the sites active on the server.

like image 123
cHao Avatar answered Oct 03 '22 06:10

cHao