How to install Apache on Windows

While I was browsing the web i came across the topic about “how to install Apache on windows”. I found it really interesting and helpful and so in this topic i will give you the tutorial about how to install apache server on windows machine.

What is Apache

The Apache HTTP Server, commonly referred to as Apache, is web server software notable for playing a key role in the initial growth of the World Wide Web. Apache supports a variety of features, many implemented as compiled modules which extend the core functionality. These can range from server-side programming language support to authentication schemes. Some common language interfaces support Perl, Python, Tcl, and PHP. Popular authentication modules include mod_access, mod_auth, mod_digest, and mod_auth_digest, the successor to mod_digest. A sample of other features include SSL and TLS support (mod_ssl), a proxy module (mod_proxy), a URL rewriter (also known as a rewrite engine, implemented under mod_rewrite), custom log files (mod_log_config), and filtering support (mod_include and mod_ext_filter).

Popular compression methods on Apache include the external extension module, mod_gzip, implemented to help with reduction of the size (weight) of web pages served over HTTP. ModSecurity is an open source intrusion detection and prevention engine for web applications. Apache logs can be analyzed through a web browser using free scripts such as AWStats/W3Perl or Visitors.

Virtual hosting allows one Apache installation to serve many different actual websites. For example, one machine with one Apache installation could simultaneously serve www.example.com, www.test.com, test47.test-server.test.com, etc.

Apache features configurable error messages, DBMS-based authentication databases, and content negotiation. It is also supported by several graphical user interfaces (GUIs).

Reference : Wikipedia

Download

Go to http://www.apache.org/dyn/closer.cgi/httpd/binaries/win32/ and choose a mirror. Then select the appropriate file and download it.

As per last i check the latest version available is “httpd-2.2.16-win32-x86-no_ssl.msi

Install

When you install Apache, you’ll get a prompt for “Server Information.” The settings commonly used is :
{code type=codetype}

Network Domain: localhost

Server Name: localhost

Admin Email: [enter any email id whichever you prefer. It can be fake or original.]

Check for All Users, on Port 80, as a Service
{/code}

Starting/Stopping Apache

After installing, Apache2 automatically starts.

The icon in the System Tray means it started and the dam icon means the “Monitor Apache Servers” is running, but Apache2 isn’t started.

You can easily start/stop/restart Apache and Apache2 via that icon in your System Tray. If you get “The requested operation has failed!” error while starting apache use the “Test Configuration” shortcut in the Start Menu to find the error (if the text window pops up then closes before you can read it, your config file is fine).

Testing

Open your browser and head to: http://127.0.0.1/ or http://localhost/

If it shows the It works! you have your server software installed and running.

Making Apache point to your files

Using Notepad open

{code type=codetype}C:/Program Files/Apache Software Foundation/Apache2.2/conf/httpd.conf {/code}

(in the start-menu there should also be a “Apache HTTP Server 2.2 > Configure Apache Server > Edit the Apache httpd.conf Configuration File” shortcut) and search for DocumentRoot. Change it from something like DocumentRoot

{code type=codetype}C:/Program Files/Apache Software Foundation/Apache2.2/htdocs{/code}

to the location where your HTML files and site are located. In my case: DocumentRoot “C:/public_html”. Then scroll down about one page and change:

{code type=codetype}Directory “C:/Program Files/Apache Software Foundation/Apache2.2/htdocs”>{/code}

to point to the same location you set DocumentRoot to in the last step. Restart apache to make the changes take effect

Fixing other conflicting programs to work with Apache

If you are getting the pop up window that Apache Server couldn’t start; “The requested operation has failed!” yet the “Test Configuration” text window popped up quickly and went away with no configuration errors.

By default the conflicting program and Apache both want to use Port 80.

You can change the conflicting program to not use port 80 by changing the setting in the tools option. Change port 80 to some other port like 430 as alternatives for incoming connections.

It mostly works.

Fixing “cannot edit/create … http.conf file” error

Hey there, great tutorial! Everything went smooth as silk except for one little hiccup, and I’d like to post the solution for anyone else who might have this problem.

After installing Apache successfully, when trying to edit and save the httpd.conf, an error pops up saying something like
{code type=codetype}Cannot create the C:\Program files\apache Software Foundation\apache2.2\conf\httpd.conf file
Make sure the path and file name are correct{/code}
The reason this happens is because by default users do not have write permissions for this file. All you have to do is right click on httpd.conf, click properties, select the security tab, click edit, select users, and then check Full Control – Allow.

Mostly it works..

3 Comments+ Add Comment