The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How To Change the port apache

Discussion in 'EasyApache' started by rootsys12, Jun 16, 2017.

  1. rootsys12

    rootsys12 Registered

    Joined:
    Jun 16, 2017
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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?
     
  2. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    588
    Likes Received:
    88
    Trophy Points:
    153
    Location:
    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.
     
  3. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,399
    Likes Received:
    52
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
  4. rootsys12

    rootsys12 Registered

    Joined:
    Jun 16, 2017
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Spain
    cPanel Access Level:
    Root Administrator

    Unfortunately it does not work if it is changed like this

    The site does not work
     
  5. rootsys12

    rootsys12 Registered

    Joined:
    Jun 16, 2017
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Spain
    cPanel Access Level:
    Root Administrator
    The same thing has been implemented and the sites do not work
     
  6. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    588
    Likes Received:
    88
    Trophy Points:
    153
    Location:
    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?
     
  7. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,399
    Likes Received:
    52
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    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
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page