How To Change the port apache
Hello my friends
I want to change the Apache port from Port 80 to another port and be 81 for example
I login on
Usr / local / apache / conf / httpd.conf
And I change
Listen 0.0.0.0:80
Listen [::]: 80
To port 82
Sites do not work anymore
Is there another solution?
-
Hi, On the cPanel server, doing this directly from the tweak setting is the most suitable method. You can refer to the below documentation link for more details: Tweak Settings - System - Documentation - cPanel Documentation 0 -
Don't modify apache conf directly. You can change it in
WHM > Tweak Settings > Apache non-SSL IP/port
As far as your sites not working, your browser will automatically try and use port 80 so if you change to port 82 then make sure you are specifying port 82 like so: http://domain.com:82 ** I should also add, if you have a firewall, port 82 might be closed so you will need to open it up for incoming.
Unfortunately it does not work if it is changed like this The site does not work0 -
Are you specifying the port in your browser after changing the port? Is the new port opened in your firewall? 0 -
The same thing has been implemented and the sites do not work
The reason I can see for this to nor work would probably be because the new port is not listening properly. There are things that I would like you to conduct on your end: 1. From your machine, try executing telnet to the server IP on the new Apache port. eg: if you have new port as 82, use the below command: # telnet 82 Check if the above command does indeed allows you to connect and if it does not connect, then you will have to allow this new port in the firewall to allow traffic to it.. 2. Check the output of the below command on your server.. # netstat -anpt | grep :820 -
Hello, The previous posts are correct. Note that you'd need to append the port number (e.g. :82) to the end of your URL in your web browser to load the domain name over the custom port after making the change. Thank you. 0
Please sign in to leave a comment.
Comments
7 comments