rootsys12

Registered
Jun 16, 2017
3
0
1
Spain
cPanel Access Level
Root Administrator
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
<VirtualHost 00.00.00.0:80>
To port 82

Sites do not work anymore

Is there another solution?
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
158
168
New Jersey
cPanel Access Level
DataCenter Provider
Don't modify apache conf directly.

You can change it in

Code:
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.
 

24x7server

Well-Known Member
Apr 17, 2013
1,911
97
78
India
cPanel Access Level
Root Administrator
Twitter

rootsys12

Registered
Jun 16, 2017
3
0
1
Spain
cPanel Access Level
Root Administrator
Don't modify apache conf directly.

You can change it in

Code:
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 work
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
158
168
New Jersey
cPanel Access Level
DataCenter Provider
Are you specifying the port in your browser after changing the port?

Is the new port opened in your firewall?
 

24x7server

Well-Known Member
Apr 17, 2013
1,911
97
78
India
cPanel Access Level
Root Administrator
Twitter
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 <Server IPaddress> 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 :82
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
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.