How can I rotate access_log file in IHS server
I’m trying to rotate access_log file in IHS server (httpd.conf) and it is not working.
<o:p> </o:p>
CustomLog "/opt/IBM/HTTPServer/bin/rotatelogs /opt/IBM/HTTPServer/logs/access_log 86400" common <o:p> </o:p>
Error message:
[error] (2)No such file or directory: could not open transfer log file /opt/IBM/HTTPServer/bin/rotatelogs /opt/IBM/HTTPServer/logs/access_log 86400.
Unable to open logs <o:p> </o:p>
Note: I’ve full control to log directory and I’m as root.
Can anyone help?
<o:p> </o:p>
Accepted answer
What I would check: do both /opt/IBM/HTTPServer/bin/rotatelogs and /opt/IBM/HTTPSever/logs/access_log exist and is the rotatelogs executable.
e.g.: [ this is an older version of IHS, so different path ]
$ ls -l /usr/IBM/HTTPServer1/bin/rotatelogs
-rwxr-xr-x 1 root system 180629 May 30 2017 /usr/IBM/HTTPServer1/bin/rotatelogs
Also, this article shows that a pipe symbol (|) should be the 1st character in the CustomLog value