It's all about the answers!

Ask a question

How can I rotate access_log file in IHS server


Penchala suman (461425) | asked Feb 07 '18, 8:19 a.m.
edited Feb 07 '18, 8:31 a.m. by Fariz Saracevic (919613)

I’m trying to rotate access_log file in IHS server (httpd.conf) and it is not working.

I’m using below syntax (IHS server is in Linux).

<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


permanent link
Kevin Ramer (4.5k9186201) | answered Feb 07 '18, 4:55 p.m.

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

Penchala suman selected this answer as the correct answer

One other answer



permanent link
Penchala suman (461425) | answered Feb 08 '18, 1:54 a.m.

Thanks Kevin,

The below command worked for me.
CustomLog "|/opt/IBM/HTTPServer/bin/rotatelogs /opt/IBM/HTTPServer/logs/access.log.%Y-%m-%d-%H_%M_%S 86400" common


Comments
Kevin Ramer commented Feb 08 '18, 3:26 p.m.

Cool !  Glad to have helped.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.