ich habe folgendes Problem. Die STDERR Meldungen von meinen CGI Skripten werden nicht in das ErrorLog das in VirtualHost definiert wurde geschrieben sondern in das ErrorLog (/var/log/apache2/error.log) von meiner apache2.conf.
Hier mein Testscriopt:
- Code: Select all
#!/usr/bin/perl -w
use CGI;
my $cgi = CGI->new();
print $cgi->header();
print "Hallo Welt\n";
print STDERR "Hallo Welt\n";
sleep 100
Hier die VirtualHost Anweisung:
- Code: Select all
<VirtualHost 62.75.139.XXX:80>
ServerName domain.net
Redirect 301 / http://www.domain.net/
</VirtualHost>
<VirtualHost 62.75.139.XXX:80>
ServerAdmin hallo@domain.net
DocumentRoot /var/www/domain.net/www
ServerName www.domain.net
<Directory "/var/www/domain.net/www">
SetEnv PERL5LIB /usr/local/opt/perlmod
AllowOverride All
Options Indexes FollowSymLinks MultiViews ExecCGI Includes
AddHandler cgi-script .cgi .pl .htm
</Directory>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %v" full
ErrorLog /var/log/apache2/domain.net/www/error_log
CustomLog /var/log/apache2/domain.net/www/access_log full
</VirtualHost>
<VirtualHost 62.75.139.XXX:80>
ServerAdmin hallo@domain.net
DocumentRoot /var/www/domain.net/devel
ServerName devel.domain.net
<Directory "/var/www/domain.net/devel">
SetEnv PERL5LIB /home/setup/www/perlmod/
Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride All
Options FollowSymLinks ExecCGI +Includes
AddHandler cgi-script .cgi .pl .htm .seo
</Directory>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %v" full
ErrorLog /var/log/apache2/domain.net/devel/error_log
CustomLog /var/log/apache2/domain.net/devel/access_log full
</VirtualHost>
Ich habe mir auch mal die file descriptoren der einzelnen Prozesse angeschaut.
- Code: Select all
#ps fax
12166 ? Ss 0:00 /usr/sbin/apache2 -k start
12167 ? S 0:00 \_ /usr/sbin/apache2 -k start
13780 ? S 0:00 | \_ /usr/bin/perl -w /var/www/domain.net/devel/test.cgi
#ls -l /proc/12167/fd/
insgesamt 12
lr-x------ 1 root root 64 2010-01-25 12:09 0 -> /dev/null
l-wx------ 1 root root 64 2010-01-25 12:09 1 -> /dev/null
l-wx------ 1 root root 64 2010-01-25 12:09 10 -> /var/log/apache2/domain.net/www/access_log
l-wx------ 1 root root 64 2010-01-25 12:09 11 -> /var/log/apache2/access.log
l-wx------ 1 root root 64 2010-01-25 12:09 2 -> /var/log/apache2/error.log
lrwx------ 1 root root 64 2010-01-25 12:09 3 -> socket:[2042919432]
lr-x------ 1 root root 64 2010-01-25 12:09 4 -> pipe:[2042919427]
l-wx------ 1 root root 64 2010-01-25 12:09 5 -> pipe:[2042919427]
l-wx------ 1 root root 64 2010-01-25 12:09 6 -> /var/log/apache2/error.log
l-wx------ 1 root root 64 2010-01-25 12:09 7 -> /var/log/apache2/domain.net/devel/error_log
l-wx------ 1 root root 64 2010-01-25 12:09 8 -> /var/log/apache2/domain.net/www/error_log
l-wx------ 1 root root 64 2010-01-25 12:09 9 -> /var/log/apache2/domain.net/devel/access_log
#ls -l /proc/13780/fd/
insgesamt 4
lrwx------ 1 www-data www-data 64 2010-01-25 12:09 0 -> socket:[2042919435]
lrwx------ 1 www-data www-data 64 2010-01-25 12:09 1 -> socket:[2042919435]
l-wx------ 1 www-data www-data 64 2010-01-25 12:09 2 -> /var/log/apache2/error.log
lrwx------ 1 www-data www-data 64 2010-01-25 12:09 3 -> socket:[2042919432]
Warum ist im apache Elternprozess von test.cgi /var/log/apache2/domain.net/devel/error_log noch da und im test.cgi selber nicht mehr?
Kann mir da jemand helfen? Ich weiss nicht mehr weiter. Ich habe auch schon die Apacheconfig durchgelesen und auch keinen Fehler entdeckt. Auch laeuft die Config schon auf anderen Server ohne Probleme.