Installing / Configuring the Apache Web Server (Release 2.0.43)

by Jeff Hunter, Sr. Database Administrator


Overview

The Apache Web Server source code can be downloaded from the Apache Web Site. The software is located at: http://httpd.apache.org/download.cgi.

Simply download the file httpd-2.0.43.tar.gz (or equivalent version) and place it in a temporary directory.

This section of the document will make the following assumptions:

One decision you have to make is whether to use mod_jserv or mod_jk as the linking mechanism between Apache and Tomcat. Unless you can find a binary distribution of Apache with DSO support enabled (and I have searched long and hard), you will have to follow these instructions to build it yourself.

Apache has added to the number of connection mechanisms to integrate the Apache HTTP server and the Tomcat Servlet container. The only choices with Apache 1.3 were to use mod_jserv or mod_jk. With Apache 2.0 you now have the following options:

Installation Steps

# su -
# mkdir /u02/app/apache
# cd /tmp
# gunzip httpd-2.0.43.tar.gz
# tar xvf httpd-2.0.43.tar
# cd httpd-2.0.43

# ./configure --prefix=/u02/app/apache --enable-module=most --enable-shared=max

# make
# make install

# rm -rf /tmp/httpd-2.0.43

Configuring the Apache httpd.conf File

Configuring the Apache Web Server mainly includes making edits to the /u02/app/apache/conf/httpd.conf file.

The following listing is an example httpd.conf file that details the changes you may want to make. The changes documented below configure the Apache Web Server to:

The following listing is an example of setting up the httpd.conf file. All needed changes are provided in the table below.

Directive Value
Listen 80 Make sure the "Listen" is set to "80". The old value for this in Apache 1.3 was named "Port".
User oracle
Group dba
Ensures that the HTTP Server is running as the UNIX user: oracle:dba.
ServerName www3.idevelopment.info Make note of this value, as it will also need to be set in the server.xml file for Tomcat.
DocumentRoot "/u02/app/apache/WebDBA" By default, the entry point for the server is "htdocs". To ensure that it is pointing to the correct entry point to the web server, change the value of "DocumentRoot".
<Directory "/u02/app/apache/WebDBA"> If you altered the value of "DocumentRoot" (above), you will need to change the very next <Directory> element attribute.
Options Indexes FollowSymLinks ExecCGI Includes MultiViews Within the <Directory> element you defined above, set the "Options" value to ensure proper execution of CGI scripts.
AllowOverride All Within the <Directory> element you defined above, set the "AllowOverride" value to ensure proper execution of CGI scripts.
DirectoryIndex index.html index.htm index.shtml index.cgi Make sure that the DirectoryIndex directive allows for all required file extensions.
AddHandler cgi-script .cgi .pl Ensures that the HTTP Server will execute CGI scripts. This option is commented out by default.
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Ensures that the HTTP Server will parse all required files with the given extension.

NOTE: Keep in mind that in Apache 1.3, in order to process Server Side Includes, you would need to include the following:AddHandler server-parsed .shtml .html .htm .inc

DO NOT include this line when using Apache 2.x and you are using .html files under the Tomcat servlet container. Having this line included will cause all requests for HTML/SHTML files within the Tomcat container directories for fail with a URL not found error. The error is visible in the error log file for the Apache webserver.

NameVirtualHost You can (optionally) setup one or more Virtual Hosts.
NameVirtualHost 192.168.1.110

<VirtualHost 192.168.1.110>
  ServerAdmin dba@idevelopment.info
  DocumentRoot /var/www/WebDBA
  ServerName dbaprod.idevelopment.info
  ErrorLog logs/WebDBA-error_log
  TransferLog logs/WebDBA-access_log
</VirtualHost>

<VirtualHost 192.168.1.110>
  ServerAdmin dba@idevelopment.info
  DocumentRoot /var/www/OracleDocs817
  ServerName oracledocs817.idevelopment.info
  ErrorLog logs/OracleDocs817-error_log
  TransferLog logs/OracleDocs817-access_log
</VirtualHost>

<VirtualHost 192.168.1.110>
  ServerAdmin dba@idevelopment.info
  DocumentRoot /var/www/OracleDocs901
  ServerName oracledocs901.idevelopment.info
  ErrorLog logs/OracleDocs901-error_log
  TransferLog logs/OracleDocs901-access_log
</VirtualHost>

Starting / Stopping Apache Web Server

Starting Apache

To start the Web Server, log in as the root account and run the following: (provided your PREFIX is /u02/app/apache).

# su -
# /u02/app/apache/bin/apachectl start
Stopping Apache

To shut down the Web Server, log in as the root account and run the following: (provided your PREFIX is /u02/app/apache).

# su -
# /u02/app/apache/bin/apachectl stop



Last modified on: Saturday, 18-Sep-2010 18:04:54 EDT
Page Count: 8947