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 the support!








52 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
yes this is also possible. you can even use an application called xampp. but if you want to learn a little bit extra, manual installation is the best!
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
can you please check C:\Program Files\Apache Software Foundation\Apache2.2\logs\error.logs. And what do you mean that you can’t run apache server?
By admin on Sep 17, 2007
thank you!
By aserty on Oct 23, 2007
you are welcome!
By TechMalaya on Oct 23, 2007
Hi, thanks a lot!
By Aki on Nov 2, 2007
you are welcome. do share this among your friends for mutual benefit.
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
@ dr izdor: Betul. Tapi kalau inginkan lebih fleksibiliti, menambah kemahiran diri. Setup sendiri adalah cara terbaik. Dan saya pasti Apache2Triad tak sesuai untuk production web server.
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
@Jon: I recommend that you uninstall, delete the Apache folder, and reinstall Apache again. That looked serious! If it happened again, go to Apache Forum for expert tips.
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
@Joe: Good luck Joe! I hope you can continue all the planned work with success.
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
@11Tigers: I don’t know what went wrong. Looks like a broken .htaccess file / misconfiguration. Try Listen 80, and ServerName http://www.testing.co.nz first before changing it to 8080. Make sure that you are not running any other service with port 80 or 8080. And one more, make sure you can ping http://www.testing.co.nz and that it points to your computer, not other external servers please.
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
@kim: You should try it then. Never tried it on Vista. Not a fan of the OS either. lol.
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
@Darren: I use the one without OpenSSL. Just put up an imaginary domain name at the end of the 127.0.0.1 line. Make sure you can ping it and get a reply.
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
@kim: Congrats Kim!
By Syahid A. on Aug 13, 2008
Syahid
I have followed your instructions to install Apache but I keep this error message, I have uninstalled and deleted the folder four times now but I still the same error message
Httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 10.235.221.232 for ServerName
Only one usage of each socket address
is normally permitted. : make_sock: could not bind to address 0.0.0.0.80
no listening sockets available , shutting down
Unable to open logs
Note the errors or messages above, and press the key to exit.
Please advise what I can do to resolve this problem
By Wisdom on Aug 29, 2008
@Wisdom: Shut down your Apache server. In command prompt, type netstat. If you can find some other addresses that is currently using port 80, you need to find that process first before you can run Apache again. Based on your log, I think there are other services that are currently using port 80 (http port). And do make sure you have the rights to install applications as the machine / Windows administrator.
By Syahid A. on Aug 29, 2008
Thanks I have sorted it out Apache is running fine what I want to do next is to install Mod_Security in Apache been trying but having some difficulties any ideas to help me
By Wisdom on Aug 29, 2008
Syahid,
I just tried your tip and almost done. But some errors are still coming . I tried removing the directory and installing again. Can you help me out.
————————————
Installing the Apache 2.2 Service
The Apache 2.2 service successfully installed.
Testing httpd.conf
Errors reported here must be corrected before servicecan be started.
httpd.exe: could not relaibly determine the servers fully qualified domain name, using 123.237.135.53 for server name
(OS 10048) Only one usage of each socket address(protocol/network address/port) is normally permitted. make_sock : could not bind to address 0.0.0.0:80 no listening sockets available
By K.Kumar on Sep 13, 2008
@K.Kumar: It seems that port 80 had already been used by another web server. Remove the previous application and di restart Apache. Make sure your firewall did not block access to port 80 via to the IP address above + localhost.
By Syahid A. on Sep 14, 2008
Thanks. Done
By KK on Sep 14, 2008
hi, thank you very much for taking time to post these instructions, tried it and it works.
By kerigan on Oct 4, 2008
Hi,
thanks for posting these instructions!!
was lost, now have apache running
many thanks
Mike
By mike robinson on Oct 15, 2008
So getting the webserver to works is …easy but now i need to connect it to dreamweaver and the php files- that seems to be the hardest ..right maybe a link or a tutorial please.. i am using windows vista thank you
By bod on Oct 28, 2008
@bod: I don’t think it is that hard. Sorry, but I don’t have an idea of how that works. Maybe you can check out the Dreamweaver tutorial.
By Syahid A. on Oct 28, 2008
how to make another pc ( client) can connect to my web server? F.Y.I i only allow my web server to be seen in LAN….
i hope someone can HELP me..
tq…..
By zafrol on Nov 2, 2008
@zafrol: Check out my HFS server tutorial with DynDNS setup.
By Syahid A. on Nov 4, 2008
in case of having IIS installed the error “other webserver using same port” will show up, go to controlpanel/administrative tools/services and stop and disable iis and windows process controller.
Reinstall apache server, and all will be ok!!!
By Santos on Nov 10, 2008
Thanks a lot. Your help was super!!!!!!
By Argy13 greece on Feb 14, 2009
First off, thanks for your tutorial! I have a problem not discussed here as far as I can tell. Apache is running great, but the when I put the second site’s URL in a browser, I get the first site’s contents. Any ideas on how to clear this up? These sites are not just local, they should be accessible via internet. Thanks.
By wencooley on Feb 18, 2009
@wencooley: Do you setup two Apache servers inside your local LAN and you want to have them accessible via the Internet? I think you need to play around with static IP + DNS.
By Syahid A. on Feb 18, 2009
Thank you for the useful guide. Finally a computer whiz that can break it down for us noobies.
By Shane on Feb 27, 2009
thank you for this very useful guide
By mirsad on Mar 12, 2009
Hi, my apache server is working fine. But after that I installed mysql in my pc and configured accordingly. All other normal php pages are displayed properly but when I connect to mysql database thru php error logged in log file as follows
‘http://localhost:8080/test.php’
error logged at error.log as “httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName
“
By maggie on Mar 14, 2009
@maggie: I’ve never used 8080 in the above guide. Check your host name and port number. Make sure what you enter in the MySQL config is the FQDN in all your setup previously. Then, I doubt the error will happen again.
By Syahid A. on Mar 14, 2009
At last I’ve been able to make Apache work
Thank you so much
By Sioux on Apr 22, 2009
I was wondering if you could set up some sort of system so when your publish a new article, i get emailed to alert me? Or something like that.
By los angeles home investor on Apr 25, 2009