Making XAMPP (Apache) work with IIS on Windows XP/Vista
July 30, 2008
Found out the hard way that the default XAMPP install for Windows will attempt to install Apache as a service configured to run on Port 80 (no surprise, and probably good default behavior). But, if you’re like me, and have IIS already installed and running, for whatever reason, you’ll probably want to configure XAMPP to run Apache on a different port.
I initially tried merely modifying the httpd.conf file located (on my system) at C:\xampp\apache\conf, but the service would still not run. So, through a bit of searching on the interwebs, I found out what exactly needs to be changed to allow XAMPP to co-exist with IIS configured to run on Port 80, and Apache (in my case) to run on Port 8080 (and SSL running on Port 4499):
C:\xampp\apache\conf\httpd.conf:
- Search for “Listen 80″, change to “Listen 8080″
- Search for “ServerName localhost:80″, change to “ServerName localhost:8080″
C:\xampp\apache\conf\extra\httpd-ssl.conf
- Search for “Listen 443″, change to “Listen 4499″
- Search for “<VirtualHost _default_:443>”, change to “<VirtualHost _default_:4499>”
- Search for “ServerName localhost:443″, change to “ServerName localhost:4499″
Then, you should be able to start Apache successfully through the XAMPP control panel.
Let me know if this works for you; I’m just starting to mess with XAMPP on Windows (I’ve been using it on Linux for a while).

![pdx [portland] pdx [portland]](http://farm2.static.flickr.com/1046/3168818707_570cff7348_t.jpg)



August 1, 2008 at 1:40 pm
hi, just one day late, same idea, same problem. while I was able to change the port 80 of IIS to 8080, changing the SSL port is not such an easy task. using your little trick starting apache worked well though.
thanks
August 2, 2008 at 3:02 pm
Thanks for the comment, and glad to be of help! =)
August 4, 2008 at 2:22 pm
Thank you very much for your help and clear instructions. Apache is now up and running!
PB
August 4, 2008 at 2:48 pm
Awesome, glad to hear it! =D
August 5, 2008 at 5:41 am
COULD YOU SHED SOME LIGHT?
I am trying to install Moodle to learn it and test it on my Vista laptop before putting it on a server. I downloaded XAMPP and was able to make it work per your instructions. For the Moodle installation, I have been following this installation guide…
http://docs.moodle.org/en/Windows_installation_using_XAMPP
…but have gotten hung up on step four, “creating a database.” Although the XAMPP Control Panel says that Apache and MySql are both running, I cannot access localhost in my browser. Any ideas?
I searched for an answer for hours yesterday, and it seems to be a common Vista issue, but I was unable to nail down a solution. Would the port change that I made (above) affect the computer’s ability to find localhost? If you answer please break it down as simply as you can, I am very new to this.
THANKS FOR ANY HELP YOU CAN OFFER.
pb
August 5, 2008 at 11:32 am
Off the top of my head, the problem is that it’s trying to access localhost:80 instead of localhost:8080.
By default, any web address you type in attempts to access port 80 (or 443, if the address starts with https://) because this is the default HTTP protocol port. In other words, typing http://localhost in your address bar is the same as typing http://localhost:80. If you have an option to change the address that the application uses, make sure to set it to http://localhost:8080, or change the port to 8080, if that is an option.
Let me know if this helps you out, I’m curious to see if this works for you. Thanks! =)
August 5, 2008 at 3:42 pm
I tried your suggestion, and apache still starts with port 80. I changed to 8080 and 4499 as you said, in the files you said. Stopped apache, restarted, still port 80 when I run refresh from the console.
Any other ideas?
August 5, 2008 at 3:44 pm
Which version of XAMPP and Windows are you running?
Also, are you running Apache/XAMPP as a service?
August 7, 2008 at 8:11 am
Would anyone be able to point me to the apache config file on a *ix (Ubuntu) server. Install is in /opt/lampp.
Any response will be greatly appreciated.
Regards,
Walt
August 7, 2008 at 10:30 am
Walt,
Thanks for your comment!
The Apache config files for XAMPP on a *nix server should be in:
* /opt/lampp/apache/conf/httpd.conf
* /opt/lampp/apache/conf/extra/httpd-ssl.conf
Hope that helps!
August 10, 2008 at 11:01 am
Update:
According to Walt, the Apache config files for XAMPP on Ubuntu 8.04 are actually in:
* /opt/lampp/etc
August 25, 2008 at 4:00 pm
Worked a treat
Thanks
August 27, 2008 at 9:34 pm
Thanks! Worked for me! I couldn’t find any indication of port 80 being used other than Apache not running through XAMPP. Installing the latest version of Apache separately did work, but then you have to do PHP, MYSQL manualy. Good clear instructions!
September 3, 2008 at 9:57 pm
try this link:
http://www.apachefriends.org/f/viewtopic.php?t=30485&sid=ad460c0e33b1e301e3e6c257188af829
September 11, 2008 at 11:09 pm
Just what I was looking for. I have IIS and did not want to change the port on that since I use it frequently and is my primary web development environment. I am now dabbing into PHP, so that is why I am using XAMPP to give it a try. Thank you so much for your clear explanation of how to change the ports! I am now up and running wi! Thanks again!!!!!!
September 12, 2008 at 11:37 am
You Willwm, said:
“By default, any web address you type in attempts to access port 80 (or 443, if the address starts with https://) because this is the default HTTP protocol port. In other words, typing http://localhost in your address bar is the same as typing http://localhost:80. If you have an option to change the address that the application uses, make sure to set it to http://localhost:8080, or change the port to 8080, if that is an option”
Thanks to you all that works!
Now is there a way that I can change things to access localhost:8080 instead of typing that in everytime?
I’m also adventuring into Drupal and will see what happens when I get that up and running to see if that works correctly. I’m just a little gun shy with the port issue.
What would I change without affecting my current Vista system that I’m comfortable with currently?
Thanks for the help!
September 14, 2008 at 3:21 am
WOW… been figuring how to solve this problem for about 5 hours now…. thanks a lot!!!
saved my neck….
September 14, 2008 at 3:26 am
wait, just checked on localhost but i cannot access it… any help??? [just had apache running, but localhost can't be accessed]…
September 15, 2008 at 10:32 am
Sorry if you’ve already checked this, but are you sure you’re using the right port? If you’ve followed these instructions, you’ll need to access your Apache instance via:
http://localhost:8080 (or, http://localhost:4499, if you’re using SSL)
September 19, 2008 at 12:27 am
Thanks for the help. I’ve been trying to fix this problem on my new development machine. I works fine now.
September 27, 2008 at 2:10 am
This is Completely Working fine for me … thanks a tone
September 28, 2008 at 10:17 am
After trying to get this to work for 2 days finally found your blog….Thank God! working fine now
thanks
September 28, 2008 at 7:05 pm
I’m actually going to cry if I can’t get this working. I followed the steps and edited the files but Apache still won’t start.
I use Vista, I think IIS is installed and my Skype is turned off.
How come your steps worked for others but not me?
September 28, 2008 at 11:20 pm
Thanks again everyone for all of your comments!
@Kieran: Have you tried using a port scanner against your own machine to see which ports are active? I’m venturing to guess that you might have something else on port 8080 besides Skype or IIS.
September 29, 2008 at 3:12 am
Okay I just activated IIS 7. I presume I need to disable it. I’m going to do the port scan now. God its nice to find a blog thats managed frequently
September 29, 2008 at 3:20 am
80 open www-htp
135 open loc-srv
139 netbios-ssn
445 open microsoft-ds
Does this tell us anything?
September 29, 2008 at 3:21 am
netbios-ssn was meant to read open btw
September 29, 2008 at 5:02 pm
@Kieran: Hmmm. Looks like my guess was incorrect, it doesn’t seem like anything is running on your port 8080. Can you e-mail me your httpd.conf and httpd-ssl.conf files? I’d like to take a look and see what’s up.
Also - have you tried disabling Windows Firewall?
October 17, 2008 at 9:25 am
Thnx a lot. For a long time i had this problem and was searching for a solution. Even i downloaded a GUI tool to change the port number.
October 30, 2008 at 4:10 am
Thanks; I have got it working. Port 80 for IIS and 8080 for XAMPP. My provider allows me to mix .php and .asp files in the same folder; i.e. default.asp and config.php both get interpreted. How can I do that at my home server?
October 30, 2008 at 9:29 am
@Piet:
If you’re looking to mix .php and .asp(x) files in the same folder and have them served up on the same port, you’ll probably need to install PHP for IIS instead of running XAMPP:
http://www.iis.net/php
November 25, 2008 at 10:22 am
willwm
much thanks - that last ssl file edit was what i had been missing all along (although i sensed it needed to happen, just wasn’t sure where) - hours of research and work comes to an end upon discovery of this page - thanks for taking the time to post the info!!!!!!!
November 26, 2008 at 4:04 pm
In Windows, when viewing xampp-control.exe in a hex editor, “http://localhost/” and “80″ are hard-coded as null-terminated strings. There are enough null characters available that you can replace “80NULLNULL” with “809NULL”, but that doesn’t get you to 8080. C code uses a NULL character (0×00 in hex) to terminate strings, so you *must* leave the final one as a separator before the next string. It’s risky to edit the executable if you don’t know what you’re doing. On the “http://localhost/”, you can squeeze three more positions out of it, so you can add something like “:99″, but that’s it. The “localhost” string affects the URL that launches when you click the Admin button for the Apache server, and the “80″ string only affects what displays in the Console’s output. The true control is in the .conf files. Mostly, the console quirks are just annoyances. You just have to manually type “http://localhost:8080/” in your browser instead of clicking the Admin button in the console.
IIS can still run on port 80.
December 8, 2008 at 9:29 pm
[...] I have read one article today that shows about Configure Apache work with IIS on Windows XP/Vista (XAMPP) from Williamo’s Blog. [...]
December 15, 2008 at 11:12 am
[...] منبع : Williamo’s Blog [...]
December 22, 2008 at 7:08 pm
Thank You very much, it is run well with iis in 2003 server.
January 4, 2009 at 2:09 am
Just went through the same nightmare as well…
Modifying to 8080 in the way described above worked well for me. However, using the CurrPorts freeware to view who was taking 80 and 443 I found out it was skype. So, instead of modifying the config I just decided to turn off skype when I need the xampp to work. This is an alternative solution for newbees like me who are worried about later side-affects of modifying the default configuration.
January 4, 2009 at 8:56 pm
@Avidan Efody: Thanks for the info! =)
January 6, 2009 at 1:11 pm
Hi!
Thank you for an excellent solution for a non techie like me .. my apache is running now though the screen is still of iis7 when i click on http://localhost/.I have another similar problem, even my sql on xaamp is not running coz of similar port problem..it says ..port 3306 already in use.. please suggest.
Thanks.. Priya
January 6, 2009 at 3:10 pm
In regard to accessing your Apache instance, you’ll have to append the port number to the URL. Attempting to access http://localhost/ is the same as attempting to access http://localhost:80/, since IIS is running on port 80 (the default for HTTP). To access your Apache instance, if you used the same port as in the article, you’ll need to try http://localhost:8080 (for port 8080, as specified above).
In regard to port 3306, try running the command “netstat -ab” via your Command Prompt. That should tell you what’s currently running on port 3306.
January 7, 2009 at 3:09 pm
For people that don’t like “localhost:8080″ you could simply set up an entry in your hosts file. This would allow you to not only give a more meaningful name to your development site, but also gives you the option of typing less (and isn’t being lazy what programming is all about?)
Default hosts file location in XP: C:\WINDOWS\system32\drivers\etc\hosts
Default hosts file location in Vista: http://tinyurl.com/8ynau8
In the hosts file you should see a couple of examples (including how your localhost was set up in the first place). Simply follow this format to create your own personal URL (noob note: Just to make sure everyone is aware, this is like creating a DNS entry just for your individual box, no other computer looks at your hosts file…)
For example I might place do:
127.0.0.1:8080 nameofproject.local
I personally prefer that all my hosts entries end in a .local so that I always know that I am on my local machine.
It should also be noted that you must create the appropriate httpd.conf entry (so edit the ServerName section of the VirtualHost declaration)
PARENTS: Want to keep your kids off myspace and facebook? Simply edit the hosts file on your machine to take them someplace safe, like maybe here: http://www.youtube.com/watch?v=oHg5SJYRHA0