How to change XAMPP server port?

by Veera on July 8, 2009

in How To

These days, it is a common scenario that a web developer needs to use multiple web servers, all running at the same time. For example, an XAMPP server can be used to run the local Wordpress blog, while a JBoss server also needs to be up for testing a java web application or IIS server for serving your .Net app. In such scenarios, if two or more servers are trying to use the same port number, then the late comer will fail to get the port.

Take the case of XAMPP server. By default, XAMPP runs at the port 80, and IIS also use the port 80. So, you cannot run these two server at the same time. In order to avoid this issue, the XAMPP port can be modified to use a different number other the default 80.

Follow these steps to change the XAMPP server port number:

  1. Stop the XAMPP server, if it is running already.
  2. Open the file [XAMPP Installation Folder]/apache/conf/httpd.conf. As the names suggests, httpd.conf is the file which defines the properties of the Apache server, which the XAMPP is using.
  3. Now search for the string Listen 80 (I’m assuming that your XAMPP was using the port 80. Otherwise, just search for the string Listen). This is the port number which XAMPP uses. Change this 80 to any other number which you prefer. (Sorry, you can’t use billion here, as only 65536 ports are supported by computers).
  4. There is one more step to do. In the same file, search for the string ServerName. This options defines the server name of the XAMPP server, which includes the port number also. So, it is important to update this port number also.
  5. Now save and re-start XAMPP server and you are done.

{ 1 trackback }

XAMPP - Apache, MySQL, PHP, Perl environment in Windows | Java Blog | Veerasundar
July 11, 2009 at 11:19 PM

{ 13 comments… read them below or add one }

Kumarasamy July 11, 2009 at 12:17 AM

this will work out for Apache(httpd) also.

Reply

Veera July 11, 2009 at 9:20 PM

Yes Kumar. In fact, XAMPP uses the Apache as it’s web server.

Reply

Bruce August 4, 2009 at 1:58 PM

Thanks,

I knew what I needed to do but couldn’t remember where the lines were in and in which files.

Saved me a bunch of time.

Reply

Veera August 4, 2009 at 5:29 PM

You are welcome. :)

Reply

mayday82 August 8, 2009 at 1:46 AM

tried that, did not work
still not able to start apache service

changed skype port
works fine now

Reply

Veera August 8, 2009 at 6:27 AM

it might have happened because of conflicting port numbers between skype and XAMPP.

Reply

ray August 31, 2009 at 3:28 PM

been trying all day to get apache running and all i needed to do was shutdown skype!

Reply

HtmlGifted September 21, 2009 at 6:45 PM

Hay all.. great advice for the skype didn’t realize it …….. any way.. I am trying to get my web server to be able to access from internet or just by another computer on my network.. for time being… Figured about changing ports but not sure how to access it from new port can some one help….. Like http://yoursite.com/8080 ……….. Find me on my community above to contact me.

thanks… Keep up the great tips.. guys.. really useful info.

Reply

Nagaraj February 8, 2010 at 9:35 AM

After changing the port in httpd.conf You can access the login page typing http://localhost:portNumber

http://xx.xx.xx.xxp:PortNumber (which you changed in httpd.conf eg: http://10.0.10.111:8181

Nagaraj

Reply

wole January 29, 2010 at 4:17 PM

i’ve tried that solution. but apache still uses port 80. when i click ’status’ on the Xampp control panel and the browser refuses connection. Please respond urgently,i’m on a deadline!

Reply

Veera January 29, 2010 at 6:34 PM

@wole

Even after changing the port number as mentioned above, the XAMPP control panel usually displays Apache port as 80. but don’t worry about that. Re-start the XAMPP server and the port change will work.

Reply

santhosh February 9, 2010 at 9:33 AM

In skype select options dialog. In Advanced > connection tab, there is an option Use port 80 as … uncheck the option will solve the skype issue. Also make sure in windows the apache application is added automatically or manually to the firewall exception. What i still missing is although my apache status was ok my XAMPP messages shows wrong port. I was just searching for that..

Reply

Veera February 9, 2010 at 10:50 AM

I think even though you change the port number in XAMPP, the XAMPP control panel still shows the original port (i.e. 80). But the XAMPP Apache just works fine with the modified port.

Reply

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post:

Next post: