How can I restore or import webalizer logs for my domain? Print

  • 0

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.

 


Was this answer helpful?
Back

Send Message