Question
I need to reimport or add logs to Webalizer, is there an easy way to do this?
Answer
You can utilize the Webalizer binary and import them from the command line. Replace $user with your cPanel user and $domain with your domain. For HTTP, this needs to be imported into the Webalizer folder, and for SSL, it needs to use "webalizer/ssl/domain.com".
For Non-SSL:
gunzip -c /home/$user/logs/$domain.tld-Mon-YYYY.gz | /usr/local/cpanel/3rdparty/bin/webalizer -p -n $domain -o /home/$user/tmp/webalizer/$domain.com/stats
For SSL:
gunzip -c /home/$user/logs/$domain.tld-ssl_log-Mon-YYYY.gz | /usr/local/cpanel/3rdparty/bin/webalizer -p -n $domain -o /home/$user/tmp/webalizer/ssl/$domain.com/stats
If the user is using Jail shell, you'll need to add:
For Non-SSL:
su $user -s /usr/local/cpanel/bin/jailshell -c 'gunzip -c /home/$user/logs/$domain.tld-Mon-YYYY.gz | /usr/local/cpanel/3rdparty/bin/webalizer -p -n $domain -o /home/$user/tmp/webalizer/$domain.com/stats'
For SSL:
su $user -s /usr/local/cpanel/bin/jailshell -c 'gunzip -c /home/$user/logs/$domain.tld-ssl_log-Mon-YYYY.gz | /usr/local/cpanel/3rdparty/bin/webalizer -p -n $domain -o /home/$user/tmp/webalizer/ssl/$domain.com/stats'
Please note /home/$user/tmp/webalizer/$domain.com/stats
and /home/$user/tmp/webalizer/ssl/$domain.com/stats
are directories.
Comments
0 comments
Article is closed for comments.