• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

webalizer and subdomains

K

kklemenss

Guest
Is there any possibility to have subdomain statistics with webalizer? On windows plesk i have AWstat and i like it, but for linux version of plesk there is no AWstat...

can somebody help me pliz

thanks
 
Yes, it is possible to set this up, but it needs some work.

- You need to create separate log files for the subdomain by placing the following inside the subdomains vhost.conf:

CustomLog /var/www/vhosts/<domain>/statistics/logs/<subdomain>_access_log plesklog
ErrorLog /var/www/vhosts/<domain>/statistics/logs/<subdomain>_error_log

- Next create a directory for the statistics:

mkdir /var/www/vhosts/<domain>/subdomains/<subdomain>/webstat

- Add an alias to your subdomains vhost.conf file so you can call the statistics even though they are not in yout httpdocs directory:

Alias /webstat /var/www/vhosts/<domain>/subdomains/<subdomain>/webstat

The only thing missing now is logrotation for the new logs (maybe thats done by standard logrotation of that domain - you should check this) and the webalizer call which can be placed in a shell script in cron.daily:

#!/bin/sh
webalizer -p -q -c /var/www/vhosts/<domain>/conf/webalizer.conf -o /var/www/vhosts/<domain>/subdomains/<subdomain>/webstat
 
must i do someting else.. that this will start to work? now on my domain i get Access forbidden!

how can i check if this is working?
 
I guess you get Access forbidden when trying to access webstat directory, right?

Right now there are no logs there and the logs were never processed with webalizer - therefore the directory is empty.

- When you access the subdomain - is it logged in the new log files?

- When you run the command

webalizer -p -q -c /var/www/vhosts/<domain>/conf/webalizer.conf -o /var/www/vhosts/<domain>/subdomains/<subdomain>/webstat /var/www/vhosts/<domain>/statistics/logs/<subdomain>_access_log

does it create the files in the subdomain webstat directory?

BTW: Please correct the script line in the file for cron.daily with the above one - I missed the logfile in my first answer
 
coko u are god! now its working, but i msut add this in cron. really tnx!
 
Originally posted by kklemenss
coko u are god! now its working, but i msut add this in cron. really tnx!

I guess you mean good, not god :D

Dealing with this kind of stuff is my daily work - and I still like it :)
 
one question more... in /etc/cron.daily/webalizer i have this script:

#!/bin/sh
# /etc/cron.daily/webalizer: webalizer daily maintenance script
# Written by Remco van de Meent <remco@debian.org>

WEBALIZER_BIN=/usr/bin/webalizer
WEBALIZER_CONF=/etc/webalizer.conf

# See if the webalizer binary and config file exists
# if not, exit without warning to prevent daily mails
[ -f ${WEBALIZER_BIN} ] || exit 0
[ -f ${WEBALIZER_CONF} ] || exit 0

# Figure out non-rotated logfile
nonrotatedlog=`egrep '^LogFile' $WEBALIZER_CONF | \
sed -e 's/[[:space:]]\+/ /' | \
cut -d ' ' -f2 | \
sed -e 's/\.[[:digit:]][\.gz]*$//'`

# Can we read it?
[ -r "${nonrotatedlog}" ] || exit 0

# Check for empty logfile
logsz=`echo ${nonrotatedlog} | \
sed -e 's/[[:space:]]\+/ /' | \
cut -d ' ' -f2 | \
xargs ls -l | \
sed -e 's/[[:space:]]\+/ /g' | \
cut -d ' ' -f5`
[ $logsz -gt 0 ] || exit 0

# Run webalizer quietly
${WEBALIZER_BIN} -c ${WEBALIZER_CONF} -q
${WEBALIZER_BIN} -c ${WEBALIZER_CONF} -q ${nonrotatedlog}

# Exit with webalizer's exit code
exit $?

do i add thoes lines in here or? webalizer -p -q -c /var/www/vhosts... line
 
Back
Top