• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Instaling awstats

N

nsteth

Guest
Hi. We are using plesk for webhosting, and I want to install another logfile analyzer to get advanced statistics.
Is there a problem with AWStats an Plesk 8 ?

Thanks.
 
there is no probelm with awstats.

i used it and the plugin for webmin for virtual hosts.

it works great.
 
Here is a wicked script I use for setting up awstats on a site:

USAGE:

./setup_awstats.sh <domain name> <ssl support 0/1>

Code:
#!/bin/bash

if [ $# == 0 ]; then
  echo "USAGE: $0 <domain name> <ssl support>"
  exit
fi

domain=$1
ssl_support=$2

if [ -z "$ssl_support" ]; then
  ssl_support=0
fi

# make awstats directory
mkdir -p /var/www/vhosts/$domain/statistics/awstats/
chown apache:apache /var/www/vhosts/$domain/statistics/awstats/

# remove previously added awstats to avoid dupe
if [ -e /var/www/vhosts/$domain/conf/vhost.conf ]; then
        cat /var/www/vhosts/$domain/conf/vhost.conf |grep -v "Include /var/www/vhosts/$domain/conf/awstats.conf" > /var/www/vhosts/$domain/conf/vhost.conf.tmp
        mv /var/www/vhosts/$domain/conf/vhost.conf.tmp /var/www/vhosts/$domain/conf/vhost.conf
fi

# remove previously added awstats to avoid dupe
if [ -e /var/www/vhosts/$domain/conf/vhost_ssl.conf ]; then
        cat /var/www/vhosts/$domain/conf/vhost_ssl.conf |grep -v "Include /var/www/vhosts/$domain/conf/awstats.conf" > /var/www/vhosts/$domain/conf/vhost_ssl.conf.tmp
        mv /var/www/vhosts/$domain/conf/vhost_ssl.conf.tmp /var/www/vhosts/$domain/conf/vhost_ssl.conf
fi

# add awstats to SSL domain if SSL was specified
if [ "$ssl_support" -eq 1 ] ; then
cat >> /var/www/vhosts/$domain/conf/vhost_ssl.conf <<EOF
Include /var/www/vhosts/$domain/conf/awstats.conf
EOF
fi

# add awstats to non-SSL domain if SSL is disabled
if [ ! "$ssl_support" -eq 1 ]; then
cat >> /var/www/vhosts/$domain/conf/vhost.conf <<EOF
Include /var/www/vhosts/$domain/conf/awstats.conf
EOF
fi

# generate apache awstats config
cat > /var/www/vhosts/$domain/conf/awstats.conf <<EOF
Alias /awstats/css /usr/share/awstats/wwwroot/css/
Alias /awstats/icon /usr/share/awstats/wwwroot/icon/
Alias /awstats/cgi-bin /usr/share/awstats/wwwroot/cgi-bin/
Alias /awstats/classes /usr/share/awstats/wwwroot/classes/

<Directory /usr/share/awstats/wwwroot/cgi-bin/>
        <IfModule mod_perl.c>
        <Files ~ (\.pl$)>
                SetHandler perl-script
                PerlHandler ModPerl::Registry
                Options ExecCGI
                PerlHandler ModPerl::Registry
                Options ExecCGI
                allow from all
                PerlSendHeader On
        </Files>
        </IfModule>
</Directory>

<Directory /usr/share/awstats/wwwroot/cgi-bin/>
        AuthType Basic
        AuthName "Domain statistics"
        AuthUserFile /var/www/vhosts/$domain/pd/d..httpdocs@plesk-stat
        require  valid-user
</Directory>
EOF

# generate awstats mail config
cat > /etc/awstats/awstats.mail.$domain.conf <<EOF
Include "/etc/awstats/awstats.model.conf"

DNSLookup=0
DirData="/var/www/vhosts/$domain/statistics/awstats/"
SiteDomain="mail.$domain"
LogFile="/usr/local/awstats/tools/maillogconvert.pl vadmin $domain < /usr/local/psa/var/log/maillog.processed |"
LogType=M
LogFormat="%time2 %email %email_r %host %host_r %method %url %code %bytesd"
LevelForBrowsersDetection=0
LevelForOSDetection=0
LevelForRefererAnalyze=0
LevelForRobotsDetection=0
LevelForWormsDetection=0
LevelForSearchEnginesDetection=0
LevelForFileTypesDetection=0
ShowMenu=1
ShowSummary=HB
ShowMonthStats=HB
ShowDaysOfMonthStats=HB
ShowDaysOfWeekStats=HB
ShowHoursStats=HB
ShowDomainsStats=0
ShowHostsStats=HBL
ShowAuthenticatedUsers=0
ShowRobotsStats=0
ShowEMailSenders=HBML
ShowEMailReceivers=HBML
ShowSessionsStats=0
ShowPagesStats=0
ShowFileTypesStats=0
ShowFileSizesStats=0
ShowBrowsersStats=0
ShowOSStats=0
ShowOriginStats=0
ShowKeyphrasesStats=0
ShowKeywordsStats=0
ShowMiscStats=0
ShowHTTPErrorsStats=0
ShowSMTPErrorsStats=1
EOF


# generate awstats http config
cat > /etc/awstats/awstats.http.$domain.conf <<EOF
Include "/etc/awstats/awstats.model.conf"

DirData="/var/www/vhosts/$domain/statistics/awstats/"
LogFile="/var/www/vhosts/$domain/statistics/logs/access_log.processed"
LogType=W
LogFormat=1
SiteDomain="www.$domain"
HostAliases="$domain [url]www.[/url]$domain"
EOF

# generate awstats ssl https config
cat > /etc/awstats/awstats.https.$domain.conf <<EOF
Include "/etc/awstats/awstats.model.conf"

DirData="/var/www/vhosts/$domain/statistics/awstats/"
LogFile="/var/www/vhosts/$domain/statistics/logs/access_ssl_log.processed"
LogType=W
LogFormat=1
SiteDomain="www.$domain"
HostAliases="$domain [url]www.[/url]$domain"
UseHTTPSLinkForUrl="/"
EOF

# generate index.html frameset page
cat > /var/www/vhosts/$domain/statistics/index.html <<EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>$domain Statistics</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<frameset rows="30,*" frameborder="NO" border="0" framespacing="0">
  <frame src="menu.html" name="topFrame" scrolling="NO" noresize >
  <frame src="/awstats/cgi-bin/awstats.pl?config=http.$domain" name="mainFrame">
</frameset>
<noframes><body>
</body></noframes>
</html>
EOF

# generate top menu for frame with links to awstats & webalizer stats
cat > /var/www/vhosts/$domain/statistics/menu.html <<EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
BODY { font-family: Tahoma, Verdana, Arial; font-size: 8pt; }
A { color: #404040; text-decoration: none; font-weight: bold; font-size: 8pt; }
A:hover { text-decoration: none; color: #808080; }
</style>
</head>

<body>
<table width="100%" cellpadding="0" cellspacing="0"><tr><td align="left">
[ <b>awstats</b> ]
<a href="/awstats/cgi-bin/awstats.pl?config=anonftp.$domain" target="mainFrame" title="Anonymous FTP Statistics for $domain">anonymous ftp</a> <small>|</small>
<a href="/awstats/cgi-bin/awstats.pl?config=ftp.$domain" target="mainFrame" title="FTP Statistics for $domain">ftp</a> <small>|</small>
<a href="/awstats/cgi-bin/awstats.pl?config=mail.$domain" target="mainFrame" title="Mail Statistics for $domain">mail</a> <small>|</small>
<a href="/awstats/cgi-bin/awstats.pl?config=https.$domain" target="mainFrame" title="SSL Statistics for $domain">ssl</a> <small>|</small>
<a href="/awstats/cgi-bin/awstats.pl?config=http.$domain" target="mainFrame" title="Web Statistics for $domain">web</a>
</td><td align="right">
[ <b>webalizer</b> ]
<a href="/anon_ftpstat" target="mainFrame" title="Anonymous FTP Statistics for $domain">anonymous ftp</a> <small>|</small>
<a href="/ftpstat" target="mainFrame" title="FTP Statistics for $domain">ftp</a> <small>|</small>
<a href="/webstat-ssl" target="mainFrame" title="SSL Statistics for $domain">ssl</a> <small>|</small>
<a href="/webstat" target="mainFrame" title="Web Statistics for $domain">web</a>
</td></tr></table>

</body>
</html>
EOF

# make sure vhost.conf or vhost_ssl.conf is included by httpd.include
/usr/local/psa/admin/bin/websrvmng --vhost-name=$domain
 
Yes but how can we install it 'serverwide' for all the existing virtual hosts at one time as well as it will automatically install on new domains also?

There was a script that automaically did all of this for Ensim ... is there one for Plesk?

I thought Plesk had awstats in their control panel already ... are they NUTZZZZZZ or what ... there is NO COMPARISON with 'webalizer' ...

TIA
 
Here is a wicked script I use for setting up awstats on a site:
USAGE:
./setup_awstats.sh <domain name> <ssl support 0/1>
So tylerc,
We can run your script from the root commandline and simply change the <domain name> to <domainTOuse.com>
for multiple domains each time is that correct?

TIA
 
are they NUTZZZZZZ or what
Most definitely. We looked at Plesk for our FreeBSD dedicateds but when we realized it didn't have AWStats, we reloaded. I was looking at a VPS and Plesk 8, so I stopped by to see if meets the requirements of an average domain user. Looks like I'll have to stop back in a couple years.
 
Originally posted by Lord
there is no probelm with awstats.
i used it and the plugin for webmin for virtual hosts. it works great.
Can you tell us how to install it GLOBALLY for all 90 domains at once?

TIA,
aaabyss
 
Plesk support????

We NEED awstats!!!

I am NOT the only one that thinks so.

Anyone home???

aaabyss
 
Hey Guys,
I know it sucks to not have your AWSTATS! We provide 4PSA software that uses awstats, 4PSA Advanced Stats... I'm really not sure as to why SWSOFT hasn't included awstats as default over webalizer, ugh!

Anyway, Advanced stats does support BSD and all other OS's support by plesk.

I hope this helps,
For a 20 percent total discount off this product, enter in "JBWHT" and we will grant the discount for a few more days!
http://www.jbwebhosting.com/4psa.html

Take Care,
Charles
JB WebHosting, LLC
 
Trouble with 4PSA products is they like to make sure there name is clearly showing, so if you donlt like that in a 'rebrandable' control panel then it might nor be for you. I think they want to have their cake and eat it, it looks like this :

(c) Copyrights , 2002-2006 Rack-Soft, LLC (www. 4psa.com). All rights reserved.

Note the even get their web URL in the notice, bit of a liberty if u ask me !!!
 
Ive been trying to use the script but with no success.
I have plesk on debian.

I'm a total beginer to server admin & linux.

Here's what I've done so far...

used notepad to put the script into a file called setup_awstats.sh

placed it in the vhosts directory using winscp

used putty with the command...
chmod 755 setup_awstats.sh ./setup_awstats.sh mydomainname.co.uk 0


and I get this error -
chmod: cannot access `0': No such file or directory

Can anyone give me a dunce step by step guide or help me to where I'm going wrong.

many thanks
 
Back
Top