0

I am running Apache 2.4 as can be seen here:

$ sudo apache2ctl -v
Server version: Apache/2.4.10 (Debian)
Server built:   Jul 23 2014 13:15:48

Apparently there are three different configuration files which need to be configured :-

/etc/apache2$ ls *.conf
apache2.conf  ports.conf

and

/etc/apache2/conf.d$ ls *.conf
httpd.conf

Apparently these three files work something like this :-

apache2.conf :- It is the Global configuration file.

ports.conf :- This is apparently to tell Apache which IP Addresses and port to listen and bind to (to do web-serving).

httpd.conf :- This is something to do with user configs. I do not have much idea about it.

Now I have two questions :-

a. Is my understanding of the three files correct ? If somebody could better explain it would be nice.

b. why is httpd.conf supposed to be in /etc/apache2/conf.d/httpd.conf while the other two are in /etc/apache2/ ?

1
  • It should be documented in /usr/share/doc/apache2/README.Debian. Commented Sep 12, 2014 at 10:58

1 Answer 1

2

a. Is my understanding of the three files correct ? If somebody could better explain it would be nice.

In general, it's correct. But you can read more details, if you open /etc/apache2/apache2.conf:

# * apache2.conf is the main configuration file (this file). It puts the pieces
#   together by including all remaining configuration files when starting up the
#   web server.
#
#   ....
#
# * ports.conf is always included from the main configuration file. It is
#   supposed to determine listening ports for incoming connections, and which
#   of these ports are used for name based virtual hosts.

With httpd.conf, I think it existed only for compatible with other programs that require it. It's only a normal configuration file with apache.

b. why is httpd.conf supposed to be in /etc/apache2/conf.d/httpd.conf while the other two are in /etc/apache2/ ?

Because it's default design in Debian. Again from /etc/apache2/apache2.conf:

# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.

# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
#   /etc/apache2/
#   |-- apache2.conf
#   |   `--  ports.conf
#   |-- mods-enabled
#   |   |-- *.load
#   |   `-- *.conf
#   |-- conf.d
#   |   `-- *
#   `-- sites-enabled
#       `-- *

Note

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .