In my previous post I mentioned that I would create installers for any future versions of the Apache HTTP Server. And so, here I am providing 32 bit and 64 bit windows binaries for the Apache HTTP Server 2.2.14. The latest version as of this writing. Server sends (e.g.): Server: Apache/2.0.41 (Unix) PHP/4.2.2 MyMod/1.2 This setting applies to the entire server and cannot be enabled or disabled on a virtualhost-by-virtualhost basis. After version 2.0.44, this directive also controls the information presented by the ServerSignature directive.
According to its banner, the version of Apache running on the remote host is 2.2.x prior to 2.2.34. It is, therefore, affected by the following vulnerabilities: - An authentication bypass vulnerability exists in httpd due to third-party modules using the apgetbasicauthpw function outside of the authentication phase. However, the default connection timeout of Apache httpd 1.3 and 2.0 is as little as 15 seconds and just 5 seconds for Apache httpd 2.2 and above. The advantage of a short timeout is the ability to deliver multiple components of a web page quickly while not consuming resources to run multiple server processes or threads for too long.
How to install Apache 2.x web server on WindowsApache 2.2 Download
Apache is the most popular web server. This article illustrates how to install it on Windows (XP, Vista, Windows 7) as part of a WAMP (Windows, Apache, MySQL, PHP) web development environment.The order of installation for WAMP environment
To make installation a smooth process for a WAMP development environment, we want to install these components in the following order.
1. Install MySQL 5.x
2. Install Apache 2.x
3. Install PHP 5.x
For older versions of WAMP, here are the articles.
1. Install MySQL 4.x
2. Install Apache 1.3
3. Install PHP 4.x
Steps to install Apache on Windows as development machine
Here is a list of Apache HTTP server related pages:
Step 1: Download Apache 2.2
In this article, we use Apache 2.2.14 to demonstrate the installation process. Other 2.x versions have very similar installation steps.
(1) Go to Archived Win32 binaries download page here http://archive.apache.org/dist/httpd/binaries/win32/
(2) Download Apache 2.2.14 msi installer.
Here is the direct download link apache_2.2.14-win32-x86-no_ssl.msi
Step 2: Verify the downloaded file for integrityApache download comes with a MD5 hash value. This hash value is a Checksum value that can be used to verify data and file integrity.
- File to verify: apache_2.2.14-win32-x86-no_ssl.msi
- Link from Apache to obtain the MD5 hash of this file:
http://archive.apache.org/dist/httpd/binaries/win32/apache_2.2.14-win32-x86-no_ssl.msi.md5MD5 hash obtained from Apache.org for this file: e41bf079b88265d733a559f33c559ce6
Screenshot below shows the Apache installation file was verified by freeware HashCalc.
Checksum calculated by HashCalc:
As we see above, the MD5 checksum value by Apache.org is the same as the one calculated by HashCalc, which means the file is in good shape and can be trusted.
Step 3: Start installation
Double click the installation file. The installation should start straight away. Here are 9 screenshots.
3.1 Welcome
Apache Http Server 2.2.3
3.2 License Agreement
3.3 Read First
3.4 Server Information
This step needs a bit explanation. Add localhost to both Network Domain and Server Name box. Administrator's Email Address can be anything you like. These info are used for Apache configuration file but you can change them after the installation.
Next, select the first radio button as recommended. This way, Apache will be running as a Windows Service. See Step 6 below for more info about how to start, stop, restart Apache.
3.5 Setup Type
Choose Typical as the setup type.
3.6 Destination Folder
You can leave the default installation folder as is.
3.7 Ready to install
3.8 Installing in progress
3.9 Completed successfully
Step 4: Test your installation
After install, open web browser and type either of the following URLs into your browser's address bar and hit Enter key.
- http://localhost
- http://127.0.0.1
- http://169.254.32.57 or 192.168.0.1 (eg. local network IP address)
If Apache has been installed correctly, you should see a success message opened in your web browser, as shown below.
The text actually comes from the index.html file in this directory C:Program FilesApache Software FoundationApache2.2htdocs which is the default document root directory after Apache is first installed. The document root directory can be changed in Apache configuration file. See Step 5 below.
Note: http://169.254.32.57 could be your local machine's auto assigned IP that Microsoft has reserved (addresses 169.254.00 to 169.254.255.255).
If you use a router which sets up a LAN (Local Area Network), the router can assign an internal IP. For example, Linksys assumes a default internal IP address of 192.168.0.1
To find out your computer's IP address, open a command line window and run ipconfig command:
- Click Start
- Click Run
- In the Run command box, type cmd and hit OK
- When command line window is opened, type ipconfig and hit Enter key.
Step 5: Edit the Apache httpd.conf Configuration File
Apache Configuration File is located at C:Program FilesApache Software FoundationApache2.2confhttpd.conf. It can also be opened from the Start menu as below.
Make sure you change the httpd.conf file according to the screenshots shown in the following section.
5.1 Change your document root directory to a more meaningful one.
Inside the configuration file, DocumentRoot is the directory out of which Appache executes web documents, eg. PHP, HTML, etc. It's the directory where your PHP or other web page files are placed into.
1. Commented out DocumentRoot 'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs'
2. and then added DocumentRoot 'C:/test'
So, all my php files will be located in a folder named as test on my C drive.
3. Commented out <Directory 'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs'>
4. and then added <Directory 'C:test'>
5.2 Add PHP file type into DirectoryIndex
Add the default document file names that Apache will run if we don't type its filename in web browser.
Note: for this article series, we will install PHP next. How to install PHP5 server-side scripting language on Windows
Edit the line as below shows, ie., DirectoryIndex index.html index.htm index.php
5.3 If you need to rewrite URLs on your site, enable the mod_rewrite module.
Web pages can pass variables in URLs and this is known as dynamic URLs. To make these URLs search engine and user friendly, we often change dynamic URLs to static URLs. This change is managed by the URL rewrite module.
Apache 2.2.22
To enable the URL rewrite, follow these 2 steps.
- Find the line of text shown below and remove the hash # at the beginning of the line.
#LoadModule rewrite_module modules/mod_rewrite.so
Here is how it looks after the change is made.
- Change AllowOverride None to AllowOverride All inside the DocumentRoot Directory Directive.
In our case, it is inside <Directory 'C:test'> Directive.
Here is how it looks after the change is made.
If you need to modify Hosts file, please note that Windows Vista and Windows 7 have stricter security mechanism that makes changing the hosts file a lot harder. Please refer to Microsoft Knowledge Base article http://support.microsoft.com/kb/923947 to see how to modify the Hosts file in Windows Vista and Windows 7.
Step 6: Restart Apache
After changing Apache configuration file, remember restart Apache Server so that these changes will take effect.
To start, stop, and restart Apache Server, do this: Start -> Programs -> Apache HTTP Server -> Control Apache Server.
If Control Apache Server menu is not available. You can start, stop, and restart Apache by using Microsoft Management Console for Windows Services.
Start -> Settings -> Control Panel -> Administrative Tools -> Services
By using Windows Services, you can Start, Stop, and Restart Apache from Microsoft Management Console. See screenshot below. Selecting Apache as a Windows service will make it automatically start when your computer starts up, and to keep Apache running when you log-off.
Happy Installing!Copyright© GeeksEngine.com
Related Articles:
Other Recent Articles from the WAMP & LAMP category:
|
Migrating an IHS configuration file from a previous release
The preferred method of migration is to apply your customizations over the new default configuration. If this is prohibitively complicated, it is possible to manually migrate a configuration from a prior release.
The following are steps to change an IHS 7.0, 8.0, or 8.5 httpd.conf such that it is useable on an IHS 9.0. This procedure assumes the installation paths of the old and new releases differ.
- Copy your prior releases configuration file(s) to the new installation path.
- Update paths if the install root has changed. Many absolute paths within the configuration contain the install root. Replacing old paths can be done quickly using the
sed
command, e.g. This command copieshttpd.conf
from the prior releases installation directory to the new installation directory, and replaces all instances of/opt/IBM/IHSv8/
with/opt/IBM/IHSv9/
. - Remove <IfModule worker.c> and the </IfModule> that follows it, leaving the contained directives. On Linux, IHS uses the 'event' MPM and this <IfModule worker.c> would hide the MPM configuration.
- Replace
authz_default_module
withauthz_core_module
; i.e. replace with If the module is not replaced, you will receive an error similar to the following: - Update access control. Take only one of the following actions:
- Replace the old access control directives
Order
,Allow
, andDeny
with the newRequire
directive. Refer to the Access Control section below. This is preferred. - Otherwise, load the
mod_access_compat
module by adding the following line to the configuration: - Remove
AuthSAFAuthoritative
if present (see information at the bottom of this document for more details)
- Replace the old access control directives
- Load the
mod_unixd
security module by adding the following line to the configuration: Otherwise, the following error occurs: - Update the WAS plugin by changing the
LoadModule
line from: to: - Update third-party modules to their Apache 2.4 versions. There are no general instructions for this step; contact the third-party module's vendor for explicit instructions.
If modules are not compatible with Apache 2.4, you can receive one of two types of error messages. The examples below are how the message is reported on z/OS -- the operative parts of the message are problems with symbols similar to 'ap_my_generation' or 'ap_log_error'.
The first form resembles this: To figure out which module is causing the problem, start the server with the-e debug
option, e.g. This should partially output your configuration file, and then output the error. The line of the configuration after the last line which is printed should be aLoadModule
directive containing the name of the failing module. The other type of error message that may be shown when a module is incompatible with Apache 2.4/IHS version 9.0 looks like this: The problematic module's name is contained within the error message - in this case, myapp22_module. - Search your configuration for directives such as Include, AuthUserFile, AuthGroupFile, and KeyFile. These directives may either point to files under the old installation root that need to be copied.
- If using the 'BFlagEscapeAllNonAlnum' parameter to RewriteOptions, remove it. It's the default and only behavior in this and future releases.
- Linux only: Add a line to dynamically load the Event MPM, e.g. 'LoadModule mpm_event_module modules/mod_mpm_event.so'?
- Attempt to start the server with the updated configuration. Review the output of the start command and the error_log to make sure no errors were reported. If a directive has been removed or has moved to a new module, you may see an error resemlbing this message:
Consult the rest of this document for informaton about the specific directive, then check http://publib.boulder.ibm.com/httpserv/manual24/mod/directives.html to find the proper module to load.
This step will likely require a number of rounds of iteration, as only 1 error is detected at a time.
- Optional: Review and apply other changes to the default configuration (httpd.conf.default) in the new release:
- ReportInterval has been reduced to 300 seconds.
- TrackModules On, TrackHooks allhooks, SlowThreshold 60, TrackHooksOptions logslow have been added.
- mod_backtrace is now loaded on some platforms where it was unintentionally omitted in previous releases.
- The default 'LogFormat' now has additional columns appended for serviceability.
- The default config has been updated to deny access to all directories by default and then explicitly allow access to the document root, icons, CGI-BIN, etc.
After taking all the above steps, the configuration should be ready to be loaded by IHSv9.0. The remainder of the document serves as a reference for what has changed between Apache 2.2 and 2.4.