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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED EasyApache 4 best config?

Discussion in 'EasyApache' started by Keith007, Jun 11, 2017.

  1. Keith007

    Keith007 Member

    Joined:
    Mar 30, 2013
    Messages:
    17
    Likes Received:
    4
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Hi,

    I have a dedi server and trying to move my sites from a vps that used FCGI

    what is the fastest handler like fcgi and how easy is it to set up

    Ive had a few goes using the default profiles and tried enabling PHP-FPM but this just seems to break my sites

    any help welcome

    Keith
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  3. Keith007

    Keith007 Member

    Joined:
    Mar 30, 2013
    Messages:
    17
    Likes Received:
    4
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Hi

    I currently have SuPHP running which isn't great
    Everytime I try to enable PHP-FPM for my websites these fail to load any thing other than the front page of the site
    If I then disable PHP-FPM on the domains in multphp manager all sites still dont work

    I have to rebuild the full lot via EA4 wizard to get things working again

    How do I utilise PHP-FPM, is it just click and go and everything should work out the box or do I have to set things up ie configs

    I so baffled ! am I missing something here

    Keith
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you let us know of any error output in /usr/local/apache/logs/error_log when the website doesn't work?

    Thank you.
     
  5. Keith007

    Keith007 Member

    Joined:
    Mar 30, 2013
    Messages:
    17
    Likes Received:
    4
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    [Wed Jun 14 19:31:33.430099 2017] [mpm_prefork:notice] [pid 5403] AH00171: Graceful restart requested, doing restart
    [Wed Jun 14 19:31:33.501353 2017] [mpm_prefork:notice] [pid 5403] AH00163: Apache/2.4.25 (cPanel) OpenSSL/1.0.1e-fips mod_bwlimited/1.4 configured -- resuming normal operations
    [Wed Jun 14 19:31:33.501371 2017] [core:notice] [pid 5403] AH00094: Command line: '/usr/sbin/httpd'

    I have enabled it again and restarted apache and fpm
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Is that the only output you see in the log when attempting to browsing to a down website? If so, what do you see on the website itself? Is a 404 error page encountered, or does another error code appear?

    Thank you.
     
  7. Keith007

    Keith007 Member

    Joined:
    Mar 30, 2013
    Messages:
    17
    Likes Received:
    4
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Hi

    I get HTTP 404 Not Found

    The site uses wordpress with permilinks -

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
     
  8. Keith007

    Keith007 Member

    Joined:
    Mar 30, 2013
    Messages:
    17
    Likes Received:
    4
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Looks like Mod_rewrite doesn't work with FPM

    If I disable the permalinks and use the "plain" all works

    Should this work? and how can I get this working
     
    Nhan likes this.
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Feel free to open a support ticket using the link in my signature if you'd like us to take a closer look.

    Thank you.
     
  10. Keith007

    Keith007 Member

    Joined:
    Mar 30, 2013
    Messages:
    17
    Likes Received:
    4
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Should mod rewrite work with fpm enabled?
     
  11. vacancy

    vacancy Well-Known Member

    Joined:
    Sep 20, 2012
    Messages:
    140
    Likes Received:
    14
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Have you tried off and on the mod_userdir setting?

    I've had a similar problem with mod_userdir, I corrected it like that.
     
    #11 vacancy, Jun 14, 2017
    Last edited: Jun 14, 2017
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Yes, there should be no conflict between PHP-FPM and Mod_Rewrite.

    Thank you.
     
  13. kanbam

    kanbam Member

    Joined:
    Aug 16, 2013
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I have the exact same problem. In all the Joomla websites only the frontpage works if I enable PHP-FPM. Seems like PHP-FPM ignores the htaccess file and the redirects that are required in Joomla to show the other pages.

    Its not because Mod_Rewrite doesn't work with PHP-FPM, it ignores the htaccess file completely. If I write something nonsensical in the file to force an error, with FPM disabled apache throws error 500 (as it should) and it doesnt with FPM enabled.

    Same here, when I disable PHP-FPM I have to rebuild apache configuration with "/scripts/rebuildhttpdconf" and restart apache so the pages other than the frontpage show again.
     
  14. Keith007

    Keith007 Member

    Joined:
    Mar 30, 2013
    Messages:
    17
    Likes Received:
    4
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    There is a internal case labeled CPANEL-13303 to address this

    I have disabled the optimize .htaccess (allowOverride)

    I still have issues when installing plugins in wordpress on php-fpm and currently reverted back to fcgi with the experiential mods till all these bugs are fixed. We have held off upgrading to EA4 on all of our servers now

    Keith
     
  15. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    This case is fixed as of cPanel 64.0.27:

    Fixed case CPANEL-13303: Ensure AllowOveride blocks are added when htaccess opt enabled.

    The workaround before updating to this version or newer is to manually run the following command:

    Code:
    /scripts/rebuildhttpdconf
    Thank you.
     
  16. Keith007

    Keith007 Member

    Joined:
    Mar 30, 2013
    Messages:
    17
    Likes Received:
    4
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Hi

    I still seem to be having problems

    Wordpress freshly installed on the server
    Cpanel 64.0.29 installed
    PHP-FPM enabled for given domain

    Permalinks OFF - Site works fine, able to install plugins and browse WordPress as visitor
    But
    Permalinks ON - Unable to install plugins and get errors

    Error from Plugin page :-
    Code:
    Installation failed: <!DOCTYPE html> (function () { document.documentElement.className = 'js'})(); Page not found &#8211; Villa Giant <!--[if lt IE 9]> <![endif]--> var ms_grabbing_curosr = 'https://www.xxxxx.co.uk/wp-content/plugins/master-slider/public/assets/css/common/grabbing.cur', ms_grab_curosr = 'https://www.xxxxxxx.co.uk/wp-content/plugins/master-slider/public/assets/css/common/grab.cur'; #wpadminbar { display:none; } html { margin-top: 32px !important; } * html body { margin- .............
    
    Regards

    Keith
     
    #16 Keith007, Jul 1, 2017
    Last edited by a moderator: Jul 8, 2017
  17. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello Keith,

    Could you open a support ticket using the link in my signature so we can take a closer look?

    Thank you.
     
  18. Keith007

    Keith007 Member

    Joined:
    Mar 30, 2013
    Messages:
    17
    Likes Received:
    4
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Hi

    Here is my ticket number “8686569”.

    Regards

    Keith
     
  19. Keith007

    Keith007 Member

    Joined:
    Mar 30, 2013
    Messages:
    17
    Likes Received:
    4
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Issue is now fixed

    Cause was I had the Apache timeout set to 5 secs as when using fcgi, simply setting it to 300 secs (default) fixed my issue

    Moral of it - don't tinker with stuff ;-)

    Cheers to cpanel support

    Keith
     
    cPanelMichael and Infopro like this.
  20. intuitivsol

    intuitivsol Member

    Joined:
    Jun 29, 2014
    Messages:
    9
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Hi Keith, does "setting Apache timeout from 5 to the default 300s" completely resolve this issue? So after setting back to 300s, are you able to use MultiPHP Manager in customizing domains/accounts using PHP-FPM (turning it on/off), and setting different PHP versions, without the "404 not found" issue happening?

    I am experiencing the exact same issue and have been trying out all the suggestions in this thread. In my case, I did also try to optimize Apache by customizing the StartServers, KeepAlive, etc. and like in Keith's case, I've set the Timeout from the default 300s to something way below like 5s. But after setting this back to the default 300s, I am still encountering the same issue.

    I also tried experimenting with 'Optimize .htaccess (AllowOverride)' settings, no go. Same issue. When trying to fix the issue by doing the '/scripts/rebuildhttpdconf' command via SSH, this would only work sometimes, most of the time, it does nothing to fix the issue in my case.

    So far the only work-around that is working for me is by doing the ff:

    - go to Apache Configuration
    - change/click some settings so it will allow me to 'save'
    - so it then does:
    a.) Rebuilding httpd.conf … (Built /etc/apache2/conf/httpd.conf OK)
    b.) Restarting Apache (hard) … (1)

    So far, every time I do these steps, it seems to always fix the issue and the "404 not found" errors would go away.
     
Loading...

Share This Page