Web Server Configuration
(this page is still incomplete, but better than nothing)
We are using Apache's httpd web server, version 2.210, on all of our servers. It serves HTML and PHP pages, and also acts as a proxy to serve JSP pages from Apache Tomcat running on the same server on port 8080.
We build this from source code, as described on the Web Build
page, and it's installed in
The configuration files are under
, with archived versions stored in SVN in
to match the directory layout used in service. The main files are:
httpd.conf - main configuration file. This also loads selected elements from
extra/ - additions from Apache to turn on things like user directories and SSL. The main files we have modified are
httpd-ssl.conf - configuration for Secure Socket Layer (SSL) for https (encryption).
local.d/ - additional configuration for various components that we have set up, divided into separate files for convenience . The
httpd.conf file has code at the end which loads all *.conf files from
local.d/. They are loaded in alphanumeric order, so if you care about the order, then prefix the filename with a digit.
00-Server.conf contains server-specific information, like the name
- ... (to be fleshed in later)
The main configuration file is
in the directory
(which is where all other configuration is kept too, either in that directory or in subdirectories). You need to edit this file to adjust the configuration for such things as user and group to run under, DocumentRoot and log directories, etc. On Ubuntu/Debian systems (like www13) the user and group should be "www-data". (On Fedora/RedHat systems it will be "apache".)
You can't turn on SSL encryption support unless you have server certificates in place.
extra/ and local.d/ subdirectories
The main configuration will read from files in the
subdirectory (if you enable these in
You should also create a
subdirectory for our own server configuration files Then when you edit
add at the end the following:
# Load local config files for virtual servers or specific areas
This causes all files in that subdirectory with names ending in ".conf" to be loaded (in alphanumeric order). Files with other names are ignored.
When the system boots or reboots it will run a script in
to start or stop the web server daemon. Long term maintenance will be easier if you put this in the directory
(you may need to create it) and then link to it from
. The script is also in the CVS directory
mentioned in the previous section.
The first time you install this script you need to run `update-rc.d` on Ubuntu/Debian (as on www13) to install the proper links to the script from the
directories for different run levels. (If on Fedora/RedHat use `chkconfig httpd on`.)
Log files can either go to
. This is configured in the
file. Be sure the permissions are set to that the web-server user can write to the log files.
-- Main.EricMyers - 19 May 2009