Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

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>

0 votes


Accepted answer

Permanent link

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

1 vote


One other answer

Permanent link

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

0 votes

Comments

Cool !  Glad to have helped.

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 1,700
× 1

Question asked: Feb 07 '18, 8:19 a.m.

Question was seen: 3,842 times

Last updated: Feb 08 '18, 3:26 p.m.

Confirmation Cancel Confirm