Linux – Where does Apache install httpd.conf by default

apachecentoshttpd.conflinux

I thought Apache's httpd.conf is typically located at /etc/httpd/conf/httpd.conf. But for my installation as described below on Centos 6.4, it is located at /usr/local/apache2/conf/httpd.conf. On top of that, DocumentRoot is set to /usr/local/apache2/htdocs instead of the traditional /var/www/html.

Where is the most common location for these to be located? If different than what I am showing, what did I do wrong? Thank you

First I did the following:

  1. Unpack Apache 2.4.4 to /usr/local/src
  2. Unpack APR 1.4.6 to /usr/local/src/httpd-2.4.4/srclib/apr
  3. Unpack APR-Util 1.5.2 to /usr/local/src/httpd-2.4.4/srclib /apr-util
  4. Unpack PCRE 8.33 to /usr/local/src

Then I did the following

$ cd /usr/local/src/httpd-2.4.4/srclib/apr
$ ./configure
$ make
$ make install
$ cd /usr/local/src/httpd-2.4.4/srclib/ apr-util
$ ./configure --with-apr=../apr (verify if any other options are desired)
$ make 
$ make install 
$ cd /usr/local/src/pcre-8.33
$ ./configure
$ make 
$ make install 
$ cd /usr/local/src/httpd-2.4.4
$ ./configure --enable-so –enable-rewrite –enable-ssl –with-pcre
$ make 
$ make install 

Best Answer

What you did "wrong" was to not read the documentation, which clearly states:

PREFIX must be replaced with the filesystem path under which the server should be installed. If PREFIX is not specified, it defaults to /usr/local/apache2.

However, I put "wrong" in quotes because I cannot find anything wrong with those directories. What's so bad about /usr/local?