Apache HTTP Server is the number web server in the world today. More than 65% web servers in the world use apache, according to the survey by NETCRAFT (http://news.netcraft.com), you can see the comparison of all web servers at Web Server Survey.
You can build your own web server using Apache Web Server or you can test websites in an offline environment. You can also build your own shared web server where you can host websites for multiple domains online as well as offline for your intranet. In this article we are taking on the installation part of the Apache web server.
Downloading the Apache Web Server
Go to the Apache HTTP Server.
Click on the available Stable Release of the Apache Web Server as show in above snapshot.
Click on the Win32 Binary you wish to download. I downloaded Win32 Binary including OpenSSL 0.9.8r (httpd-2.2.21-win32-x86-openssl-0.9.8r.msi).
Installing Apache Web Server
- Double click on the windows installer package you downloaded in the previous step and then click “Next” button.
- Select “I accept the terms in the license agreement” radio button and click “Next” button.
- Read something about Apache HTTP Server and then click “Next” button.
- Now provide the Server Information as given below:
- Network Domain : Type your domain name if you have one and want to host here otherwise enter IP address of your machine or enter “localhost”. I have entered “domain.com”, because I want to host this domain offline on my machine. Later I will show you how to add domain name to hosts file so that we can access it through it’s name.
- Server Name : This can be either IP address of your machine or simply “localhost”. If want to host your domain offline/live provide it here. I entered www.domain.com.
- Administrator’s Email Address : This webmaster’s email address responsible for maintaining the web server.
- You can install Apache HTTP (Web) Server to listen on default HTTP TCP port 80 and install it as a windows service, so that it will be loaded automatically at windows start up by choosing “for All users, on Port 80, as a Service — Recommended.” Alternately you can configure Apache Web Server to listen on TCP port 8080 and Apache Web Server must be started manually by choosing “only for the Current User, on Port 8080, when started Manually.”
- Select “Typical” to install default components and if want to customize choose “Custom” as shown in below snapshot.
- You can install either on default path i.e. in %programfiles% or choose different path. I always prefer to install Apache Web Server in the partition/drive other than containing Operating System, because whenever you require to format the partition/drive containing OS, you don’t need to back up Apache Web Server’s configuration files. Click “Next” button.
- Click “Install” button to start the installation process.
- Below snapshot shows the installation progress.
- When installation “Finish” button will be available. Finally click on it.
Testing Apache Web Server
We have installed Apache Web Server. Now, how to determine if it works correctly. To check open up a browser window/tab and enter “http://localhost” in the address bar and hit enter. If it shows “It works!” page as shown below then congratulations for the successful installation of Apache Web Server.
Starting/Stopping Apache Web Server service
After making any configuration changes to Apache configuration file httpd.conf, you will need to restart the Apache service. One way to restart Apache service is by using “Monitor Apache Servers” tray icon loaded during Windows start up. Right click on the tray icon and then click “Open Apache Monitor”. From here you can Stop/Restart/Start the Apache Web Server service.
You can also Stop/Start Apache service from command prompt. To do this run Command Prompt (cmd) as Administrator.
To Stop the Apache Web Server service run “net stop apache2.2” command as show below:
C:\Windows\system32>net stop apache2.2 The Apache2.2 service is stopping. The Apache2.2 service was stopped successfully.
To Start the Apache Web Server service run “net start apache2.2” command as show below:
C:\Windows\system32>net start apache2.2 The Apache2.2 service is starting. The Apache2.2 service was started successfully.