Trying to switch from mod_php to mod_fcgi

Discussion in 'Installation/Configuration' started by ashleykaryl, Sep 19, 2010.

  1. ashleykaryl

    ashleykaryl New Member

    I have a server which seems to be working fine for the most part except with a wordpress install, where it is proving impossible to apply any updates either to plugins or wordpress itself. This became apparent as the server was being set up but the server manager I hired liked to go walkabout for extended periods and eventually disappeared.

    I have just hired another server manager to look at this and he tells me this problem exists because the server has been set up using mod_php which he advises against and said it could be fixed by switching to mod_fcgi. After many hours of trying however, every time he attempts to fix this and restarts the httpd you see the "Internal Server Error" page with the error in the logs. He has tried changing the client limits.

    He said:

    "The fix is to use either:

    suPHP
    CGI
    FastCGI

    which run under the sites username. Any files made are made under your name, which resolves the plugin issue. The only PHP process that works on your server is mod_php, which, while fast, is not that secure as it runs under "apache".

    FastCGI and CGI come up with the same issue:

    [Sun Sep 19 05:06:45 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
    [Sun Sep 19 05:06:45 2010] [error] [client 124.168.0.12] Premature end of script headers: phpinfo.php

    suPHP also refuses to work."

    Does anybody here know how to get this to work? It seems to be surprisingly tricky.

    Thanks

    Ashley
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Using php-fcgi is realy easy in ispconfig, you just have to select it in the website settings. Go to the website settings, select "php-fcgi" in the php settings and enable the "suexec" checkbox. Then click on save and wait a minute to get the changes applied.

    If you get any errors with your php application, then you most likely uploaded the files with a wrong user, e.g. root. You have to chown all files to the website user and client group then. For details see error.log of the website.
     
  3. ashleykaryl

    ashleykaryl New Member

    I just spoke to the server manager who tried this and said:


    "done the swap to fcgi thing and this error:

    [Sun Sep 19 05:06:45 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
    [Sun Sep 19 05:06:45 2010] [error] [client 124.168.0.12] Premature end of script headers: phpinfo.php"

    Then he tried the suexec box with the same result.

    BTW we are using ISPConfig Version: 3.0.2.2.
     
    Last edited: Sep 19, 2010
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    1) Which tutorial did you use to install the server.
    2) Most likely he created the phpinfo file under the wrong user. Please post the output of the command:

    ls -la phpinfo.php

    from within the website directory.

    This is not optional. php-fcgi and suexec should be enabled together.
     
  5. ashleykaryl

    ashleykaryl New Member

    I didn't install it myself but it is running on Centos 64 bit and I'll try to discover the other information for you now.
     
  6. ashleykaryl

    ashleykaryl New Member

    I am told phpinfo.php is not owned by root, it is owned under the correct web5:client1 permissions.
     
    Last edited: Sep 19, 2010
  7. ashleykaryl

    ashleykaryl New Member

    OK here is the result of running that command:


    Under /home/www/client1/web1/web

    [root@liubliu web]$ ls -la phpinfo.php
    -rw-r--r-- 1 web1 client1 21 Jul 5 21:55 phpinfo.php

    Under /home/www/client1/web5/web

    [root@liubliu web]$ ls -la phpinfo.php
    -rw-r--r-- 1 web5 client1 16 Sep 19 03:04 phpinfo.php
     
  8. ashleykaryl

    ashleykaryl New Member

    Anybody have any suggestions on how to fix this? :confused:
     
  9. ashleykaryl

    ashleykaryl New Member

    We tried following the suggestion here but it didn't work.

    I am really surprised this is proving so difficult. Since I am the only user on the server I am wondering why we can't do this at root level so that it corrects all users and sites automatically.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    I'am not sure what the problem on your system is at is really uncommon and I can not tell you more without checking the server setup. There are about 20 thousand new ispconfig 3 installs per month and as you see, there is nothing on this topic in the forum.

    There must be a problem with the initial server install on your system. Most likely your system admin did not follow the installtion instructions from the perfect server tutorial closely when he installed ispconfig on your server. The tutorial that you used in post #8 is not for ISPConfig, so your system might not work if you use that.

    The Tutorials that should be used to prepare your server for the ispconfig install are listed here:

    http://www.ispconfig.org/ispconfig-3/documentation/
     
  11. ashleykaryl

    ashleykaryl New Member

    Thanks for your answer Till, it's looking very much like the last server manager has made a mess of the installation somehow. You are welcome to take a look at my server if you like but I am thinking it may be worthwhile starting from scratch with a clean install. I just wonder though if it would be possible somehow to save all the user settings for domains and email etc. so that any downtime can be absolutely minimal.
     

Share This Page