The main differences in Apache for Windows are:
MaxRequestsPerChild 0
,
does not cause the process to ever exit. ThreadsPerChild 50
. modules
directory. To activate these, or other modules, the new LoadModule
directive must be used. For example, to activate the status module, use
the following (in addition to the status-activating directives in httpd.conf
- see the
mod_status docs for more details.): · LoadModule status_module modules/mod_status.so
Information on creating loadable modules is also available. Note that some 3rd party modules may be distributed in the old style names, ApacheModuleFoo.dll. Always set the LoadModule command as directed by the 3rd party module's own documentation.
· Apache can also load ISAPI Extensions (i.e., Internet Server Applications), such as those used by Microsoft's IIS, and other Windows servers. More information is available. Note that Apache CANNOT load ISAPI Filters.
.htaccess
under windows, you may
find it useful to change the name of this configuration file using the AccessFilename
directive. The Start menu icons and the NT Service manager can provide a simple interface for administering Apache. But in some cases it is easier to work from the command line.
When working with Apache it is important to know how it will find the configuration files. You can specify a configuration file on the command line in two ways:
apache -f "c:\my server\conf\my.conf"
apache -f test\test.conf
apache -n "service name"
In these cases, the proper ServerRoot should be set in the configuration file.
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 its ServerRoot by trying the following, in this order:
The server root compiled into the server is usually "/apache". invoking apache with the -V switch will display this value labeled as HTTPD_ROOT.
When invoked from the start menu, Apache is usually passed no arguments, so using the registry entry is the preferred technique for console Apache.
During a binary installation, a registry key will have been installed, for example:
HKEY_LOCAL_MACHINE\Software\Apache Group\Apache\1.3.13\ServerRoot
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.
If you did not do a binary install then Apache will in some scenarios complain about the missing registry key. This warning can be ignored if it otherwise was able to find its configuration files.
The value of this key is the "ServerRoot" directory, containing the conf directory. When Apache starts it will read the httpd.conf file from this directory. If this file contains a ServerRoot directive which is different from the directory obtained from the registry key above, Apache will forget the registry key and use the directory from the configuration file. If you copy the Apache directory or configuration files to a new location it is vital that you update the ServerRoot directory in the httpd.conf file to the new location.
To run Apache from the command line as a console application, use the following command:
apache
Apache will execute, and will remain running until it is stopped by pressing control-C.
You can tell a running Apache to stop by opening another console window and running:
apache -k shutdown
Note: This option is only available with Apache 1.3.3 and later.
For earlier versions, you must use Control-C in the Apache console window to shut down the server.
From version 1.3.3 through 1.3.12, this should be used instead of pressing Control-C in a running Apache console window, because it allowed Apache to end any current transactions and cleanup gracefully.
As of version 1.3.13 pressing Control-C in the running window will cleanup Apache quite gracefully, and you may use -k stop as an alias for -k shutdown. Earlier versions do not understand -k stop.
You can also tell Apache to restart. This makes it re-read the configuration files. Any transactions in progress are allowed to complete without interruption. To restart Apache, run:
apache -k restart
Note: This option is only available with Apache 1.3.3 and later. For earlier versions, you need to use Control-C in the Apache console window to shut down the server, and then restart the server with the Apache command.
Another very useful feature is the configuration files test option. To test the Apache configuration files, run:
apache -t
This is especially useful following alterations to the configuration files while Apache is still running. You can make the changes, confirm that the syntax is good by issuing the "apache -t" command, then restart Apache with "apache -k restart". Apache will re-read the configuration files, allowing any transactions in progress to complete without interruption. Any new request will then be served using the new configuration.
Note:
for people familiar with the Unix version of Apache, these commands provide a
Windows equivalent to kill
-TERM
pid and kill -USR1
pid. The command line
option used, -k
,
was chosen as a reminder of the "kill" command used on Unix.
Note: This document is from
apache site. Here it is used for educational purposes. All rights are reserved
with related sites.