Error_Log Per Virtual Host

error_log per Virtual Host?

To set the Apache (not the PHP) log, the easiest way to do this would be to do:

<VirtualHost IP:Port>
# Stuff,
# More Stuff,
ErrorLog /path/where/you/want/the/error.log
</VirtualHost>

If there is no leading "/" it is assumed to be relative.

Apache Error Log Page

Errors for virtual host are not written to specified ErrorLog, but to default error_log

This is (was?) a longstanding bug in mod_cgid. Its status still is "RESOLVED LATER" which (apparently) means: "stop complaining - we'll do it in a later version, not now". Maybe it has been solved by now (your version, 2.2.22, is 3 years old), but I couldn't find any mention of it.

mod_cgid is the default .cgi handler in the threaded version of Apache. If you switch to mod_cgi, e.g. by using a non-threaded apache (like I do) that should solve your problem.

WAMP virtual host error log location not working?

Change your definition of the log files to include the full path.

You might also like to add a seperate log file for the PHP error log.

ErrorLog "C:/wamp/logs/localhost-error.log"
CustomLog "C:/wamp/logs/localhost-access.log" common
php_value error_log "C:/wamp/logs/localhost.php.error.log"

and

ErrorLog "C:/wamp/logs/site.local-error.log"
CustomLog "C:/wamp/logs/site.local-access.log" common
php_value error_log "C:/wamp/logs/site.php.error.log"

How do you set the PHP error log location in the Apache configuration file?

From error_log per Virtual Host?:

<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/domains/example.com/html
ErrorLog /var/www/domains/example.com/apache.error.log
CustomLog /var/www/domains/example.com/apache.access.log common
php_flag log_errors on
php_flag display_errors on
php_value error_reporting 2147483647
php_value error_log /var/www/domains/example.com/php.error.log
</VirtualHost>


Related Topics



Leave a reply



Submit