HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   ISPConfig no longer runs: 500 Internal Server error & mod_fcgid: error reading data (http://www.howtoforge.com/forums/showthread.php?t=55165)

DiscipleGeek 29th November 2011 16:59

ISPConfig no longer runs: 500 Internal Server error & mod_fcgid: error reading data
 
I've been running ISPConfig on CentOS 5.7 Final in an Amazon EC2 instance for several weeks with no problems with ISPConfig itself.

Our server had been hitting its max in RAM and chugging out the sites, but we discovered that it's because Amazon's EC2 does not come preinstalled with swap. I got swap running and now all my sites are running fine... except ISPConfig.

Now, when I go to the ISPConfig control panel, I get a 500 internal server error. The only logs that show anything are the apache error_log:

Code:

[Tue Nov 29 09:31:46 2011] [warn] [client 97.67.115.165] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Tue Nov 29 09:31:46 2011] [error] [client 97.67.115.165] Premature end of script headers: index.php

In an attempt to locate and resolve the issue myself, I searched the boards and found a couple of threads that seemed like they might have something to do with my issue:


http://www.howtoforge.com/forums/sho...FastCGI+server

Unfortunately, while the issue is close, the solutions don't really fit my server, especially since the php script is ispconfig itself.

And finally here:

http://www.howtoforge.com/forums/sho...FastCGI+server

Which suggested that I run the update for ISPConfig. I did this with no change in status.

Please help?

stefanm 29th November 2011 20:10

Hi,

last time I encountered this problem it was just a matter of file ownership.
Can you take a look at your suexec.log and check whether suexec has stopped the script execution? Perhaps user:group of the files are not correct anymore?

DiscipleGeek 29th November 2011 20:24

from the suexec.log

Code:

[2011-11-29 13:17:01]: uid: (5003/ispconfig) gid: (5004/5004) cmd: .php-fcgi-starter
[2011-11-29 13:17:02]: uid: (5003/ispconfig) gid: (5004/5004) cmd: .php-fcgi-starter

Not being familiar with suexec, I'd say that this just indicates that it fired off, not necessarily that it blocked it, am I right?

stefanm 30th November 2011 11:14

That looks ok. Have you tried disabling suexec for the ispconfig interface?

Ben 30th November 2011 11:29

From what I read when googling around for that issue, is this maybe
- a timeout error, that the script takes too long to generate data to send
- the request limit is reached for fcgi processes

Can you reproduce the error anyhow?

Does raising the loglevel in apache help to get any further details?

DiscipleGeek 1st December 2011 20:39

Quote:

Originally Posted by stefanm (Post 268580)
That looks ok. Have you tried disabling suexec for the ispconfig interface?

At the risk of sounding completely ignorant, how do I do this for just one site?

Quote:

Originally Posted by Ben (Post 268582)
From what I read when googling around for that issue, is this maybe
- a timeout error, that the script takes too long to generate data to send
- the request limit is reached for fcgi processes

Can you reproduce the error anyhow?

Does raising the loglevel in apache help to get any further details?

These are the results of raising the log level to debug:

Code:

[Thu Dec 01 13:27:11 2011] [debug] fcgid_proc_unix.c(354): mod_fcgid: call /var/www/ispconfig/index.php with wrapper /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter
[Thu Dec 01 13:27:11 2011] [info] mod_fcgid: server server.gracesites.com:/var/www/ispconfig/index.php(11806) started
[Thu Dec 01 13:27:11 2011] [warn] [client 97.67.115.165] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Thu Dec 01 13:27:11 2011] [error] [client 97.67.115.165] Premature end of script headers: index.php
[Thu Dec 01 13:27:17 2011] [info] mod_fcgid: process /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter(11806) exit(communication error), terminated by calling exit(), return code: 0

Also, here's the contents of the php-fcgi-starter wrapper file that's referenced:


Code:

#!/bin/sh
PHPRC=/etc/
export PHPRC
export PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_CHILDREN=8
exec /usr/bin/php -d magic_quotes_gpc=off -d session.save_path=/usr/local/ispconfig/server/temp


stefanm 1st December 2011 21:23

For any web domain created in ispconfig you can disable suexec on the configuration page for the web domain.

To disable suexec for the ispconfig interface, you should do the reverse of what is explained in chapter 6.3 of the ispconfig manual (you need to comment in some lines in the ispconfig vhost)

DiscipleGeek 1st December 2011 22:22

Well, the manual says to use suexec, I'd need to comment out the IfModule mod_php5 section of /etc/httpd/conf/sites-available/ispconfig.vhost so, to not use it, the reverse would be true, correct?

Well the interesting thing is that it already was uncommented. However, the ifmodule mod_fcgid.c section was above it. On a hunch, I commented THAT out.

The ispconfig site then went to the apache httpd.conf default directory which was a custom file the other admin that's helping had created at /var/www/html/index.html

So apparently the ifmodule mod_php5.c was failing. Poked around a bit and saw that php.conf under the httpd/conf/conf.d/ folder had


<IfModule prefork.c>
LoadModule php5_module modules/libphp5.so
</IfModule>
<IfModule worker.c>
LoadModule php5_module modules/libphp5-zts.so
</IfModule>

commented out. I uncommented and restarted apache and everything is working now. But not through fcgi. So while ispconfig is WORKING, fcgid is probably still broken. *grumble*

Thanks for the help.

DiscipleGeek 1st December 2011 23:27

And bingo, I found the actual problem.

As previously noted, the wrapper was written thusly:

Code:

#!/bin/sh
PHPRC=/etc/
export PHPRC
export PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_CHILDREN=8
exec /usr/bin/php -d magic_quotes_gpc=off session.save_path=/usr/local/ispconfig/server/temp

I took a look at a couple of the other websites that ispconfig had created, as well as the master php-fcgid-starter wrapper...

they all called /usr/bin/php-cgi instead of /usr/bin/php

I made this change and it fixed the issue completely.

I also want to note, for anyone else that might use this as reference in the future the comment on this page:

http://www.howtoforge.com/how-to-set...#comment-30451

Quote:

Never use PHP_FCGI_CHILDREN with mod_fcgid
Submitted by George Negoita (not registered) on Wed, 2009-09-09 15:25.
I've spotted another problem in this setup. You should never use PHP_FCGI_CHILDREN while using mod_fcgid, because mod_fcgid will never send more than one request at a time to a running php process.

You cand find more info here: http://wherethebitsroam.com/blogs/je...hpfcgichildren
While this didn't have anything to do with my problem, in my search for a solution I'd come across several documents stating that this needed to be set, when in fact it doesn't.


All times are GMT +2. The time now is 23:43.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.