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 |
[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 by connecting server from a web browser or telnet to the server.
If the Apache server address is 192.168.10.50,
[root@server ~]# telnet 192.168.10.50 90
OR
Go to browser and connect to http://192.168.10.50:90
0 comments:
Post a Comment