Code: Alles auswählen
php5-cgi -i | grep FastCGI
<tr><td class="e">Server API </td><td class="v">CGI/FastCGI </td></tr>
Code: Alles auswählen
php5-cgi -i | grep FastCGI
<tr><td class="e">Server API </td><td class="v">CGI/FastCGI </td></tr>
mundaun hat geschrieben: wobei das leider mit Debian Etch nicht mehr möglich sein wird, da libapache2-mod-fcgid rausgeflogen ist, und da es für PHP ebenfalls kein FCGI-Binary geben wird. Das heisst, man muss weiterhin den Umweg über inoffizielle Pakete bzw. selber Kompilieren machen. Schade...
Code: Alles auswählen
cd ~
mkdir fcgid
cd fcgid
echo "deb-src http://ftp.de.debian.org/debian/ unstable main" >> /etc/apt/sources.list
echo "APT::Default-Release "testing";" >> /etc/apt/apt.conf.d/70debconf
apt-get update
apt-get -t unstable source libapache2-mod-fcgid
cd libapache2-mod-fcgid-2.0
dpkg-checkbuilddeps
dpkg-buildpackage
cd ..
dpkg -i libapache2-mod-fcgid_2.0-1_i386.deb
Code: Alles auswählen
NameVirtualHost *
<VirtualHost *>
SuExecUserGroup wwwbenutzer wwwbenutzer
ServerName waleb.net
ServerAlias www.waleb.net
DocumentRoot /var/www/waleb.net/
<Directory /var/www/waleb.net>
FCGIWrapper /var/www/conf/php-fcgi-waleb.net .php
Options FollowSymLinks MultiViews +ExecCGI
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature Off
</VirtualHost>
Code: Alles auswählen
#!/bin/sh
PHPRC="/etc/php5/cgi"
export PHPRC
PHP_FCGI_CHILDREN=3
export PHP_FCGI_CHILDREN
exec /usr/bin/php5-cgi
Code: Alles auswählen
DocumentRoot /var/www/waleb.net/
<Directory /var/www/waleb.net>
...
FCGIWrapper /var/www/conf/php-fcgi-waleb.net .php
Code: Alles auswählen
/var/www/conf/waleb.net
Code: Alles auswählen
PHPRC="/etc/php5/cgi"
Code: Alles auswählen
PHPRC="/etc/php5/cgi/php.ini"
Code: Alles auswählen
DocumentRoot ....
AddHandler fcgid-script .php
Code: Alles auswählen
mismatch with directory
Code: Alles auswählen
waleb:/var/www# ls -l -R
.:
total 16
drwxr-xr-x 2 wwwbenutzer wwwbenutzer 4096 2007-02-24 14:32 conf
-rw-r--r-- 1 root root 21 2007-02-24 13:40 index.php
-rw-r--r-- 1 wwwbenutzer wwwbenutzer 122 2007-02-24 15:12 php-fcgi-waleb.net
drwxr-xr-x 2 waleb waleb 4096 2007-02-24 15:41 waleb.net
./conf:
total 8
-rw-r--r-- 1 wwwbenutzer wwwbenutzer 114 2007-02-24 13:12 php-fcgi-htdocs
-rw-r--r-- 1 wwwbenutzer wwwbenutzer 114 2007-02-24 13:14 php-fcgi-waleb.net
./waleb.net:
total 16
-rw-r--r-- 1 waleb waleb 669 2007-02-24 15:41 favicon.ico
-rw-r--r-- 1 waleb waleb 4 2007-02-24 13:38 index.html
-rw-r--r-- 1 waleb waleb 26 2007-02-24 13:54 index.php
-rw-r--r-- 1 waleb waleb 21 2007-02-24 13:55 w.php
Code: Alles auswählen
[Sat Feb 24 16:11:09 2007] [notice] mod_fcgid: call /var/www/waleb.net/w.php with wrapper /var/www/php-fcgi-waleb.net
suexec policy violation: see suexec log for more details
[Sat Feb 24 16:11:09 2007] [notice] mod_fcgid: server /var/www/waleb.net/w.php(6692) started
[Sat Feb 24 16:11:10 2007] [notice] mod_fcgid: call /var/www/waleb.net/w.php with wrapper /var/www/php-fcgi-waleb.net
suexec policy violation: see suexec log for more details
[Sat Feb 24 16:11:10 2007] [notice] mod_fcgid: server /var/www/waleb.net/w.php(6693) started
[Sat Feb 24 16:11:11 2007] [notice] mod_fcgid: call /var/www/waleb.net/w.php with wrapper /var/www/php-fcgi-waleb.net
suexec policy violation: see suexec log for more details
[Sat Feb 24 16:11:11 2007] [notice] mod_fcgid: server /var/www/waleb.net/w.php(6694) started
[Sat Feb 24 16:11:12 2007] [notice] mod_fcgid: call /var/www/waleb.net/w.php with wrapper /var/www/php-fcgi-waleb.net
suexec policy violation: see suexec log for more details
[Sat Feb 24 16:11:12 2007] [notice] mod_fcgid: server /var/www/waleb.net/w.php(6695) started
[Sat Feb 24 16:11:13 2007] [notice] mod_fcgid: call /var/www/waleb.net/w.php with wrapper /var/www/php-fcgi-waleb.net
suexec policy violation: see suexec log for more details
[Sat Feb 24 16:11:13 2007] [notice] mod_fcgid: server /var/www/waleb.net/w.php(6696) started
[Sat Feb 24 16:11:13 2007] [notice] mod_fcgid: process /var/www/waleb.net/w.php(6695) exit(server exited), terminated by calling exit(), return code: 120
[Sat Feb 24 16:11:13 2007] [notice] mod_fcgid: process /var/www/waleb.net/w.php(6694) exit(server exited), terminated by calling exit(), return code: 120
[Sat Feb 24 16:11:13 2007] [notice] mod_fcgid: process /var/www/waleb.net/w.php(6693) exit(server exited), terminated by calling exit(), return code: 120
[Sat Feb 24 16:11:13 2007] [notice] mod_fcgid: process /var/www/waleb.net/w.php(6692) exit(server exited), terminated by calling exit(), return code: 120
[Sat Feb 24 16:11:14 2007] [notice] mod_fcgid: call /var/www/waleb.net/w.php with wrapper /var/www/php-fcgi-waleb.net
suexec policy violation: see suexec log for more details
[Sat Feb 24 16:11:14 2007] [notice] mod_fcgid: server /var/www/waleb.net/w.php(6697) started
[Sat Feb 24 16:11:15 2007] [notice] mod_fcgid: call /var/www/waleb.net/w.php with wrapper /var/www/php-fcgi-waleb.net
suexec policy violation: see suexec log for more details
[Sat Feb 24 16:11:15 2007] [notice] mod_fcgid: server /var/www/waleb.net/w.php(6698) started
[Sat Feb 24 16:11:16 2007] [notice] mod_fcgid: call /var/www/waleb.net/w.php with wrapper /var/www/php-fcgi-waleb.net
suexec policy violation: see suexec log for more details
[Sat Feb 24 16:11:16 2007] [notice] mod_fcgid: server /var/www/waleb.net/w.php(6699) started
[Sat Feb 24 16:11:17 2007] [notice] mod_fcgid: call /var/www/waleb.net/w.php with wrapper /var/www/php-fcgi-waleb.net
suexec policy violation: see suexec log for more details
[Sat Feb 24 16:11:17 2007] [notice] mod_fcgid: server /var/www/waleb.net/w.php(6700) started
[Sat Feb 24 16:11:17 2007] [notice] mod_fcgid: process /var/www/waleb.net/w.php(6699) exit(server exited), terminated by calling exit(), return code: 120
[Sat Feb 24 16:11:17 2007] [notice] mod_fcgid: process /var/www/waleb.net/w.php(6698) exit(server exited), terminated by calling exit(), return code: 120
[Sat Feb 24 16:11:17 2007] [notice] mod_fcgid: process /var/www/waleb.net/w.php(6697) exit(server exited), terminated by calling exit(), return code: 120
[Sat Feb 24 16:11:17 2007] [notice] mod_fcgid: process /var/www/waleb.net/w.php(6696) exit(server exited), terminated by calling exit(), return code: 120
[Sat Feb 24 16:11:21 2007] [notice] mod_fcgid: process /var/www/waleb.net/w.php(6700) exit(server exited), terminated by calling exit(), return code: 120
Code: Alles auswählen
[2007-02-24 16:11:52]: uid: (1001/wwwbenutzer) gid: (1001/1001) cmd: php-fcgi-waleb.net
[2007-02-24 16:11:52]: target uid/gid (1001/1001) mismatch with directory (0/0) or program (1001/1001)
Code: Alles auswählen
chown -R wwwbenutzer:wwwbenutzer /var/www
Code: Alles auswählen
chattr -V +i php-fcgi-waleb.net
Code: Alles auswählen
waleb:/var/www# ls -l -R
.:
total 8
drwx--x--x 3 waleb waleb 4096 2007-02-25 17:00 waleb.net
drwx--x--x 3 wwwroot wwwroot 4096 2007-02-24 17:31 wwwroot
./waleb.net:
total 8
drwx--x--x 2 waleb waleb 4096 2007-02-25 17:04 docroot
-r-x------ 1 waleb waleb 122 2007-02-24 16:39 php-fcgi-waleb.net
./waleb.net/docroot:
total 4
-rwx------ 1 waleb waleb 20 2007-02-24 17:34 index.php
./wwwroot:
total 8
drwx--x--x 2 wwwroot wwwroot 4096 2007-02-24 18:17 docroot
-r-x------ 1 wwwroot wwwroot 121 2007-02-24 17:30 php-fcgi-wwwroot
./wwwroot/docroot:
total 4
-rwx--x--x 1 wwwroot wwwroot 20 2007-02-24 17:40 index.php
lrwxrwxrwx 1 root root 21 2007-02-24 18:17 phpmyadmin -> /usr/share/phpmyadmin
Wenn ich 711 oder 701 setze geht es. Kann mir jemand erklären warum?Forbidden
You don't have permission to access / on this server.
Code: Alles auswählen
[Wed Feb 28 20:04:57 2007] [notice] mod_fcgid: server /var/www/default/web/test.php(31900) started
[Wed Feb 28 20:04:57 2007] [notice] mod_fcgid: server /var/www/default/web/test.php(31901) started
[Wed Feb 28 20:04:57 2007] [notice] mod_fcgid: server /var/www/default/web/test.php(31902) started
[Wed Feb 28 20:04:57 2007] [notice] mod_fcgid: server /var/www/default/web/test.php(31903) started
[Wed Feb 28 20:04:57 2007] [notice] mod_fcgid: server /var/www/default/web/test.php(31904) started
[Wed Feb 28 20:04:57 2007] [notice] mod_fcgid: server /var/www/default/web/test.php(31905) started
[Wed Feb 28 20:04:57 2007] [notice] mod_fcgid: server /var/www/default/web/test.php(31906) started
[Wed Feb 28 20:04:57 2007] [notice] mod_fcgid: server /var/www/default/web/test.php(31907) started
[Wed Feb 28 20:04:57 2007] [notice] mod_fcgid: server /var/www/default/web/test.php(31908) started
[Wed Feb 28 20:04:57 2007] [notice] mod_fcgid: server /var/www/default/web/test.php(31909) started
[Wed Feb 28 20:04:57 2007] [notice] mod_fcgid: server /var/www/default/web/test.php(31910) started
[Wed Feb 28 20:05:03 2007] [notice] mod_fcgid: process /var/www/default/web/test.php(31910) exit(server exited), terminated by calling exit(), return code: 255
[Wed Feb 28 20:05:03 2007] [notice] mod_fcgid: process /var/www/default/web/test.php(31909) exit(server exited), terminated by calling exit(), return code: 255
[Wed Feb 28 20:05:03 2007] [notice] mod_fcgid: process /var/www/default/web/test.php(31908) exit(server exited), terminated by calling exit(), return code: 255
[Wed Feb 28 20:05:03 2007] [notice] mod_fcgid: process /var/www/default/web/test.php(31907) exit(server exited), terminated by calling exit(), return code: 255
[Wed Feb 28 20:05:03 2007] [notice] mod_fcgid: process /var/www/default/web/test.php(31906) exit(server exited), terminated by calling exit(), return code: 255
[Wed Feb 28 20:05:03 2007] [notice] mod_fcgid: process /var/www/default/web/test.php(31905) exit(server exited), terminated by calling exit(), return code: 255
[Wed Feb 28 20:05:03 2007] [notice] mod_fcgid: process /var/www/default/web/test.php(31904) exit(server exited), terminated by calling exit(), return code: 255
[Wed Feb 28 20:05:03 2007] [notice] mod_fcgid: process /var/www/default/web/test.php(31903) exit(server exited), terminated by calling exit(), return code: 255
[Wed Feb 28 20:05:03 2007] [notice] mod_fcgid: process /var/www/default/web/test.php(31902) exit(server exited), terminated by calling exit(), return code: 255
[Wed Feb 28 20:05:03 2007] [notice] mod_fcgid: process /var/www/default/web/test.php(31901) exit(server exited), terminated by calling exit(), return code: 255
[Wed Feb 28 20:05:03 2007] [notice] mod_fcgid: process /var/www/default/web/test.php(31900) exit(server exited), terminated by calling exit(), return code: 255
Code: Alles auswählen
#!/bin/sh
PHPRC="/var/www/default/conf/"
export PHPRC
PHP_FCGI_CHILDREN=4
export PHP_FCGI_CHILDREN
exec /usr/bin/php5-cgi
Code: Alles auswählen
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
AddHandler fcgid-script .php
# SocketPath /var/lib/apache2/fcgid/sock
SocketPath /var/run/apache2/
</IfModule>
Code: Alles auswählen
PHPRC="/var/www/default/conf/"
Code: Alles auswählen
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
AddHandler fcgid-script .php
# SocketPath /var/lib/apache2/fcgid/sock
SocketPath /var/run/apache2/
</IfModule>
Code: Alles auswählen
/var/www/default/web/test.php
/var/www/default/conf/php-fcgi-starter
Code: Alles auswählen
[debug] arch/unix/fcgid_proc_unix.c(487): (111)Connection refused: mod_fcgid: can't connect unix domain socket: /var/lib/apache2/fcgid/sock/761.0
Code: Alles auswählen
[info] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
Code: Alles auswählen
SocketPath /var/lib/apache2/fcgid/sock
Code: Alles auswählen
[notice] Apache/2.0.54 (Debian GNU/Linux) configured -- resuming normal operations
[notice] mod_fcgid: server /var/www/default/web/test.php(1178) started
[info] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[error] [client xxx.xxx.xxx.xxx] Premature end of script headers: test.php
[notice] mod_fcgid: process /var/www/default/web/test.php(1178) exit(communication error), terminated by calling exit(), return code: 255
Code: Alles auswählen
[Wed Feb 28 21:27:59 2007] [debug] arch/unix/fcgid_proc_unix.c(487): (111)Connection refused: mod_fcgid: can't connect unix domain socket: /var/lib/apache2/fcgid/sock/1287.24
[Wed Feb 28 21:27:59 2007] [info] mod_fcgid: can't apply process slot for /var/www/default/web/test.php
Code: Alles auswählen
AddHandler fcgid-script .php