mirror of
https://github.com/apache/httpd.git
synced 2026-01-06 09:01:14 +03:00
Some documentation on the multiple services patch
Submitted by: Keith Wannamaker git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@83040 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -47,7 +47,9 @@ to help with development, or to track down bugs), see the section on
|
||||
<LI><A HREF="#run">Running Apache for Windows</A>
|
||||
<LI><A HREF="#use">Using Apache for Windows</A>
|
||||
<LI><A HREF="#cmdline">Running Apache for Windows from the Command Line</A>
|
||||
<LI><A HREF="#signal">Signalling Apache when running</A>
|
||||
<LI><A HREF="#service">Running Apache for Windows as a Service</A>
|
||||
<LI><A HREF="#signal">Signalling Console Apache when running</A>
|
||||
<LI><A HREF="#signalsrv">Signalling Service Apache when running</A>
|
||||
<LI><A HREF="#comp">Compiling Apache for Windows</A>
|
||||
</UL>
|
||||
|
||||
@@ -145,7 +147,7 @@ get started quickly the files should work as installed.
|
||||
There are two ways you can run Apache:
|
||||
|
||||
<UL>
|
||||
<LI>As a "service" (available on NT only). This is the best option if
|
||||
<LI>As a <A HREF="#service">"service"</A> (available on NT only). This is the best option if
|
||||
you want Apache to automatically start when you machine boots, and to
|
||||
keep Apache running when you log-off.
|
||||
|
||||
@@ -155,12 +157,14 @@ There are two ways you can run Apache:
|
||||
</UL>
|
||||
|
||||
To start Apache as a service, you first need to install it as a
|
||||
service. Run the "Install Apache as Service (NT only)" option from the
|
||||
Start menu. Once this is done you can start Apache by opening the
|
||||
Services window (in the Control Panel), selecting Apache, then
|
||||
clicking on Start. Apache will now be running in the background. You
|
||||
service. Multiple Apache services can be installed, each with a
|
||||
different name and configuration. To install the default Apache
|
||||
service named "Apache", run the "Install Apache as Service (NT only)"
|
||||
option from the Start menu. Once this is done you can start the "Apache"
|
||||
service by opening the Services window (in the Control Panel), selecting Apache,
|
||||
then clicking on Start. Apache will now be running in the background. You
|
||||
can later stop Apache by clicking on Stop. As an alternative to using
|
||||
the Services window, you can start and stop Apache from the control
|
||||
the Services window, you can start and stop the "Apache" service from the control
|
||||
line with
|
||||
|
||||
<PRE>
|
||||
@@ -168,6 +172,11 @@ line with
|
||||
NET STOP APACHE
|
||||
</PRE>
|
||||
|
||||
See <A HREF="#signalsrv">Signalling Service Apache when Running</A>
|
||||
for more information on installing and controlling Apache services.
|
||||
|
||||
<P>
|
||||
|
||||
To run Apache from a console window, select the "Start Apache as
|
||||
console app" option from the Start menu (in Apache 1.3.4 and earlier,
|
||||
this option was called "Apache Server"). This will open a console
|
||||
@@ -175,7 +184,7 @@ window and start Apache running inside it. The window will remain
|
||||
active until you stop Apache. To stop Apache running, either select
|
||||
the "Shutdown Apache console app" icon option from the Start menu
|
||||
(this is not available in Apache 1.3.4 or earlier), or see <A
|
||||
HREF="#signal">Signalling Apache when Running</A> for how
|
||||
HREF="#signal">Signalling Console Apache when Running</A> for how
|
||||
to control Apache from the command line.
|
||||
|
||||
<P>
|
||||
@@ -258,6 +267,44 @@ The main differences in Apache for Windows are:
|
||||
is available.</A>
|
||||
</UL>
|
||||
|
||||
<H2><A NAME="service">Running Apache for Windows as a Service</A></H2>
|
||||
|
||||
You can install Apache as a Windows NT service as follows:
|
||||
|
||||
<PRE>
|
||||
apache -i -n "service name"
|
||||
</PRE>
|
||||
|
||||
To install a service to use a particular configuration, specify the
|
||||
configuration file when the service is installed:
|
||||
|
||||
<PRE>
|
||||
apache -i -n "service name" -f "\my server\conf\my.conf"
|
||||
</PRE>
|
||||
|
||||
To remove an Apache service, use
|
||||
|
||||
<PRE>
|
||||
apache -u -n "service name"
|
||||
</PRE>
|
||||
|
||||
The default "service name", if one is not specified, is "Apache".
|
||||
|
||||
<P>
|
||||
|
||||
Once a service is installed, you can use the <SAMP>-n</SAMP> option, in conjunction
|
||||
with other options, to refer to a service's configuration file. For example:<br>
|
||||
|
||||
To test a service's configuration file:
|
||||
<PRE>
|
||||
apache -n "service name" -t
|
||||
</PRE>
|
||||
|
||||
To start a console Apache using a service's configuration file:
|
||||
<PRE>
|
||||
apache -n "service name"
|
||||
</PRE>
|
||||
|
||||
<H2><A NAME="cmdline">Running Apache for Windows from the Command Line</A></H2>
|
||||
|
||||
The Start menu icons and the NT Service manager can provide a simple
|
||||
@@ -266,29 +313,44 @@ work from the command line.
|
||||
|
||||
<P>
|
||||
When working with Apache it is important to know how it will find the
|
||||
configuration files. Apache will try one of the following, in this order.
|
||||
configuration files. You can specify a configuration file on the command line
|
||||
in two ways:
|
||||
|
||||
<UL>
|
||||
<LI>-f specifies a path to a particular configuration file
|
||||
</UL>
|
||||
<PRE> apache -f "c:\my server\conf\my.conf"</PRE>
|
||||
<PRE> apache -f test\test.conf</PRE>
|
||||
<UL>
|
||||
<LI>-n specifies the configuration file of an installed Apache service
|
||||
</UL>
|
||||
<PRE> apache -n "service name"</PRE>
|
||||
|
||||
In these cases, the proper ServerRoot should be set in the configuration file.
|
||||
|
||||
<P>
|
||||
|
||||
If you don't specify a configuration file name with -f or -n, Apache will
|
||||
use the file name compiled into the server, usually "conf/httpd.conf". Invoking
|
||||
Apache with the -V switch will display this value labeled as SERVER_CONFIG_FILE.
|
||||
Apache will then determine it's ServerRoot by trying the following, in this order:
|
||||
|
||||
<UL>
|
||||
<LI>A ServerRoot directive via a -C switch.
|
||||
<LI>The -f switch on the command line.
|
||||
<LI>The -d switch on the command line.
|
||||
<LI>Current working directory
|
||||
<LI>A registry entry, created if you did a binary install.
|
||||
<LI>The server root compiled into the server.
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
The server root compiled into the server is usually "/apache".
|
||||
invoking apache with the -v switch will display this value
|
||||
invoking apache with the -V switch will display this value
|
||||
labeled as HTTPD_ROOT.
|
||||
|
||||
<P>
|
||||
Your current working directory when Apache is started up has no
|
||||
effect on Apache's behavior.
|
||||
|
||||
<P>
|
||||
When invoked from the start menu or the Service Manager, Apache is
|
||||
usually passed no arguments, so using the registry entry is the preferred
|
||||
technique.
|
||||
When invoked from the start menu, Apache is usually passed no arguments,
|
||||
so using the registry entry is the preferred technique for console Apache.
|
||||
|
||||
<P>
|
||||
During a binary installation, a registry key will have
|
||||
@@ -301,8 +363,7 @@ been installed, for example:
|
||||
This key is compiled into the server and can enable you to test
|
||||
new versions without affecting the current version. Of course
|
||||
you must take care not to install the new version on top of the
|
||||
old version in the file system. You cannot run two invocations
|
||||
of Apache on Windows simultaneously.
|
||||
old version in the file system.
|
||||
|
||||
<P>
|
||||
If you did not do a binary install then Apache will in some
|
||||
@@ -326,29 +387,32 @@ To run Apache from the command line as a console application, use the
|
||||
following command:
|
||||
|
||||
<PRE>
|
||||
apache -s
|
||||
apache
|
||||
</PRE>
|
||||
|
||||
Apache will execute, and will remain running until it is stopped by pressing
|
||||
control-C. (The -s option is not required by Windows 95, but on Windows NT it
|
||||
prevents Apache waiting to see if Apache is running as a service.)
|
||||
control-C.
|
||||
|
||||
<P>
|
||||
<H2><A NAME="signalsrv">Signalling Service Apache when running</A></H2>
|
||||
|
||||
You can install Apache as a Windows NT service as follows:
|
||||
On Windows NT, multiple instances of Apache can be run as services.
|
||||
Signal an Apache service to start, restart, or shutdown as follows:
|
||||
|
||||
<PRE>
|
||||
apache -i
|
||||
apache -n "service name" -k start
|
||||
apache -n "service name" -k restart
|
||||
apache -n "service name" -k shutdown
|
||||
</PRE>
|
||||
|
||||
and to remove the Apache service, use
|
||||
In addition, you can use the native NT NET command to
|
||||
start and stop Apache services as follows:
|
||||
|
||||
<PRE>
|
||||
apache -u
|
||||
NET START "service name"
|
||||
NET STOP "service name"
|
||||
</PRE>
|
||||
|
||||
|
||||
<H2><A NAME="signal">Signalling Apache when running</A></H2>
|
||||
<H2><A NAME="signal">Signalling Console Apache when running</A></H2>
|
||||
|
||||
On Windows 95, Apache runs as a console application. You can tell a
|
||||
running Apache to stop by opening another console window and running
|
||||
@@ -486,3 +550,4 @@ the conf/magic and conf/mime.types files as well.
|
||||
<!--#include virtual="footer.html" -->
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user