how to change port number of Apache server in windows OS

Solution 1:

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.

Solution 2:

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

Listen 80

to:

Listen 1234

Or whatever port you choose!

Solution 3:

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.

Solution 4:

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