Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed xampp control panel and Apache 2.2 on windows XP when I type http://localhost/ gives me page which says It Works!

Now, I want to change the port number 80 to some other number

How to change it ? in how many files does it needs to be changed ? dose it require to restart the system to change to take effect ?

Note: I have changed port number in C:\xampp\apache\conf\httpd.conf

in two places where it says

Listen 80


ServerName localhost:80

Pls help, thanks.

share|improve this question

migrated from Mar 9 '10 at 6:39

This question came from our site for professional and enthusiast programmers.

Edit your "httpd.conf" file and replace the number 80 to whatever you like, e.g, 90 in "Listen 80" so this would change to "Listen 90". – Sohail xIN3N Jun 23 '14 at 11:21

Please go to the


and change

Listen 80


Listen 8080

or any port.

Remember to allow that port through firewall and you have restart the Apache service not the system.

share|improve this answer

Go to your httpd.conf file and on about like 40ish change:

Listen 80


Listen 1234

Or whatever port you choose!

share|improve this answer

Go to your apache-tomcat Installation folder there you find conf folder inside that server.xml file will be there.. You can change the port number and configuration setting for your server.


share|improve this answer

thanks for response

but only changing port number in: C:\xampp\apache\conf\httpd.conf didn't work (apache couldn't start)

so with above mention change,

we have to change port number in another file to make it work

i have changed in : C:\xampp\apache\conf\extra\httpd-ssl.conf

in above file

(if port number you want is 85)

Listen 443

change it to

Listen 85

find change it to


ServerName localhost:443

change it to

ServerName localhost:85

the port number in C:\xampp\apache\conf\httpd.conf and C:\xampp\apache\conf\extra\httpd-ssl.conf should be different.

restart Apache service in XAMPP Control Panel and type in your browses address bar : http://localhost:'port number'/

share|improve this answer

It is quite easy .You need to make few changes to httpd.conf file as follows: Listen 80 to Listen 8080 and ServerName localhost:80 to ServerName localhost:8080

For more detailed info with screenshots ,you can refer this -

share|improve this answer
Please summarize the article that you linked, quoting any relevant code segments or configuration blocks. Sites can change in the future or fail to load for any number of reasons. – tristan Nov 27 '13 at 14:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.