How To Change Apache Port Number

Q: How to change Apache server default listening port number? 

Change the Apache web server's default listening port number from 80 TCP to any other port number. All you need to do is ddit the httpd.conf configuration file and specify the new port number.
Edit Apache configurations
[root@server ~]# vi /etc/httpd/conf/httpd.conf  
# Search for the line starts with "Listen" (can find near the 136th line) and add your default port number. In this example i changed default apache port from 80/TCP to 90/TCP. 
Listen 90
#Now save the httpd.conf file.
Click on screenshot to enlarge
Restart Apache Service
[root@server ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                             [  OK  ]

Open new port in Firewalls
But, If a firewill is running in the Apache server or in the network/router, you should open the new Apache server port(90/tcp) in all firewalls. 

Test new listening Port
Test new listening port by connecting server from a web browser or telnet to the server.

If the Apache server address is,
[root@server ~]#  telnet 90
Go to browser and connect to

Was this helpfull ?


Related Posts Plugin for WordPress, Blogger...

Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Coupons