Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

EasyApache 4 killing and not restarting nginx site

Discussion in 'EasyApache' started by TheFez, Nov 15, 2018.

Tags:
  1. TheFez

    TheFez Member

    Joined:
    Nov 15, 2018
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Pittsburgh, PA
    cPanel Access Level:
    Root Administrator
    I have an inherited server running Apache on several IPs and nginx on 1 IP. EasyApache 4 is installed. Occasionally EA runs and updates Apache. The process seems to be that EA kills all processes running on port 80 regardless of whether the service is Apache or nginx. Once EA completes its updates, it restarts the Apache processes while nginx is left stopped.

    Is there a way to tell EA to either 1) only kill port 80 processes by the daemon name so that only Apache is shut down or 2) to ignore processes bound to a particular IP address or 3) to restart nginx at the same time Apache is restarted?

    Basically I need EA to play nicely with nginx or ignore the service and the IP it's bound to. I do have the nginx IP set as reserved in cPanel/WHM if that makes any difference.

    Thanks in advance. I'm a cPanel/WHM/EasyApache noob and more familiar with configuration by conf files and command line. Unfortunately that is not an option for the server in question.
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,309
    Likes Received:
    2,155
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @TheFez,

    Are you using a specific third-party plugin for Nginx or is this something you've manually configured on your own? If you've setup Nginx on your own, you could look at how other Nginx plugins handle the Apache ports to get a better idea of how to approach the issue. For example, the apache_change_port function on the following third-party Nginx plugin might help:

    engintron/engintron

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. TheFez

    TheFez Member

    Joined:
    Nov 15, 2018
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Pittsburgh, PA
    cPanel Access Level:
    Root Administrator
    I'm not using any plugins for nginx. It was installed through rpm via yum and nginx is managed outside the scope of cPanel. I'm looking to configure EasyApache to only kill processes running on port 80 for IP addresses assigned to Apache and to ignore IPs assigned to nginx. Or to only kill httpd and not nginx. Let EasyApache manage Apache and leave nginx alone.
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,309
    Likes Received:
    2,155
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @TheFez,

    Keep in mind that using Nginx and Apache together is unsupported on cPanel & WHM. It generally requires the development of a multifaceted plugin (like the one referenced in my last response). That said, if you're looking for a simply fix, would changing the default ports utilized by Apache help? If so, you could configure Apache to run on different ports by adjusting the following options under the System tab in WHM >> Tweak Settings:

    Apache non-SSL IP/port
    Apache SSL port


    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. TheFez

    TheFez Member

    Joined:
    Nov 15, 2018
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Pittsburgh, PA
    cPanel Access Level:
    Root Administrator
    Sounds like this is not possible without changing Apache to use non-standard ports, which is obviously a no-go. I appreciate the assistance, but it is frustrating that EasyApache isn't a little more cognisant of not stomping on other services. Why it can't do a systemctl stop httpd rather than killing everything it finds on port 80 and 443 is ridiculous.

    I'll go with writing a script in the postupcp that restarts nginx after EasyApache does its murderous rampage upon nginx.
     
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,309
    Likes Received:
    2,155
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi @TheFez,

    Is there a particular issue you'd face when configuring Apache to run on non-standard ports? The virtual hosts are configured automatically upon adjusting those options in WHM >> Tweak Settings.

    EasyApache 4 is designed and tested to be used with Apache. We do have a couple of planned feature requests that would offer native support for Nginx:

    Nginx proxied to Apache (not standalone Nginx)
    Stand-alone nginx supported as an alternative to Apache

    However, in the meantime, integrating Nginx directly through your YUM isn't recommended. Instead, you'd need to build out a custom EasyApache 4 RPM using the guidelines documented at:

    Tutorial - Building Custom Packages For EasyApache 4

    Or, have you thought about using a third-party Nginx plugin that's already designed to integrate with EA4? Another alternative is LiteSpeed, which also is designed to integrate directly with EasyApache 4.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. TheFez

    TheFez Member

    Joined:
    Nov 15, 2018
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Pittsburgh, PA
    cPanel Access Level:
    Root Administrator
    Yes, I'm not looking to send users to www.notreallymysite.com:8088 or whatever. No one is going to type that in. Any existing links will be broken.
     
    cPanelMichael likes this.
  8. Anoop P Alias

    Anoop P Alias Well-Known Member

    Joined:
    Mar 31, 2015
    Messages:
    102
    Likes Received:
    14
    Trophy Points:
    18
    Location:
    Kochi,Kerala,India
    cPanel Access Level:
    Root Administrator
    You do not need to send customers to alternate ports. You can simply have nginx listen on 80/443 and have the one site you need directly served by nginx and other sites proxied to Apache.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #8 Anoop P Alias, Nov 20, 2018
    Last edited by a moderator: Nov 20, 2018
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice