开发者

Apache - Override default error_log with ErrorLog Directive in Vhost

开发者 https://www.devze.com 2023-03-17 01:36 出处:网络
I have several vhosts setup, and would like to have the error logs go to pre-determined locations. The setup we have works great, except when I comment out error_log in httpd.conf I keep seeing \"Star

I have several vhosts setup, and would like to have the error logs go to pre-determined locations. The setup we have works great, except when I comment out error_log in httpd.conf I keep seeing "Starting httpd: (2)No such file or 开发者_如何学JAVAdirectory: httpd: could not open error log file /etc/httpd/logs/error_log."

Is it possible to turn off the global error_log directive, and simply rely on the vhost ErrorLog? Or do you have to run both?


Edit 6.30.11

It appears the error_log in httpd.conf relates to the actual httpd daemon, and is not the same as a virtual host ErrorLog. For example, when I restart httpd I get messages like "[Thu Jun 30 17:18:56 2011] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations", and in my vhost ErrorLog I get messages such as "[Wed Jun 29 00:13:51 2011] [error] [client 173.255.252.120] File does not exist:"

So it seems you have to live with a setup like:

-rw-r--r-- 1 root webdev  329 Jun 30 17:18 global_error.log    
-rw-r--r-- 1 root webdev    0 Jun 30 17:18 example.com.access.log
-rw-r--r-- 1 root webdev    0 Jun 30 17:18 example.com.error.log
-rw-r--r-- 1 root webdev    0 Jun 30 17:18 example.com.rewrite.log


As mentioned in the edit, it does not appear that it is possible to disable the global_error log, which makes sense now, but didn't at the time.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号