4

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

and

ServerName localhost:80

Pls help, thanks.

joschi
  • 20,747
  • 3
  • 46
  • 50
  • 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

7 Answers7

9

Please go to the

httpd.conf

and change

Listen 80

to

Listen 8080

or any port.

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

TBI Infotech
  • 1,536
  • 9
  • 15
3

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

Listen 80

to:

Listen 1234

Or whatever port you choose!

1

Old question, but maybe this helps someone..

If you are running in a virtual host environment, just change the top line of the virtual host directive:

<VirtualHost 172.20.30.40:18080>
    ServerName www.example.com
    DocumentRoot "/www/domain-18080"
</VirtualHost>

You will still need to add the listen 18080 directive in httpd.conf.

Jahmic
  • 249
  • 1
  • 5
  • 13
1

1 Open Httpd.conf file from (c:/xamp/apache/conf) and edit Replace the words

Listen 80 to Listen 8080

2 ServerName localhost:80 To ServerName localhost:8080 And save the file.

  1. Open the file httpd-ssl.conf from (c:/ xamp/apache/conf/extra). for edit ssl port number to 8081 So need to replace

Listen 443 To Listen 8081

**<VirtualHost _default_:443> To <VirtualHost _default_:8081>**

ServerName localhost:8013 To ServerName localhost:8081

Save File

  1. Open Xamp

  2. Go to Config -> Service and Port Settings -> Appache

  3. Change Main port to 8080 and SSL Port to 8081

More in Details

0

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.

Drive:\apache-tomcat\conf\server.xml

0

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
find

(if port number you want is 85)

Listen 443

change it to

Listen 85

find change it to

find

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'/

0

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 - http://www.superpctricks.com/2013/11/running-iis-and-apache-on-same-server.html

Amar
  • 11