Hi all,
I am trying to setup apache w/ suexec to avoid permission problems w/ apache user and website user and also to be able to run a second (test) domain on the same server.
So far I got fcgi w/o suexec running perfectly (logs confirm that). But as soon as I enable the suexec statement in the vhost config I get 500's.
Suexec log shows this :
[2008-03-07 10:33:54]: uid: (1002/galac4) gid: (1004/1004) cmd: php5.fcgi
[2008-03-07 10:33:54]: cannot stat program: (php5.fcgi)
After examining the source of suexec I found that that error means, that suexec thinks that there is a symlink to the php5.fcgi, which is not. here the output of stat from console entry done with a copy of the fcgi entry in the vhost definition:
stat /var/www/galactics/fcgi-bin/php5.fcgi
File: `/var/www/galactics/fcgi-bin/php5.fcgi'
Size: 183 Blocks: 8 IO Block: 4096 regular file
Device: 801h/2049d Inode: 1655474 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 1002/ galac4) Gid: ( 1004/ galac4)
Access: 2008-03-06 21:00:35.000000000 -0500
Modify: 2008-03-07 10:32:04.000000000 -0500
Change: 2008-03-07 10:32:04.000000000 -0500
Here is the contens of the php5.fcgi :
#!/bin/sh
#PHPRC=$PWD/../etc
#export PHPRC
#umask 022
#PHP_FCGI_CHILDREN=1
#export PHP_FCGI_CHILDREN
#SCRIPT_FILENAME=$PATH_TRANSLATED
#export SCRIPT_FILENAME
exec /usr/bin/php5-cgi
Have already commented out everything unrelated, still no go (remember, if suexec is not used in the vhost declaration, everything works fine)
Here is the suexec output :
/usr/lib/apache2/suexec2 -V
-D AP_DOC_ROOT="/var/www"
-D AP_GID_MIN=100
-D AP_HTTPD_USER="www-data"
-D AP_LOG_EXEC="/var/log/apache2/suexec.log"
-D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
-D AP_UID_MIN=100
-D AP_USERDIR_SUFFIX="public_html"
Site is defined in /var/www/galactics/public_html, all permissions checked, all set to that user.
I already have read everything I could find on the net about suexec, the apache docs, analyzed the suexec code. No success.
here is the vhost config:
I have other servers running with this configuration, quite similar and no probs. It looks like suexec has trouble finding/analyzing that wrapper (php5.fcgi). I quadrupel checked the vhost setup, all correct. here it is (suexec commented out as that otherwise throws that 500 error.:
<VirtualHost *:80>
ServerAdmin
webmaster@galactics.org
ServerName
GALACTICS Clearwater International F.C. - Home
ServerAlias galactics.org
# SuexecUserGroup galac4 galac4
DocumentRoot /var/www/galactics/public_html
ErrorLog /var/www/galactics/logs/error_log
CustomLog /var/www/galactics/logs/access_log combined
ScriptAlias /cgi-bin/ /var/www/galactics/cgi-bin/
DirectoryIndex index.php index.html index.htm
<Directory /var/www/galactics/public_html>
Options Indexes IncludesNOEXEC FollowSymLinks ExecCGI
allow from all
AllowOverride All
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /var/www/galactics/fcgi-bin/php5.fcgi .php
FCGIWrapper /var/www/galactics/fcgi-bin/php5.fcgi .php5
</Directory>
RemoveHandler .php
RemoveHandler .php5
<Directory /var/www/galactics/cgi-bin>
allow from all
</Directory>
LogLevel debug
ServerSignature Off
</VirtualHost>
Anybody there with a hint what to do?
Harry