Re: Debian Sarge, Apache2, Suexec2, mod_fastcgi, php5-fcgi HowTo
Posted: 2005-12-05 14:13
abwarten... der kommt schon wieder...
Gruß,
Alex
Gruß,
Alex
Resources for System-Administrators
https://www.rootforum.org/forum/
Code: Select all
[Fri Dec 09 09:40:38 2005] [notice] caught SIGTERM, shutting down
[Fri Dec 09 09:40:38 2005] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Fri Dec 09 09:40:38 2005] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec2)
[Fri Dec 09 09:40:38 2005] [notice] FastCGI: process manager initialized (pid 25657)
[Fri Dec 09 09:40:39 2005] [notice] Apache/2.0.54 (Debian GNU/Linux) mod_fastcgi/2.4.2
mod_ssl/2.0.54 OpenSSL/0.9.7e configured -- resuming normal operations~
Code: Select all
84.161.30.151 - - [09/Dec/2005:09:42:15 +0100] "GET /php.php HTTP/1.1" 304 -
"-" "Mozilla/4.0 (compatible; MSIE 6.0; X11; Linux i686; en) Opera 8.51"
Code: Select all
# httpd Data BEGIN.
#
# Web traffic accounting.
#
LogFormat "%B" traff
#
# GUI Location.
#
Alias /vhcs2 /var/www/vhcs2/gui
<Directory /var/www/vhcs2/gui>
AllowOverride none
Options MultiViews IncludesNoExec FollowSymLinks
ErrorDocument 404 /vhcs2/errordocs/index.php
DirectoryIndex index.html index.php
</Directory>
<Directory /var/www/vhcs2/gui/tools/filemanager>
# php_flag register_globals On
# php_admin_value open_basedir "/var/www/vhcs2/gui/tools/filemanager/:/tmp/:/usr/share/php/"
</Directory>
Alias /vhcs_images /var/www/vhcs2/gui/images
<Directory /var/www/vhcs2/gui/images>
AllowOverride none
Options MultiViews IncludesNoExec FollowSymLinks
</Directory>
#
# Default GUI.
#
<VirtualHost _default_:*>
DocumentRoot /var/www/vhcs2/gui
<Directory /var/www/vhcs2/gui>
Options Indexes Includes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
# httpd [217.160.128.121] virtual host entry BEGIN.
NameVirtualHost 217.160.128.121
# httpd [uneven.de] dmn group entry BEGIN.
# httpd [{SUB_NAME}] sub entry BEGIN.
# httpd [{SUB_NAME}] sub entry END.
# httpd [uneven.de] dmn entry BEGIN.
<VirtualHost uneven.de>
#
#User vu2001
#Group vu2001
#
ServerSignature On
#
SuexecUserGroup vu2001 vu2001
#
ServerAdmin root@uneven.de
DocumentRoot /var/www/virtual/uneven.de/htdocs
ServerName uneven.de
ServerAlias www.uneven.de uneven.de
ErrorLog /var/log/apache2/users/uneven.de-error.log
TransferLog /var/log/apache2/users/uneven.de-access.log
CustomLog /var/log/apache2/uneven.de-traf.log traff
CustomLog /var/log/apache2/uneven.de-combined.log combined
Alias /errors /var/www/virtual/uneven.de/errors/
# httpd dmn entry cgi support BEGIN.
# httpd dmn entry cgi support END.
<Directory /var/www/vhcs2/gui>
# php_admin_value open_basedir "/var/www/vhcs2/gui/:/etc/vhcs2/:/proc/:/var/www/virtual/:/tmp/"
</Directory>
# httpd dmn entry PHP2 support BEGIN.
# php_admin_value open_basedir "/var/www/virtual/uneven.de/:/usr/share/php/:/tmp/"
# httpd dmn entry PHP2 support END.
<IfModule !mod_fastcgi.c>
FastCgiWrapper /usr/lib/apache2/suexec2
FastCgiServer /var/www/php-fcgi-scripts/uneven.de/php-fcgi-starter -user vu2001 -group vu2001
AddHandler php-fastcgi .php
<Location /cgi-bin/php-fcgi-starter>
SetHandler fastcgi-script
Options +ExecCGI
</Location>
Action php-fastcgi /cgi-bin/php-fcgi-starter
AddType application/x-httpd-php .php
</IfModule>
<Directory /var/www/virtual/uneven.de/htdocs>
# httpd dmn entry PHP support BEGIN.
# httpd dmn entry PHP support END.
Options Indexes Includes FollowSymLinks MultiViews
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ /var/www/php-fcgi-scripts/uneven.de/
<Directory "/var/www/php-fcgi-scripts/uneven.de">
AllowOverride None
Options +ExecCGI -MultiViews -Indexes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
# httpd [uneven.de] dmn entry END.
# httpd [uneven.de] dmn group entry END.
# httpd [{DMN_GRP}] dmn group entry BEGIN.
# httpd [{DMN_GRP}] dmn group entry END.
# httpd [{ALS_NAME}] als entry BEGIN.
# httpd [{ALS_NAME}] als entry END.
# httpd [217.160.128.121] virtual host entry END.
# httpd [{IP}] virtual host entry BEGIN.
# httpd [{IP}] virtual host entry END.
# httpd Data END.
Code: Select all
/var/www/virtual
Code: Select all
...
#<Directory /var/www/vhcs2/gui>
# php_admin_value open_basedir "/var/www/vhcs2/gui/:/etc/vhcs2/:/proc/:/var/www/virtual/:/tmp/"
#</Directory>
# httpd dmn entry PHP2 support BEGIN.
# php_admin_value open_basedir "/var/www/virtual/uneven.de/:/usr/share/php/:/tmp/"
# httpd dmn entry PHP2 support END.
# httpd dmn entry fastCGI support BEGIN.
ScriptAlias /fcgi-bin/ /var/www/php-fcgi-scripts/new-crusader.de/
<Directory /var/www/php-fcgi-scripts/new-crusader.de>
AllowOverride None
Options +ExecCGI -MultiViews -Indexes
Order allow,deny
Allow from all
</Directory>
# httpd dmn entry fastCGI support END.
...
Code: Select all
/home/www/nightsite/
drwxr-xr-x 3 nightsite ftponly 4096 2006-01-18 13:48 cgi-bin
drwxr-xr-x 2 root root 4096 2006-01-18 10:55 conf
drwxrwxrwx 2 nightsite ftponly 4096 2006-01-18 13:01 html
drwxr-xr-x 2 nightsite ftponly 4096 2006-01-18 13:13 logs
Code: Select all
FastCgiWrapper /usr/sbin/suexec2
FastCgiServer /home/www/nightsite/cgi-bin/php-fcgi-starter -user nightsite -group ftponly
AddHandler php-fastcgi .php
<Location /cgi-bin/php-fcgi-starter>
SetHandler fastcgi-script
Options +ExecCGI
</Location>
Action php-fastcgi /cgi-bin/php-fcgi-starter
AddType application/x-httpd-php .php
Code: Select all
-rwxr-xr-x 1 nightsite ftponly 79 2006-01-18 13:15 php-fcgi-starter
#!/bin/sh
PHPRC="/home/www/nightsite/conf"
export PHPRC
exec /usr/bin/php-fcgi
cgi-bin sollte doch besser ausserhalb der DocRoot liegen - oder?/home/www/nightsite/cgi-bin/php-fcgi-starter
Code: Select all
<VirtualHost *:80>
ServerAdmin webmaster@standbye.com
ServerName night-site.net
ServerAlias www.night-site.net
DocumentRoot /home/www/nightsite/html
DirectoryIndex index.php index.html index.htm
SuexecUserGroup nightsite ftponly
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/www/nightsite/>
Options FollowSymLinks
AllowOverride AuthConfig
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /home/www/nightsite/cgi-bin/
<Directory "/home/www/nightsite/cgi-bin/">
AllowOverride None
Options +ExecCGI -MultiViews -Indexes
Order allow,deny
Allow from all
</Directory>
ErrorLog /home/www/nightsite/logs/error.log
ServerSignature ON
LogLevel debug
CustomLog /home/www/nightsite/logs/access.log combined
Alias /icons/ "/usr/share/apach2/icons/"
<Directory "/usr/share/apache2/icons/">
Options Indexes Multiviews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
so: <Directory "/home/www/nightsite/cgi-bin"><Directory "/home/www/nightsite/cgi-bin/">
so:<Directory /home/www/nightsite/>
Der php-fcgi-starter darf nicht in dein Standard Web-Verzeichnis, sondern muss genau dahin, wo er im Howto vorgesehen ist.
Code: Select all
/var/www/default/index.php
/var/www/php4-fcgi/php.ini
/var/www/php4-fcgi/php-fcgi-starter
Code: Select all
FastCgiWrapper /usr/lib/apache2/suexec2
FastCgiServer /var/www/php4-fcgi/php-fcgi-starter -user default -group default
AddHandler php-fastcgi .php
<Location /cgi-bin/php-fcgi-starter>
SetHandler fastcgi-script
Options +ExecCGI
</Location>
Action php-fastcgi /cgi-bin/php-fcgi-starter
AddType application/x-httpd-php .php
Code: Select all
#!/bin/sh
PHPRC="/var/www/php4-fcgi"
export PHPRC
exec /usr/bin/php-fcgi
Code: Select all
<VirtualHost *:80>
ServerAdmin webmaster@domain.de
ServerName domain.de
ServerAlias www.domain.de
DocumentRoot /var/www/default/
DirectoryIndex index.php index.html index.htm
SuexecUserGroup default default
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/default>
Options FollowSymLinks
AllowOverride AuthConfig
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /var/www/php4-fcgi/
<Directory "/var/www/php4-fcgi/">
AllowOverride None
Options +ExecCGI -MultiViews -Indexes
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 On
</VirtualHost>
Code: Select all
[Sun Jan 22 19:07:02 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec2)
[Sun Jan 22 19:07:02 2006] [notice] FastCGI: wrapper mechanism enabled (wrapper: /usr/lib/apache2/suexec2)
[Sun Jan 22 19:07:02 2006] [notice] FastCGI: process manager initialized (pid 3825)
[Sun Jan 22 19:07:02 2006] [warn] FastCGI: server "/var/www/php4-fcgi/php-fcgi-starter" (uid 1006, gid 1006) started (pid 3826)
[Sun Jan 22 19:07:02 2006] [warn] FastCGI: server "/var/www/php4-fcgi/php-fcgi-starter" (pid 3826) terminated by calling exit with status '120'
[Sun Jan 22 19:07:02 2006] [notice] Apache/2.0.54 (Debian GNU/Linux) mod_fastcgi/2.4.2 mod_ssl/2.0.54 OpenSSL/0.9.7e configured -- resuming normal operations
[Sun Jan 22 19:07:07 2006] [warn] FastCGI: server "/var/www/php4-fcgi/php-fcgi-starter" (uid 1006, gid 1006) restarted (pid 3883)
[Sun Jan 22 19:07:07 2006] [warn] FastCGI: server "/var/www/php4-fcgi/php-fcgi-starter" (pid 3883) terminated by calling exit with status '120'
[Sun Jan 22 19:07:12 2006] [warn] FastCGI: server "/var/www/php4-fcgi/php-fcgi-starter" (uid 1006, gid 1006) restarted (pid 3884)
[Sun Jan 22 19:07:12 2006] [warn] FastCGI: server "/var/www/php4-fcgi/php-fcgi-starter" (pid 3884) terminated by calling exit with status '120'
[Sun Jan 22 19:07:17 2006] [warn] FastCGI: server "/var/www/php4-fcgi/php-fcgi-starter" (uid 1006, gid 1006) restarted (pid 3885)
[Sun Jan 22 19:07:17 2006] [warn] FastCGI: server "/var/www/php4-fcgi/php-fcgi-starter" (pid 3885) terminated by calling exit with status '120'
[Sun Jan 22 19:07:17 2006] [warn] FastCGI: server "/var/www/php4-fcgi/php-fcgi-starter" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds
[Sun Jan 22 19:09:49 2006] [error] [client 212.23.126.13] FastCGI: comm with server "/var/www/php4-fcgi/php-fcgi-starter" aborted: idle timeout (30 sec)
[Sun Jan 22 19:09:49 2006] [error] [client 212.23.126.13] FastCGI: incomplete headers (0 bytes) received from server "/var/www/php4-fcgi/php-fcgi-starter"
Code: Select all
[2006-01-22 19:27:17]: uid: (default/default) gid: (default/default) cmd: php-fcgi-starter
[2006-01-22 19:27:17]: target uid/gid (1006/1006) mismatch with directory (0/0) or program (0/0)