ISPConfig 3 - switch to nginx/php-fpm

Discussion in 'Installation/Configuration' started by ichpen, Dec 5, 2011.

  1. ichpen

    ichpen New Member

    Hi there,

    Hoping this topic hasn't been covered but is there a relatively painless way to switch an existing ISPConfig 3.0.4.1 installation with Apache2 to Nginx + php-fpm.

    I'm running several wordpress sites and apache/suPHP is sucking the life out of my server.

    Would be ideal if there's a way to do the above whilst preserving existing ispconfig settings/config.

    This is on Ubuntu 11.10 btw.

    Thanks.

    Nik
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Suphp is the slowest possible option. It should not be used for any cms systems like wordpress, joomla etc. Go to website settings and enable the suxec checkbox, then select php mode php-fcgi, the result will be a php setup that runs your site under the website user like suphp, just several times faster.

    Then login on the shell and run thiese commands:

    apt-get install php5-xcache
    /etc/init.d/apache2 restart

    your server load will be much lower now and your sites will load fast.

    There isnt any and if you use any wordpress plugins that use custom rules in a .htaccess file, then its likely that you break the sites by switching to nginx. As I explained above, the switch is normally not nescessary, you just used bad settings for apache.
     
  3. ichpen

    ichpen New Member

    Thanks for the tips. Actually went with suphp for the simplicity of not messing around with group owners and permissions. Wordpress gets a bit finicky when it comes to permissions.

    Last time I ran fcgi, I was getting plenty of error 500s at different intervals (didn't get a chance to investigate). Maybe I'll give it another whirl.

    I am running APC already, is xcache still an option? Haven't heard of it until recently.

    P.S. I'm a java server guy btw so pretty new to php sites so excuse the ignorance.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Then you must have missed to enable suexec. As suxece plus php does the same then suphp, just much faster. suphp is a bad option as it starts a complete new php process for every incoming request while fcgi reuses them and runs as a kind of daemon. If you are a java gui, how slow would java be if you would start a fresh new java instance for every incoming http request instead of reusing them and running requests from the same instance :)

    Check the error.log of the website for the reason of the error. I run several wordpress sites without any problems.

    APC is fine, basically the ame as xcache. I prefer xcache as its available as package from the ubuntu repositories so that it gets updated with php and has not be recompiled manually.
     
    Last edited: Dec 5, 2011
  5. Geekteq

    Geekteq New Member

    Hi TIll,

    Sorry for writing in an old thread - but since it's the same question...

    I have a ISPConfig on Ubuntu 14.04 LTS running Apache2.. I would like to switch to Nginx without having to reinstall the entire machine (especially since I'm on VPS and won't retain the same IPs and stuff if I start from scratch and then move).

    I'm aware that any htaccess rules will cease working but in other terms there shouldn't be much issue? Is it merely turning off Apache and installing NGINX as per the ISPConfig installation for Ubuntu or?

    Please advise,
     
    ahrasis likes this.

Share This Page