Configuring Apache
There are three main configuration files for Apache: shared.conf, httpd.conf(.unix), and local.conf. There is a "readme" in the Apache/conf directory, which is very helpful in explaining the function of these files.
The combined length of these files is less than 100 lines, and they are all documented very well. Thus, if you have any general questions, simply opening one of these files and looking around may provide the answer.
Please note that whenever you edit the configuration of Apache using these files, it is almost always necessary to stop and restart Apache in order for the changes to take effect.
local.conf
This is a configuration file with definitions specific to your installation. Most options are determined automatically when the server initializes, so this file generally includes only the definition of your server's port. This file is generated automatically from "local.conf.tmpl" during installation.
shared.conf
This contains shared configuration directives, used under both Windows and Unix.
httpd.conf and httpd.conf.unix
httpd.conf is the main Apache configuration file for use under Windows NT, while httpd.conf.unix is the main Apache configuration file for use under UNIX.
Apache Port
Typically, http servers run on port 80. In some circumstances, you may want Apache to run on a different port. This is useful if you are analyzing the performance of different web servers.
To set the port Apache runs on, you will need to edit the local.conf file. Locate the line which says "$Port = " and change the value on the right hand side to the port you want Apache to run on. For example, if you want Apache to run on port 82, the resulting line would look like:
$Port = 82;
Don't forget the semicolon!
To fetch pages from the new port, you must incorporate the port number into the URL. This is done by placing a colon and the port number directly following the site name. For example, if you move Apache to port 82, and want to access the ListManager Web Interface, the URL would look like:
http://yourserver:82/cgi-bin/lyris.pl
TCP/IP Addresses
By default, Apache will listen to all TCP/IP addresses on the machine. However, on multi-homed systems it is very easy to configure Apache to only listen to certain TCP/IP addresses.
The process of "adding" a TCP/IP address to Apache is relatively easy. Thus, you can quickly configure Apache to listen to several TCP/IP addresses or only one TCP/IP address, depending on your needs.
The local.conf file is where you add/remove TCP/IP addresses. In that file, you add a "Listen" directive followed by the TCP/IP address you want to add. For example, if you want to make sure only your internal users can access Apache, then you may want to configure Apache to listen to your machine's internal TCP/IP address:
Listen 192.168.3.219
The above example limits Apache to those requests that come in on 192.168.3.219. For more information on configuring Apache, please visit http://www.apache.org, the home of the Apache http server project.
Apache Command Line
You may need to run Apache from the command line occasionally. You can obtain a complete listing of the Apache command line options by using the "-help" argument. For example, you would need to open a command window and cd to the Apache directory. On UNIX, cd into the bin directory under Apache. Now run the command:
apache -help
Or on UNIX:
apache-lyris -help
With respect to the command line tools described herein, it is implied that you are running in a command window (MS-DOS prompt on Windows or xterm/cmdtool or equivalent on UNIX/Linux) and are currently in the Apache directory.
UNIX Specific Tools
If you are running on Solaris or Linux, there are convenient scripts available to you to start, stop, and restart Apache. These are kept in the Apache/bin directory, directly below the ListManager directory. For example, from that directory, you would run:
./stop
or
./start
or
./restart
Depending on what you need to do.
Windows Specific Tools
If you are running on Windows, you may have need for several different command line tools. For example, on Windows you can start Apache in the foreground very easily by issuing the following command from the Apache directory:
apache
Running Apache using a terminal window is good for debugging, however it blocks that shell. You can, of course, type Ctrl+C to kill that job, but in that case Apache won't exit cleanly. Ideally, you should open another command window and cd to the Apache directory, then run the command:
apache -k shutdown
If you are running a version of Windows that supports services, such as Windows NT or Windows 2000, you can install Apache as a service using the following command:
apache -d path_to_apache -i
In the above example, the path_to_apache variable should be substituted by the path to your Apache directory. Thus, if you accepted the defaults in your install, this command will look like:
apache -d C:\lm\apache -i
If you want to uninstall the Apache service, run the following command:
apache -u
If the Apache service is installed, and you want to quickly start and stop it without using the "Services" applet, you can use the "net" utility provided by Windows. The syntax of the "net" command, with respect to stopping and starting services, is:
net [stop | start] apache
![]() |