I had a issue where some directories would be www-data I have just learned to switch the site to CGI-Wrapper or FCGId to run scripts as users and not www-data.
Now I have the issue of cgi throwing up a error message when I try to run php pages.
Forbidden
You don’t have permission to access /cgi-bin/php5.cgi/index.php on this server.
The logged error is: (error edited for privacy)
[Thu Jun 19 02:34:54.345268 2014] [authz_core:error] [pid 3970] [client 110.175.205.XXX:59112] AH01630: client denied by server configuration: /home/webmaster/domains/wordpress.server.revnet/cgi-bin/php5.cgi
Contents of that file auto made by virtualmin is:
#!/bin/bash
PHPRC=$DOCUMENT_ROOT/../etc/php5
export PHPRC
umask 022
if [ "$REDIRECT_URL" != "" ]; then
SCRIPT_NAME=$REDIRECT_URL
export SCRIPT_NAME
fi
exec /usr/bin/php5
Here is the sites-available code for that site.
<VirtualHost *:80>
SuexecUserGroup "#1005" "#1005"
ServerName wordpress.server.revnet
ServerAlias www.wordpress.server.revnet
DocumentRoot /home/webmaster/domains/wordpress.server.revnet/public_html
ErrorLog /var/log/virtualmin/wordpress.server.revnet_error_log
CustomLog /var/log/virtualmin/wordpress.server.revnet_access_log combined
ScriptAlias /cgi-bin/ /home/webmaster/domains/wordpress.server.revnet/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/webmaster/domains/wordpress.server.revnet/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
Action application/x-httpd-php5 /cgi-bin/php5.cgi
AddType application/x-httpd-php5 .php5
AddType application/x-httpd-php5 .php
</Directory>
<Directory /home/webmaster/domains/wordpress.server.revnet/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
</Directory>
RemoveHandler .php
RemoveHandler .php5
php_admin_value engine Off
</VirtualHost>
Any advice?
Update: I seem to have one part of the problem fixed I installed FCGId manually using apt-get and its loading php pages I’m going to test uploads etc.
Here is that config.
#!/bin/bash
PHPRC=$PWD/../etc/php5
export PHPRC
umask 022
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=99999
export PHP_FCGI_MAX_REQUESTS
SCRIPT_FILENAME=$PATH_TRANSLATED
export SCRIPT_FILENAME
exec /usr/bin/php5-cgi
But cgi-wrapper isn’t working and still coming up with the same error, so help me fix that part please.
I switched to cgi wrapper and maximum script time is automatically set to 0 value with php5-cgi installed.
php5.cgi has also slightly changed now I installed php-cgi to:
#!/bin/bash
PHPRC=$DOCUMENT_ROOT/../etc/php5
export PHPRC
umask 022
if [ "$REDIRECT_URL" != "" ]; then
SCRIPT_NAME=$REDIRECT_URL
export SCRIPT_NAME
fi
SCRIPT_FILENAME=$PATH_TRANSLATED
export SCRIPT_FILENAME
exec /usr/bin/php5-cgi