How To Check Apache Version Windows
Using Apache HTTP Server on Microsoft Windows
Available Languages: en | fr | ko
This document explains how to install, configure and run Apache 2.four under Microsoft Windows. If you have questions later reviewing the documentation (and whatever upshot and error logs), you lot should consult the peer-supported users' mailing list.
This document assumes that you are installing a binary distribution of Apache. If you lot want to compile Apache yourself (possibly to help with development or tracking down bugs), see Compiling Apache for Microsoft Windows.
See too
- Comments
Operating System Requirements
The chief Windows platform for running Apache two.4 is Windows 2000 or afterward. Ever obtain and install the electric current service pack to avoid operating system bugs.
Apache HTTP Server versions later than 2.2 will not run on any operating system earlier than Windows 2000.
Downloading Apache for Windows
The Apache HTTP Server Projection itself does not provide binary releases of software, only source lawmaking. Individual committers may provide binary packages equally a convenience, only it is not a release deliverable.
If you cannot compile the Apache HTTP Server yourself, you lot can obtain a binary package from numerous binary distributions bachelor on the Internet.
Popular options for deploying Apache httpd, and, optionally, PHP and MySQL, on Microsoft Windows, include:
- ApacheHaus
- Apache Lounge
- Bitnami WAMP Stack
- WampServer
- XAMPP
Customizing Apache for Windows
Apache is configured by the files in the conf
subdirectory. These are the same files used to configure the Unix version, but at that place are a few different directives for Apache on Windows. See the directive index for all the available directives.
The main differences in Apache for Windows are:
-
Because Apache for Windows is multithreaded, it does not use a dissever process for each asking, equally Apache can on Unix. Instead there are usually but two Apache processes running: a parent process, and a child which handles the requests. Inside the child process each request is handled by a divide thread.
The process management directives are besides different:
MaxConnectionsPerChild
: Like the Unix directive, this controls how many connections a single kid procedure will serve before exiting. However, dissimilar on Unix, a replacement procedure is non instantly available. Use the defaultMaxConnectionsPerChild 0
, unless instructed to modify the behavior to overcome a memory leak in 3rd party modules or in-process applications.Warning: The server configuration file is reread when a new child procedure is started. If you take modified
httpd.conf
, the new kid may not start or you may receive unexpected results.ThreadsPerChild
: This directive is new. It tells the server how many threads it should use. This is the maximum number of connections the server can handle at once, so be sure to set this number high enough for your site if you become a lot of hits. The recommended default isThreadsPerChild 150
, just this must exist adapted to reverberate the greatest predictable number of simultaneous connections to accept. -
The directives that have filenames as arguments must utilise Windows filenames instead of Unix ones. Nevertheless, because Apache may interpret backslashes as an "escape grapheme" sequence, y'all should consistently use forward slashes in path names, non backslashes.
-
While filenames are more often than not case-insensitive on Windows, URLs are still treated internally equally case-sensitive before they are mapped to the filesystem. For example, the
<Location>
,Alias
, andProxyPass
directives all use case-sensitive arguments. For this reason, it is particularly important to use the<Directory>
directive when attempting to limit access to content in the filesystem, since this directive applies to whatever content in a directory, regardless of how it is accessed. If you wish to assure that only lowercase is used in URLs, you lot can employ something similar:RewriteEngine On RewriteMap lowercase int:tolower RewriteCond "%{REQUEST_URI}" "[A-Z]" RewriteRule "(.*)" "${lowercase:$1}" [R,L]
-
When running, Apache needs write access only to the logs directory and any configured cache directory tree. Due to the outcome of case insensitive and short viii.three format names, Apache must validate all path names given. This ways that each directory which Apache evaluates, from the drive root up to the directory leaf, must have read, list and traverse directory permissions. If Apache2.4 is installed at C:\Program Files, then the root directory, Programme Files and Apache2.4 must all be visible to Apache.
-
Apache for Windows contains the ability to load modules at runtime, without recompiling the server. If Apache is compiled normally, it volition install a number of optional modules in the
\Apache2.iv\modules
directory. To activate these or other modules, theLoadModule
directive must exist used. For example, to activate the status module, use the following (in addition to the status-activating directives inadmission.conf
):LoadModule status_module "modules/mod_status.so"
Information on creating loadable modules is also available.
-
Apache can also load ISAPI (Internet Server Awarding Programming Interface) extensions such as those used by Microsoft IIS and other Windows servers. More information is available. Note that Apache cannot load ISAPI Filters, and ISAPI Handlers with some Microsoft feature extensions will not piece of work.
-
When running CGI scripts, the method Apache uses to find the interpreter for the script is configurable using the
ScriptInterpreterSource
directive. -
Since it is frequently difficult to manage files with names like
.htaccess
in Windows, you may find it useful to change the proper name of this per-directory configuration file using theAccessFilename
directive. -
Whatever errors during Apache startup are logged into the Windows event log when running on Windows NT. This mechanism acts every bit a backup for those situations where Apache is not yet prepared to use the
error.log
file. Y'all can review the Windows Awarding Event Log by using the Event Viewer, e.k. Kickoff - Settings - Control Panel - Administrative Tools - Event Viewer.
Running Apache as a Service
Apache comes with a utility called the Apache Service Monitor. With it you tin see and manage the state of all installed Apache services on any auto on your network. To be able to manage an Apache service with the monitor, you have to start install the service (either automatically via the installation or manually).
You can install Apache equally a Windows NT service as follows from the control prompt at the Apache bin
subdirectory:
httpd.exe -k install
If you need to specify the name of the service you want to install, use the following command. You take to do this if you have several different service installations of Apache on your computer. If you specify a proper name during the install, you accept to also specify it during any other -thousand operation.
httpd.exe -thousand install -n "MyServiceName"
If you demand to take specifically named configuration files for unlike services, you must apply this:
httpd.exe -yard install -north "MyServiceName" -f "c:\files\my.conf"
If you use the beginning control without any special parameters except -one thousand install
, the service volition be called Apache2.4
and the configuration will be assumed to be conf\httpd.conf
.
Removing an Apache service is like shooting fish in a barrel. Just apply:
httpd.exe -k uninstall
The specific Apache service to be uninstalled can be specified by using:
httpd.exe -k uninstall -n "MyServiceName"
Normal starting, restarting and shutting down of an Apache service is usually done via the Apache Service Monitor, by using commands like NET START Apache2.4
and Cyberspace STOP Apache2.iv
or via normal Windows service direction. Before starting Apache as a service past any means, you should test the service'south configuration file by using:
httpd.exe -n "MyServiceName" -t
You tin control an Apache service by its command line switches, too. To showtime an installed Apache service you lot'll use this:
httpd.exe -k kickoff -due north "MyServiceName"
To stop an Apache service via the command line switches, apply this:
httpd.exe -g terminate -n "MyServiceName"
or
httpd.exe -k shutdown -n "MyServiceName"
You can also restart a running service and force information technology to reread its configuration file by using:
httpd.exe -chiliad restart -north "MyServiceName"
By default, all Apache services are registered to run as the arrangement user (the LocalSystem
business relationship). The LocalSystem
account has no privileges to your network via whatsoever Windows-secured mechanism, including the file system, named pipes, DCOM, or secure RPC. It has, nevertheless, wide privileges locally.
Never grant whatever network privileges to the LocalSystem
account! If you need Apache to be able to admission network resources, create a separate account for Apache equally noted below.
It is recommended that users create a split up business relationship for running Apache service(s). If yous accept to admission network resources via Apache, this is required.
- Create a normal domain user business relationship, and be sure to memorize its password.
- Grant the newly-created user a privilege of
Log on every bit a service
andAct as part of the operating system
. On Windows NT 4.0 these privileges are granted via User Director for Domains, but on Windows 2000 and XP you lot probably want to use Group Policy for propagating these settings. You can also manually set these via the Local Security Policy MMC snap-in. - Confirm that the created account is a member of the Users grouping.
- Grant the account read and execute (RX) rights to all document and script folders (
htdocs
andcgi-bin
for example). - Grant the account alter (RWXD) rights to the Apache
logs
directory. - Grant the account read and execute (RX) rights to the
httpd.exe
binary executable.
It is usually a expert practice to grant the user the Apache service runs equally read and execute (RX) access to the whole Apache2.4 directory, except the logs
subdirectory, where the user has to have at least change (RWXD) rights.
If you allow the account to log in as a user and as a service, and then you can log on with that account and exam that the account has the privileges to execute the scripts, read the web pages, and that you can start Apache in a console window. If this works, and you accept followed the steps higher up, Apache should execute as a service with no problems.
Error code 2186 is a good indication that you demand to review the "Log On As" configuration for the service, since Apache cannot access a required network resource. Also, pay close attention to the privileges of the user Apache is configured to run as.
When starting Apache as a service you may see an mistake message from the Windows Service Control Manager. For case, if you endeavour to showtime Apache past using the Services applet in the Windows Control Panel, you may go the following message:
Could not kickoff the Apache2.4 service on \\COMPUTER
Mistake 1067; The process terminated unexpectedly.
You volition get this generic mistake if there is any problem with starting the Apache service. In gild to see what is really causing the problem you should follow the instructions for Running Apache for Windows from the Command Prompt.
If you are having problems with the service, it is suggested y'all follow the instructions beneath to endeavour starting httpd.exe from a console window, and piece of work out the errors earlier struggling to start it as a service once more.
Running Apache as a Panel Awarding
Running Apache equally a service is ordinarily the recommended way to use information technology, just it is sometimes easier to work from the command line, especially during initial configuration and testing.
To run Apache from the command line every bit a console application, use the post-obit command:
httpd.exe
Apache will execute, and volition remain running until it is stopped by pressing Control-C.
You can also run Apache via the shortcut Offset Apache in Console placed to Start Menu --> Programs --> Apache HTTP Server 2.four.xx --> Control Apache Server
during the installation. This will open a panel window and offset Apache inside it. If you lot don't have Apache installed every bit a service, the window volition remain visible until you stop Apache by pressing Control-C in the console window where Apache is running in. The server will exit in a few seconds. Even so, if you do have Apache installed as a service, the shortcut starts the service. If the Apache service is running already, the shortcut doesn't practise anything.
If Apache is running equally a service, you tin tell it to stop by opening another console window and entering:
httpd.exe -m shutdown
Running every bit a service should be preferred over running in a panel window considering this lets Apache finish whatsoever electric current operations and make clean up gracefully.
Simply if the server is running in a console window, y'all tin only stop it by pressing Command-C in the aforementioned window.
You can as well tell Apache to restart. This forces it to reread the configuration file. Any operations in progress are allowed to consummate without intermission. To restart Apache, either press Control-Break in the panel window you used for starting Apache, or enter
httpd.exe -k restart
if the server is running as a service.
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 impale
command used on Unix.
If the Apache console window closes immediately or unexpectedly after startup, open the Command Prompt from the Start Carte du jour --> Programs. Alter to the folder to which y'all installed Apache, type the command httpd.exe
, and read the error message. And so change to the logs folder, and review the error.log
file for configuration mistakes. Assuming httpd was installed into C:\Program Files\Apache Software Foundation\Apache2.4\
, yous tin can do the following:
c:
cd "\Program Files\Apache Software Foundation\Apache2.4\bin"
httpd.exe
And then expect for Apache to stop, or printing Control-C. Then enter the following:
cd ..\logs
more than < fault.log
When working with Apache it is of import to know how information technology volition discover the configuration file. You can specify a configuration file on the command line in two means:
-
-f
specifies an absolute or relative path to a particular configuration file:httpd.exe -f "c:\my server files\anotherconfig.conf"
or
httpd.exe -f files\anotherconfig.conf
-
-n
specifies the installed Apache service whose configuration file is to be used:httpd.exe -n "MyServiceName"
In both of these cases, the proper ServerRoot
should be set in the configuration file.
If yous don't specify a configuration file with -f
or -due north
, Apache will use the file proper noun compiled into the server, such equally conf\httpd.conf
. This built-in path is relative to the installation directory. You tin can verify the compiled file name from a value labelled every bit SERVER_CONFIG_FILE
when invoking Apache with the -V
switch, like this:
httpd.exe -V
Apache will then try to determine its ServerRoot
by trying the following, in this order:
- A
ServerRoot
directive via the-C
command line switch. - The
-d
switch on the command line. - Current working directory.
- A registry entry which was created if you lot did a binary installation.
- The server root compiled into the server. This is
/apache
by default, you lot can verify information technology past usinghttpd.exe -Five
and looking for a value labelled equallyHTTPD_ROOT
.
If yous did not do a binary install, Apache will in some scenarios complain about the missing registry key. This warning can be ignored if the server was otherwise able to discover its configuration file.
The value of this key is the ServerRoot
directory which contains the conf
subdirectory. When Apache starts it reads the httpd.conf
file from that directory. If this file contains a ServerRoot
directive which contains a dissimilar directory from the one obtained from the registry key in a higher place, Apache will forget the registry key and employ the directory from the configuration file. If yous copy the Apache directory or configuration files to a new location it is vital that you lot update the ServerRoot
directive in the httpd.conf
file to reflect the new location.
Testing the Installation
Afterward starting Apache (either in a console window or as a service) it will exist listening on port fourscore (unless you changed the Listen
directive in the configuration files or installed Apache merely for the current user). To connect to the server and access the default page, launch a browser and enter this URL:
http://localhost/
Apache should reply with a welcome page and you should see "It Works!". If nix happens or you become an fault, look in the error.log
file in the logs
subdirectory. If your host is not connected to the cyberspace, or if you accept serious problems with your DNS (Domain Name Service) configuration, you may have to utilize this URL:
http://127.0.0.1/
If y'all happen to be running Apache on an alternate port, you demand to explicitly put that in the URL:
http://127.0.0.1:8080/
Once your basic installation is working, you should configure it properly by editing the files in the conf
subdirectory. Once again, if you change the configuration of the Windows NT service for Apache, get-go attempt to start information technology from the control line to make sure that the service starts with no errors.
Because Apache cannot share the same port with another TCP/IP awarding, you may need to cease, uninstall or reconfigure certain other services earlier running Apache. These alien services include other Www servers, some firewall implementations, and even some client applications (such every bit Skype) which will utilize port 80 to try to bypass firewall issues.
Configuring Admission to Network Resources
Admission to files over the network can be specified using 2 mechanisms provided by Windows:
- Mapped drive messages
- east.g.,
Alias "/images/" "Z:/"
- UNC paths
- east.k.,
Alias "/images/" "//imagehost/www/images/"
Mapped drive letters allow the administrator to maintain the mapping to a specific car and path outside of the Apache httpd configuration. However, these mappings are associated only with interactive sessions and are non directly available to Apache httpd when it is started every bit a service. Use only UNC paths for network resource in httpd.conf so that the resources tin can be accessed consistently regardless of how Apache httpd is started. (Arcane and mistake prone procedures may work around the restriction on mapped drive letters, but this is not recommended.)
Example DocumentRoot with UNC path
DocumentRoot "//dochost/www/html/"
Instance DocumentRoot with IP address in UNC path
DocumentRoot "//192.168.1.50/docs/"
Example Allonym and corresponding Directory with UNC path
Alias "/images/" "//imagehost/world wide web/images/" <Directory "//imagehost/www/images/"> #... </Directory>
When running Apache httpd as a service, y'all must create a divide account in lodge to access network resources, as described to a higher place.
Windows Tuning
-
If more than than a few dozen piped loggers are used on an operating system example, scaling up the "desktop heap" is ofttimes necessary. For more than detailed information, refer to the piped logging documentation.
Source: https://httpd.apache.org/docs/current/platform/windows.html
Posted by: darbyacend1994.blogspot.com
0 Response to "How To Check Apache Version Windows"
Post a Comment