Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 29th November 2011, 16:59
DiscipleGeek DiscipleGeek is offline
Junior Member
 
Join Date: Aug 2011
Posts: 6
Thanks: 3
Thanked 0 Times in 0 Posts
Default 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?
Reply With Quote
Sponsored Links
  #2  
Old 29th November 2011, 20:10
stefanm stefanm is offline
Junior Member
 
Join Date: Oct 2009
Posts: 21
Thanks: 32
Thanked 5 Times in 4 Posts
Default

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?
Reply With Quote
  #3  
Old 29th November 2011, 20:24
DiscipleGeek DiscipleGeek is offline
Junior Member
 
Join Date: Aug 2011
Posts: 6
Thanks: 3
Thanked 0 Times in 0 Posts
Default

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?
Reply With Quote
  #4  
Old 30th November 2011, 11:14
stefanm stefanm is offline
Junior Member
 
Join Date: Oct 2009
Posts: 21
Thanks: 32
Thanked 5 Times in 4 Posts
Default

That looks ok. Have you tried disabling suexec for the ispconfig interface?
Reply With Quote
  #5  
Old 30th November 2011, 11:29
Ben Ben is offline
Moderator
 
Join Date: Jul 2006
Posts: 1,029
Thanks: 7
Thanked 62 Times in 56 Posts
Default

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?
Reply With Quote
The Following User Says Thank You to Ben For This Useful Post:
DiscipleGeek (1st December 2011)
  #6  
Old 1st December 2011, 20:39
DiscipleGeek DiscipleGeek is offline
Junior Member
 
Join Date: Aug 2011
Posts: 6
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by stefanm View Post
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 View Post
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

Last edited by DiscipleGeek; 1st December 2011 at 21:27.
Reply With Quote
  #7  
Old 1st December 2011, 21:23
stefanm stefanm is offline
Junior Member
 
Join Date: Oct 2009
Posts: 21
Thanks: 32
Thanked 5 Times in 4 Posts
Default

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)
Reply With Quote
The Following User Says Thank You to stefanm For This Useful Post:
DiscipleGeek (1st December 2011)
  #8  
Old 1st December 2011, 22:22
DiscipleGeek DiscipleGeek is offline
Junior Member
 
Join Date: Aug 2011
Posts: 6
Thanks: 3
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #9  
Old 1st December 2011, 23:27
DiscipleGeek DiscipleGeek is offline
Junior Member
 
Join Date: Aug 2011
Posts: 6
Thanks: 3
Thanked 0 Times in 0 Posts
 
Default

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.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ISPConfig3 mail doesn't work pehden Installation/Configuration 20 9th December 2013 14:05
Sending email issue lezelf Installation/Configuration 15 9th August 2011 11:20
ISPConfig 3 - CentOS 5.4 - SSL Problems!?! owainbaber Installation/Configuration 4 26th July 2011 17:12
Statistic not working mzo Installation/Configuration 49 20th April 2011 12:19
Loads of mysql connections to dbispconfig StrikerNL General 2 5th March 2009 14:31


All times are GMT +2. The time now is 05:59.


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