Hello,
Here is what I have in my global server httpd.conf:
-----------------------------------------------------------------------
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path. If you point
# ServerRoot at a non-local disk, be sure to point the LockFile
directive
# at a local disk. If you wish to share the same ServerRoot for
multiple
# httpd daemons, you will need to change at least LockFile and PidFile.
#
ServerRoot "/usr/local/apache2"
...
#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog logs/error_log
...
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
-----------------------------------------------------------------------
Now in the extras/httpd-vhosts.conf I have:
-----------------------------------------------------------------------
<VirtualHost *:80>
ServerAdmin suppressed
DocumentRoot /var/www/myapp/htdocs
ServerName myapp.fmi.ch
# ServerAlias www.dummy-host.example.com
ErrorLog /var/www/myapp/logs/error_log
ScriptLog /var/www/myapp/logs/error_log
CustomLog /var/www/myapp/logs/access_log common
<Location />
Options -Indexes FollowSymLinks -ExecCGI
# AllowOverride None
Order Deny,Allow
Deny from All
Allow from 172.28. 172.29.
</Location>
Alias /web_perl/ /var/www/myapp/web_perl/
<Location /web_perl>
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options -Indexes FollowSymLinks +ExecCGI
</Location>
PerlPostConfigRequire /var/www/myapp/web_startup/startup.pl
PerlTransHandler +MyApp::Apache2::RewriteURI
</VirtualHost>
-----------------------------------------------------------------------
So in my scripts running under ModPerl::Registry if I do a
print STDERR "Some message";
to debug then it goes to the global error log at
/usr/local/apache2/logs/error_log not at the desired place
/var/www/myapp/logs/error_log.
Leandro
-----Original Message-----
From: Fred Moyer [mailto:suppressed
Sent: Friday, November 17, 2006 05:38
To: Hermida, Leandro
Cc: suppressed
Subject: Re: Error messages go to server ErrorLog not to VirtualHost
ErrorLog
Hermida, Leandro wrote:
> Hello,
>
> I have a problem related to this with CGI scripts which I am porting
> to mod_perl 2 and presently running under ModPerl::Registry. I have a
> VirtualHost were I have enabled mod_perl and ModPerl::Registry as the
> handler. I have set the ErrorLog directive in this VirtualHost to a
> different file than the global server ErrorLog. For debugging and
> testing of my code I typically do a
>
> print STDERR "Here is a message";
>
> inside of a script. The problem is that it always goes to the global
> server ErrorLog not to the VirtualHost ErrorLog. It didn't do this in
> mod_perl 1. Am I doing something wrong?
Can you post the relevant snippet from your httpd.conf?
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.