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.

Apache on another port

Discussion in 'EasyApache' started by dev_cw, Jan 24, 2007.

  1. dev_cw

    dev_cw Well-Known Member

    Joined:
    Jun 30, 2004
    Messages:
    59
    Likes Received:
    1
    Trophy Points:
    8
    Hello,

    1) I am wondering if there is a feature in WHM to change the port for apache? Or is the only way to do this manually in httpd.conf? Also will cPanel try to change it back to 80 during updates?

    2) If we change the apache port will this break anything in cPanel?

    I am setting up pound as a proxy/load balancer in order to use mongrel to handle Ruby/Rails requests. However for this to work pound needs to be listening to port 80 and then proxy the requests to the correct locations. For example all static requests go to apache and all ruby/rails related requests will be sent to mongrel (which runs on it's own port). With apache2.2 this can be done natively but with 1.3 we need to use something like pound.

    Thanks,
    Shane
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    You would have to do that manually by editing httpd.conf. cPanel shouldn't change the port specification within the file. However, you will have to stop chkservd from monitoring httpd in WHM > Service Manager, as that checks on port 80.
     
  3. dev_cw

    dev_cw Well-Known Member

    Joined:
    Jun 30, 2004
    Messages:
    59
    Likes Received:
    1
    Trophy Points:
    8
    Code:
    However, you will have to stop chkservd from monitoring httpd in WHM > Service Manager, as that checks on port 80
    Yes, I was receiving warnings that httpd was down so I turned it off. Can we edit the chkservd script to monitor on a different port? I think I recall seeing a mention of this but I could not remember where.

    This would be a good feature for cPanel to add, i notice that a few other control panels allow you to change the port from within the panel.

    Thanks.
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You don't need to edit the script, all you need to do is edit the configuration file the script uses. The configuration file for chkservd is located within /etc (I believe it's /etc/chkserv.d/chkservd.conf). The syntax for doing port-based monitoring is as follows:

    service[serviceName] = port,send,response,restart

    serviceName = Name of service
    response = Expected Response
    restart = Full path to restart service
    send = What data to send

    So if you have a line in there still for monitoring port 80, all you would need to do is change the port to whatever your new port is and chkservd will monitor that port instead.
     
  5. dev_cw

    dev_cw Well-Known Member

    Joined:
    Jun 30, 2004
    Messages:
    59
    Likes Received:
    1
    Trophy Points:
    8
    cPanelDavidG, thanks for the great tip, my problems are solved. Sure is useful to have a config file :)
     
  6. sldubr

    sldubr Member

    Joined:
    Aug 31, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for a good theme.
    But there was one more problem. When I Create a "New Account" in a config of the apache add: NameVirtualHost xx.xxx.xxx.xxx:80
    <VirtualHost хх.хх.ххх.ххх>

    But instruction NameVirtualHost is not necessary. It is necessary that it was added only
    <VirtualHost хх.хх.ххх.ххх:85>


    Is it possible to make?

    WBR
    Slava Dubrovskiy
     
  7. thewird

    thewird Well-Known Member

    Joined:
    Jan 4, 2006
    Messages:
    54
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Toronto
    How would you change the apache port now that all virtualhosts are like this...

    <VirtualHost хх.хх.ххх.ххх:80>

    thewird
     
  8. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,460
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    1. Login to WHM as root
    2. Click Tweak Settings
    3. Scroll down to find this setting:
    The port on which Apache listens for HTTP connections. Specifying a specific IP will prevent Apache from listening on all other IPs. (default: 0.0.0.0:80)
    4. Change the value to the port number you want
    5. Scroll to bottom of page and click Save
    6. Login to server via SSH
    7. Execute /scripts/rebuildhttpdconf as root
    8. Restart Apache
     
Loading...

Share This Page