Tuesday, 11 September 2012

How to change the Apache HTTP port number


The default apache HTTP Listen port number is 80. If you want to change this port, you need to edit the httpd.conf file.
If you have installed apache http server from source code, then the default installation path is/usr /local/apache2 or if you have installed it  using repository then the apache configuration file httpd.conf is located under /etc . ie /etc/httpd.conf
Open the httpd.conf file
vim /usr/local/apache2/conf/httpd.conf
Listen 80
Change the port number to your desired port number from 80
Listen <Your_port_number>  
For example  i here changed the port number from 80 to 8081
Listen 8081
Check your firewall settings and ensure that your desired port number is opened.
After changing the port number restart the apache server
You can restart it by using one of the following way
/usr/local/apache2/bin/apachectl -k restart
service httpd restart
/etc/init.d/httpd restart
service apache2 restart
/etc/init.d/apache2 restart
Now fireup your browser with http://localhost:8081 or http://127.0.0.1:8081

0 comments:

Post a Comment

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | coupon codes