Specifications
Running Apache in a Console Window
To run Apache from the console window, select the Start Apache as console App option from
the Start menu. This will open a console window and start Apache inside it. This window will
remain active and open until you stop the Apache server.
To stop it, you could either run the Shutdown Apache as Console App option from the Start
menu or open another command window and type the following (for version 1.3.3 and earlier):
C:\Program Files\Apache Group\Apache> apache -k shutdown
Unlike MySQL, Apache doesn’t start as a background process, so you can also stop it by
pressing Control-C or Control-Break in the Apache console window or closing the console
window. (Again, this only works for versions older than 1.3.3.)
Running Apache as a Service
Before you can start Apache as a service, you must install it as a service. Keep in mind that
multiple Apache services can be installed on one machine with different names and configura-
tions.
To install the default Apache service (named Apache), run the Install Apache as Service (NT
only) option from the Start menu. Open the Services window (in the Control Panel), select
Apache, and then click Start. Apache will now be running, hidden in the background. You can
later stop Apache by clicking Stop. As an alternative to using the Services window, you can
start and stop the Apache service from the command line with
NET START apache
NET STOP apache
Note that this is similar to the MySQL server for NT and Windows 2000.
Apache, unlike other NT and Win2000 applications, logs any error to its own
error.log file
found within the Apache server root folder. It does not provide details through the standard
Event Log.
As mentioned previously, multiple instances of Apache can be installed and run as services. To
signal an installed Apache service to start, restart, or shut down, you will need to provide its
service name as follows:
apache -n “service name” -k start
apache -n “service name” -k restart
apache -n “service name” -k shutdown
For the default Apache service, the -n Apache option is still required because the -k
commands without the -n option are directed at Apache running in a console window. The
quotes are only required if the service name contains spaces.
Installing PHP 4 and MySQL
A
PPENDIX A
A
INSTALLING PHP 4
AND MYSQL
797
38 7842 app a 3/6/01 3:40 PM Page 797