Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: How to install Apache Web Server on a Windows System ?  (Read 6071 times)

0 Members and 1 Guest are viewing this topic.

Afijith

  • Guest
How to install Apache Web Server on a Windows System ?
« on: March 22, 2015, 07:50:14 pm »
The Apache HTTP Web Server is one of the widely used web-server nowadays. By its open source nature it can be run on a large number of different operating systems, including Windows. This article will teach you how to install the Apache web server on your Windows system.


Step 1 :


If you already have IIS or any other webserver installed, remove it or disable its services.

If you have installed Skype like applications which is set to listen to port 80 by default, you can either use an alternative port for that application or you can switch it off. Otherwise, you will have to change the Apache listening port then.

Step 2 :

Download the specific version of Apache Windows binary from any of the source providers.

A version that has more performance and stability improvements over the official Apache distribution can be downloaded from : http://www.apachelounge.com/download/

Make sure that you system has Windows C++ runtime installed. If no, you can download and install it from Microsoft official download center : http://www.microsoft.com/en-us/download/details.aspx?id=5638

Extract the downloaded files, we will install Apache in C:Apache2, so extract the ZIP file to the root of the C: drive.

Note : Apache can be installed anywhere on your system, but you will need to change the configuration file paths accordingly.

Step 3 :

Configure Apache

Open the configuration file 'confhttpd.conf' in a text editor, there are several lines you should change for your production environment.

Line 46, listen to all requests on port 80:

Code: [Select]
Listen *:80
Line 116, enable mod-rewrite by removing the # (optional, but useful):

Code: [Select]
LoadModule rewrite_module modules/mod_rewrite.so
Line 172, specify the server domain name:

Code: [Select]
ServerName localhost:80
Line 224, allow .htaccess overrides:

Code: [Select]
AllowOverride All
Step 4:


By default, Apache return files found in its htdocs folder. If you wish, you can change the path in httpd.conf accordingly:

Line 179, set the root:

Code: [Select]
DocumentRoot "C:/inetpub"
and line 204:

Code: [Select]
<Directory "C:/inetpub">
Step 5 :


Now the Apache configuration can be tested. Run the following command from a command prompt.

Code: [Select]
cd Apache2bin
httpd -t

Step 6 :

Install Apache as a Windows Service

The easiest way to start Apache is to add it as a Windows service. From a command prompt, enter:

Code: [Select]
httpd -k install
Open the Control Panel, Administrative Tools, then Services and double-click Apache2.2. Set the Startup type to “Automatic” to ensure Apache starts every time you boot your system.

Step 7 :

Test the web server

Create a file named index.html in Apache’s web page root (either htdocs or C:/inetpub)and add a little HTML code:

Code: [Select]
<html>
<head><title>testing Apache</title></head>
<body><p>Apache is working!</p></body>
</html>

Ensure Apache has started successfully, open a web browser and enter the address http://localhost/. If all goes well, your test page should appear.

You can alter the configuration to any level as per your desire, you can use the apache official documentation for reference.

Hope you will try this!! Cheers  :)
« Last Edit: March 22, 2015, 07:52:09 pm by Afijith PS »