keep apache access log for 30 days

From WebHostingNeeds.com
Jump to: navigation, search

By default cpanel server rotate access log every 24 hours. IF a site hacked x days ago, you have no access log to investigate.

For all newely created accounts keep 30 days of access long in /home/user/logs/ folder, do

vi /root/cpanel3-skel/.cpanel-logs

add

archive-logs=1
remove-old-archived-logs=1


Enable for Existing Site

Edit

vi /home/USERNAME/.cpanel-logs

Add


archive-logs=1
remove-old-archived-logs=1


Change ownership of the file

chown USERNAME:USERNAME /home/USERNAME/.cpanel-logs


Ref



cpanel

cpanel server setup