Answer the question
In order to leave comments, you need to log in
Internal Server error 500 when connecting mod_fcgid on Apache CentOS 7?
There is a server on VirtualBox on CentOS 7. A bunch of Nginx + Apache (where nginx is the frontend, and Apache is the backend).
Because with dynamics, apache works for me, I understand that I need to connect fastcgi to it.
It costs PHP 7. It's just that sites work in mod_php mode.
1. Connected mod_fcgid module (required LoadModule is in httpd.conf)
2. Contents in fcgid.conf:
# This is the Apache server configuration file for providing FastCGI support
# through mod_fcgid
#
# Documentation is available at
# http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
# 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
DirectoryIndex index.php
FcgidFixPathinfo 1
FcgidMaxRequestsPerProcess 10000
cgi.fix_pathinfo=1
#!/bin/sh
PHP_FCGI_MAX_REQUESTS=10000
export PHP_FCGI_MAX_REQUESTS
exec /usr/bin/php-cgi
<VirtualHost *:8080>
ServerName site2.ru
ServerAlias www.site2.ru
DocumentRoot /var/www/daniel/site2.ru/public_html
ErrorLog /var/log/httpd/site2_ru_error.log
CustomLog /var/log/httpd/site2_ru_requests.log combined
SuexecUserGroup daniel daniel
<IfModule mod_fcgid.c>
FcgidBusyTimeout 3600
</IfModule>
<Directory "/var/www/daniel/site2.ru/public_html">
Options +ExecCGI
AddHandler fcgid-script .php
FcgiWrapper /var/www/php-cgi/php.fcgi .php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
[Wed May 08 01:47:21.480618 2019] [fcgid:warn] [pid 32082] (104)Connection reset by peer: [client 127.0.0.1:52274] mod_fcgid: error reading data from FastCGI server
[Wed May 08 01:47:21.480722 2019] [core:error] [pid 32082] [client 127.0.0.1:52274] End of script output before headers: index.php
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question