{"id":8,"date":"2005-03-07T07:48:34","date_gmt":"2005-03-07T06:48:34","guid":{"rendered":"http:\/\/blog.blackdown.de\/2005\/03\/08\/php-error-logging-to-syslog-from-a-chroot\/"},"modified":"2016-10-29T03:51:03","modified_gmt":"2016-10-29T01:51:03","slug":"php-error-logging-to-syslog-from-a-chroot","status":"publish","type":"post","link":"https:\/\/blackdown.de\/articles\/php-error-logging-to-syslog-from-a-chroot\/","title":{"rendered":"PHP Error Logging to syslog from a chroot"},"content":{"rendered":"
Here’s a little trick to log PHP<\/a> errors to syslog from an apache<\/a> chroot. Instead of creating a Now apache calls Here’s a little trick to log PHP errors to syslog from an apache chroot. Instead of creating a $CHROOT\/dev\/log socket in the chroot and configuring syslog to listen on that, just define a bogus virtual host that logs to syslog. <VirtualHost 127.0.0.2:80> ServerName JustForOpeningSyslog Redirect permanent \/ http:\/\/127.0.0.1\/ ErrorLog syslog <\/VirtualHost> Now apache calls openlog(3)$CHROOT\/dev\/log<\/code> socket in the chroot and configuring syslog to listen on that, just define a bogus virtual host that logs to syslog.<\/p>\n
\r\n<VirtualHost 127.0.0.2:80>\r\n ServerName JustForOpeningSyslog\r\n Redirect permanent \/ http:\/\/127.0.0.1\/\r\n ErrorLog syslog\r\n<\/VirtualHost><\/pre>\n
openlog(3)<\/code> with
LOG_NDELAY<\/code> before being chrooted by libapache2-mod-chroot, and libapache2-mod-php4’s
syslog(3)<\/code> calls work just fine.
\n(Idea stolen from syslog(3) and chroot(2)<\/a>.)<\/p>\n","protected":false},"excerpt":{"rendered":"
[→ Read the rest of this entry<\/a>]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[6,3,2,8],"tags":[],"yoast_head":"\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n