I’ve been batling this problem since moving to CentOs 7 and the latest version of Virtualmin:
I have a script that runs in FCGId (run as virtual server owner), in CentOs 6.4 there was no issue.
The script will either run for hours or crash right away, there is absolutely no logic, completely random.
The errors:
[fcgid:warn] [pid 20985] (104)Connection reset by peer: [client x.x.x.x:53302] mod_fcgid: error reading data from FastCGI server, referer: https://www.site.com/index.php/myscript/key/322f92b70aa3c7b5fe781426b2b6ebb5/
[core:error] [pid 20985] [client1x.x.x.x:53302] End of script output before headers: index.php, referer: https://www.site.com/index.php/myscript
I’ve reset all permissions, chown to the entire directory structures.
My httpd.conf
<VirtualHost :443>
ServerName mysite.com
ServerAlias www.mysite.com
ServerAlias webmail.mysite.com
ServerAlias admin.mysite.com
DocumentRoot /home/mysite/public_html
ErrorLog /var/log/virtualmin/mysite.com_error_log
CustomLog /var/log/virtualmin/mysite.com_access_log combined
ScriptAlias /cgi-bin/ /home/mysite/cgi-bin/
ScriptAlias /awstats/ /home/mysite/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/mysite/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/mysite/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/mysite/fcgi-bin/php5.fcgi .php5
<Directory /home/mysite/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,MultiViews,SymLinksIfOwnerMatch
Require all granted
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.mysite.com
RewriteRule ^(.) https://mysite.com:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.mysite.com
RewriteRule ^(.) https://mysite.com:10000/ [R]
Alias /dav /home/mysite/public_html
Alias /pipermail /var/lib/mailman/archives/public
<Location /dav>
DAV on
AuthType Basic
AuthName “mysite.com”
AuthUserFile /home/mysite/etc/dav.digest.passwd
Require valid-user
ForceType text/plain
Satisfy All
RemoveHandler .php
RemoveHandler .php5
RewriteEngine off
AuthName “mysite.com statistics”
AuthType Basic
AuthUserFile /home/mysite/.awstats-htpasswd
require valid-user
RedirectMatch /cgi-bin/mailman/([^/.])(.cgi)?(.) https://mysite.com:10000/virtualmin-mailman/unauthenticated/$1.cgi$3
RedirectMatch /mailman/([^/.])(.cgi)?(.*) https://mysite.com:10000/virtualmin-mailman/unauthenticated/$1.cgi$3
FcgidBusyTimeout 3600
other Fcgid directives…
SSLEngine on SSLCertificateFile /home/mysite/ssl.cert SSLCertificateKeyFile /home/mysite/ssl.key SSLCACertificateFile /home/mysite/ssl.ca Options -Indexes RemoveHandler .php RemoveHandler .php5 php_admin_value engine Off IPCCommTimeout 9999 FcgidMaxRequestLen 1073741824 SuexecUserGroup "#502" "#502"I’ve tried adding:
FcgidBusyTimeout 14400 FcgidIOTimeout 9999 FcgidConnectTimeout 14400 FcgidProcessLifeTime 0 # other Fcgid directives...But that doesn’t do anything.
My /etc/httpd/conf.d/fcgid.conf
Use FastCGI to process .fcg .fcgi & .fpl scripts
AddHandler fcgid-script fcg fcgi fpl
Sane place to put sockets and shared memory file
FcgidIPCDir /run/mod_fcgid
FcgidProcessTableFile /run/mod_fcgid/fcgid_shm
FcgidBusyTimeout 3600
FcgidIOTimeout 3600
FcgidConnectTimeout 3600
FcgidIdleTimeout 3600
FcgidMaxRequestsPerProcess 5000
php.ini also has timeouts set extremely high, if you need to see that and my.cnf let me know.
What could be wrong here? Is there something obvious I’m missing?