error_log per Virtual Host?

On one Linux Server running Apache and also PHP 5, we have numerous Virtual Hosts with different log documents. We can not appear to divide the php error_log in between digital hosts.

Bypassing this setup in the <Location> of the httpd.conf does not appear to do anything.

Exists a means to have different php error_logs for each and every Virtual Host?

2019-05-06 23:54:40
Source Share
Answers: 4

My Apache had something similar to this in httpd.conf. Simply transform the ErrorLog and also CustomLog setups

<VirtualHost myvhost:80>
    ServerAdmin [email protected]
    DocumentRoot /opt/web
    ServerName myvhost
    ErrorLog logs/myvhost-error_log
    CustomLog logs/myvhost-access_log common
2019-05-21 11:28:51

The default practices is for error_log ( ) to result to the Apache mistake log. If this isn't taking place examine your php.ini setups for the error_log instruction - leave it unset to make use of the Apache log apply for the existing vhost.

2019-05-07 17:49:48

To set the Apache ( not the PHP ) log, the most convenient means to do this would certainly be to do :

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

If there is no leading "/" it is thought to be loved one.

Apache Error Log Page

2019-05-07 17:18:24

I generally simply define this in an .htaccess documents or the vhost.conf on the domain name I'm working with. Add this to among these documents :

php_admin_value error_log "/var/www/vhosts/"
2019-05-07 16:56:59