Problem with cPanel error log and LiteSpeed
I am currently struggling with a problem related to the cPanel Error Log and LiteSpeed configured with suEXEC. I have set PHP to log errors to the server error_log in /usr/local/apache/logs/error_log. In LiteSpeed, the server error log level is set to Warning and the File Name = /usr/local/apache/logs/error_log.
The problem is that in order for PHP to be able to write to the error log, the log file must be world-writable (chmod 666) because of suEXEC. On log rotation, the permissions of the log file is reset to 644 and PHP errors are not logged. Is this expected behavior, or is there a solution to this problem? Now I have to pay attention to when the log is rotated, and then change the permissions manually.
With Apache I never had any problems with the error logs, so this is the only issue I have with LiteSpeed at the moment.
The best solution would be if each PHP error log could be stored in clients home directory (is this how cPanel/Apache does it by default?), instead of having a single server-wide file. However, I have not figured out how to accomplish this with cPanel.
Any advise is appreciated.