Beginners Guide: Install Apache 2 Web Server on Windows (Local Installation)
September 2, 2007 – 11:12 pmFor beginners out there, here is a simple guide for you to run Apache 2 web server locally on your Windows machine. Running a web server locally means that you will give your machine a local, imaginary domain name such as www.yourmachine.com or www.ihavemyownwebserver.com.
![]()
A local web server can serve web pages as a live web server, but it is restricted to machines from your local area network. A local web server can’t server web pages to users on the Internet - you need to buy a proper domain name and a live web hosting service for that to work.
Advantages of a Local Web Server
-
It is free to use - you don’t have to buy anything to have a local web server. You don’t need to have a live Internet connection to run it too!
-
Great for testing out products - you can test many web applications with a local web server. You can run Wordpress, ActiveCollab and more!
-
Enjoy the same web server experience - running a local web server does not differ much from running a live one. The only difference is that your web server will only be available on your LAN.
Step by Step Installation of Apache 2 Web Server on Windows
I tested this on my machine that runs Microsoft Windows 2000 Professional. Windows XP users should have no problem using this guide.
Network Setup
1- Open up your “hosts” file with a Notepad. On Win2K, it is located at C:\WINNT\System32\drivers\etc. On WinXP it is located at C:\Windows\System32\drivers\etc.
2- Check out the line that starts with 127.0.0.1. Add your imaginary web server name at the end of the line. Put something like www.syahid.com or www.mywebserver.com. Save your “hosts” file.
A “hosts” file is used to map your IP address to a server name. In this case, 127.0.0.1 equals the web server name of your choice.
Example hosts file line: 127.0.0.1 localhost syahid www.syahid.com
3- Click your Windows Start button. Click on “Run“. Type “cmd” and click Enter. A DOS command prompt will appear.
4- Type “ping www.syahid.com” or whatever name you give your web server before. Your machine should give a reply as shown in the picture below.

Download and Install Apache Web Server
5- Go to Apache 2 download page. Always download the latest stable version. During the time of this installation, the recent stable version of Apache 2 for Windows installer (.msi file) is 2.2.4. Download this file to your Desktop.
6- Right click on the the installer file, select “Install“. Accept the agreement and click Next. Click Next once more.
7- Fill in your web server information details as shown in the screenshot below.

For example, if your server name is www.syahid.com, here is what you fill in in the fields:
- Network name : syahid.com
- Server name : www.syahid.com
- Administrator’s name: <leave this as default>
Click Next again.
8- Select “Typical Install“. Click Next.
9- Accept the default installation path - C:\Program Files\Apache Software Foundation\Apache2.2\ , or change it according to your preferences. Click Next to proceed.
10- Wait until the installation is over, then click Next once more and click Finish to wrap up the installation process. Apache will starts automatically and you can see a “green Apache icon” on your taskbar.
![]()
Test Apache Web Server Installation
11- Click on the icon as shown above, click “Open Apache Monitor“. Try to Stop, Start and Restart the web server service from the Apache Monitor console. Make sure every step is successful.

12- Open up your browser. Type in your web server address, e.g http://www.syahid.com . If there is no problem with your installation, you shall get the “It works!” page.

Your Apache 2 web server installation is a success! Congratulations! Now you can fill in your web server directory with all your HTML files. Your default web directory page will be C:\Program Files\Apache Software Foundation\Apache2.2\htdocs .
That was easy! Maybe next time I will show you on how to integrate support for PHP and MySQL into this installation. So don’t forget to check out this site soon!
Tags: apache, web server, how to
Love this post? You may want to subscribe to my RSS feed. Thanks for visiting!













29 Responses to “Beginners Guide: Install Apache 2 Web Server on Windows (Local Installation)”
one Apache package that I have used for some time is Apache2 Triad, a WAMP distribution. this has a full install of Apache,PHP,Perl,Mysql,SlimFTP and more. Which makes testing database driven apps,and php apps and more very simple with a one click install
By CrossFire on Sep 4, 2007
By syahid on Sep 4, 2007
sy dah berjaye install but then i cant run the apache weh server…y is that?..thanks
By najlaa on Sep 17, 2007
By admin on Sep 17, 2007
thank you!
By aserty on Oct 23, 2007
By TechMalaya on Oct 23, 2007
Hi, thanks a lot!
By Aki on Nov 2, 2007
By TechMalaya on Nov 2, 2007
Tak perlu susah-susah. Muat turun saja dan pasang Apache2Triad. Semuanya akan ditetapkan oleh perisian berkenaan dengan sendiri. Saya telah lama melaksanakannya.
By dr izdor on Dec 8, 2007
By Syahid Ali on Dec 8, 2007
when installing apache 2.2 on winxp get a error message cannot open device or specific folder
By kevin on Mar 12, 2008
posted message sorted error it was due to the file being encrypted - thanks for your site
By kevin on Mar 12, 2008
Hi Syahid,
Thanks for your instructions, I successfully installed Apache, but got the following errors. Please help!
1. What is “The operation has failed?” after I clicked Start from Apache Service Monitor?
2. What does this mean on Error Log?
[Fri Apr 11 20:40:59 2008] [crit] (OS 10022)An invalid argument was supplied. : Child 2344: setup_inherited_listeners(), WSASocket failed to open the inherited socket.
[Fri Apr 11 20:40:59 2008] [crit] Parent: child process exited with status 3 — Aborting.
Thanks - Jon
By Jon on Apr 12, 2008
By Syahid A. on Apr 12, 2008
Everything went perfectly for Apache 2.2.8 install onto my Tablet Laptop running XP Pro. Thanks for the help/screenshots. Now I plan to install MySQL 5.0.51a & PHP 5.2.5
All so I can learn and help with the growth and development of an older website
Thanks again and if you know of any great tutorials…
By Joe on Apr 24, 2008
By Syahid A. on Apr 24, 2008
Superb! Thanks a ton.
By Rajesh Panchal on May 14, 2008
I have followed the instructions above, and installed apache2.2.6 on D:\Apache2.2. My httpd config:
ServerName testing.co.nz:8080
Listen 8080
The server is running and stopping fine, except when i typed http://www.testing.co.nz in the firefox browswer i was propmted for the username and password.
How ever if typed http://www.testing.com:8080 i get “It works” page.
where do i go wrong please help me…..can someone explain to me. thanks.
By 11Tigers on May 29, 2008
By Syahid A. on May 29, 2008
Hi again, can you tell me is the set up for the above the same on windows vista? (just bought a new laptop and its got this rubbish on it!)
By kim on Jun 22, 2008
By Syahid A. on Jun 23, 2008
if i don’t have a domain name, i can use “localhost” in network name and server name right? would i need to put “localhost” in the hosts file and use the 127.0.0.1 ip address?
By Darren on Jun 23, 2008
By Syahid A. on Jun 23, 2008
Hi again, just to say yes it does work on vista without too much pain either! You cant add your imaginary web name to the host file and so have to use localhost, but everything else works the same! Still cant stand vista but needs must it works! Thanks
By kim on Jul 1, 2008
just a quick update. Yes you can add your imaginary web name to the host file….. you just need to run notepad in administrator mode! I now have php5, mysql, apache, pear and phpmyadmin all working on vista. Thanks to this tutorial! working on my first content management system!!! eck
By kim on Aug 13, 2008
By Syahid A. on Aug 13, 2008