[Solved](104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server

24 posts / 0 new
Last post
#1 Tue, 02/26/2013 - 18:33
tazzydemon

[Solved](104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server

Sometimes when migrating sites are switching between mod_php and FCGId permissions can get mangled which cause errors such as:

(104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server

when running in FCGId mode.

I found a solution to be ass follows.

  1. Go to /home/sitename/fcgi-bin
  2. Use the follpwoing command to reset the immutable flag

    "chattr -i php5.fcgi"

  3. Then delete the /home/sitename/etc and /home/sitename/fcgi-bin directories (making sure that anything that's not php related in etc is saved)
  4. Using virtualmin switch back to apache mod_php mode and then back to FCGId mode. The site should now work Dont forget to chown any files/directories in public_html that were apache to : Note that these are both usually the sitename.

Hope this helps

Sat, 04/06/2013 - 00:25
cr0k

Thanks a lot !!!

Mon, 04/15/2013 - 11:24
p.romani@dgk.it

Yes!

Thanks!

Sat, 04/27/2013 - 19:53
anjjriit

@tazzydemon, sorry, i'm new user in virtualmin, I hope you explaint us more detil about step number 4. may be some screenshot ?

Thanks in advance

Thu, 10/10/2013 - 23:40
minhhoang

I have similar symptom when upgrade from php 5.3 to 5.4. All pages are blank. Many thank tazzydemon, you save my life! I know it's late, anjjriit but for anybody else need in step 4: 1. Open virtualmin administrator page. 2. Select domain you want to change configuration's parameter. 3. Click "Server Configuration" 4. Click "Website Options"

Regards, Minh

Thu, 12/05/2013 - 21:44
cabriolas

Ooohh yesssss!!

Thank you tazzy :D

Sat, 12/14/2013 - 11:22
Morpion

Had some strange Apache errors with OwnCloud RPC, no more now :-)

Created an account on virtualmin.com just now, just to thank you.

Mon, 03/24/2014 - 17:08
-eclipse-

Work like a CHARM :) ThX

  • Tim
Sun, 04/13/2014 - 11:59
okinara

I can see that this fix has worked for people eve for the last person which is very recent.

I have two sites both on separate accounts on virtualmin. Both had the same problem, but one of them started working( I don't know how because I kept trying a bunch of things and then I left it came back and was working).

The second site that uses the same CMS does not seem to work, even the method stated here is not working.

Does anyone know if there was a way to debug this to find out more?

Thanks.

Anyway help will be much appreciated!

Mon, 04/14/2014 - 00:49
okinara

I gave up and started from scratch, reinstalling the OS and virtualmin. It turned out a script that was sending email via SMTP was causing the issue.

Let's just hope the problem isn't lingering.

Thanks!

Thu, 10/16/2014 - 07:45
birhost
birhost's picture

Hi,

Webmin > servers > apache web server > choose the server with the problem > users and groups > and than "Run CGI programs as -User from global configuration-" and save.

www.birhost.net

Tue, 10/20/2015 - 17:57 (Reply to #11)
cyborgas

This always happen after restore backup from other server... that have diferent uids

Check Webmin > servers > apache web server > choose the server with the problem > users and groups

See if the user number (UID) and Group number (GID) are correct .

To check it, login by ssh and do this command: id

This solves the issue

Wed, 10/21/2015 - 00:59 (Reply to #12)
birhost
birhost's picture

Thanks cyborgas ;)

Mon, 06/05/2017 - 23:43 (Reply to #13)
Purple Edge

Thanks, this worked for me! I had a server restart that gave me this error on 3 out of 4 sites.

I had one site that was working without this change, and three others that only worked after this change.

Can anyone explain what this does, and why the old configuration stopped working?

Wed, 10/29/2014 - 11:50
anatolilichii

after virtualmin-base reinstall i have changed configuration file:

/etc/apache2/suexec/www-data:

    /home
    cgi-bin

to

    /var/www
    cgi-bin

my html root directory is not /home/user but /var/www/user that was the reason why I got this error message.

Tue, 01/19/2016 - 15:17
pixel_paul
pixel_paul's picture

Thanks for the solution.

Can you explain what causes this at all?

Fri, 08/19/2016 - 09:55
monsieurQ

@birhost and @cyborgas Thanks folks. This saved my day.

Mon, 09/05/2016 - 15:24
yonathan

That doesn't works for php 7.

The status of your system is being checked to ensure that all enabled features are available, that the mail server is properly configured, and that quotas are active ..
Your system has 993.86 MB of memory, which is at or above the Virtualmin recommended minimum of 256 MB.
Apache is installed.

The following PHP versions are available : 5.5.9 (/usr/bin/php5-cgi), 7.0.10 (/usr/bin/php7.0)

Webalizer is installed.

Apache is configured to host SSL websites.

MySQL is installed and running.

Logrotate is installed.

Plugin AWstats reporting is installed OK.

Plugin Protected web directories is installed OK.

Using network interface eth0 for virtual IPs.

IPv6 addresses are available, using interface eth0.

Default IPv4 address for virtual servers is 108.61.66.232.

Default IPv6 address for virtual servers is 2001:19f0:300:2b01::64.

Default IP address is set to 108.61.66.232, which matches the detected external address.

Both user and group quotas are enabled for home and email directories.

All commands needed to create and restore backups are installed.

The selected package management and update systems are installed OK.

.. your system is ready for use by Virtualmin.
Sun, 03/19/2017 - 12:56
mustardman

The actual problem (in my case) is that Virtualmin installs their own version of /usr/sbin/suexec with the little known "capability" attribute. This attribute was no longer set after restoring to a new server.

You can view capability attribute as follows:

getcap /usr/sbin/suexec

It should return:

/usr/sbin/suexec = cap_setgid,cap_setuid+ep

To set that:

setcap cap_setgid,cap_setuid+ep /usr/sbin/suexec

Alternatively you can simply reinstall it by reinstalling virtualmins httpd RPM

yum reinstall httpd

You can also just change the permission of the file although probably not quite as secure.

chmod 4755 /usr/sbin/suexec

Wed, 04/12/2017 - 07:28
erregi61

In case of php 5.6+ and/or using multiple php versions (ie: php 5.3 and php 7), be also sure to turn off register_globals

Sat, 06/24/2017 - 10:13
dzintars
dzintars's picture

I got this error after uploaded WordPress on fresh Ubuntu 16 LTS install. Fixed this by simply enabling PHP7.0 in Apache modules.

Dzintars

Fri, 05/11/2018 - 11:43
lhoucine

thank you so much tazzydemon

Sat, 09/01/2018 - 08:55
masterg0g0

Hello, i think i solved the issue by running the virtualmin permission check module..

Best Regards, Rohit
www.interstellarconsulting.com

Mon, 07/22/2019 - 21:01
ahmadmushtaq

Thank you so much! This solved my problem with FCGI and PHP 7.3

Topic locked