webcp.hostinghacks.net/slackware | awstats

home   ·.   download   ·.   install   ·.   faq   ·.   forums   ·.   contribute   ·.   change log   ·.   toolbox
SYNOPSIS

awstats installation as provide by colklink @ solidnetsys.com

PREREQUISITES: source packages

The installation commands can be run from a Putty window in a "cut-and-paste" style layout or copied to a script. Notes on Putty best practices can be found at http://hostinghacks.net/putty/.
last updated: June 2005
INSTALL AWSTATS
### Download and unpack AWStats in /usr/local 

cd /usr/local 
wget http://heanet.dl.sourceforge.net/sourceforge/awstats/awstats-6.4.tgz 
# wget http://hostinghacks.net/dist/awstats-6.4.tgz 

tar -xzf awstats-6.4.tgz 
mv awstats-6.4 awstats 
chown -R nobody.nobody awstats 

mkdir -p /etc/awstats
mkdir -p /var/lib/awstats 
chown nobody.nobody /var/lib/awstats
HACK THE CP

cd /usr/src
wget http://phpanel.net/dist/phpanel-current.tar.gz
tar -zxf phpanel-current.tar.gz

cp /usr/src/phpanel/webcp-patches/awstats/awstats.wcp.phps /home/webcp/server/lib/awstats.wcp.phps
cp /usr/src/phpanel/webcp-patches/awstats/functions.inc.phps /home/webcp/server/functions.inc.phps -f

chown webcp.webcp /home/webcp/server/lib/awstats.wcp.phps
chmod 750   /home/webcp/server/lib/awstats.wcp.phps
chown webcp.webcp /home/webcp/server/functions.inc.phps
chmod 750   /home/webcp/server/functions.inc.phps

Add to the config.php file:

// AWStats settings
$cfg['awstats']          = true;
$cfg['awstatsdir']       = '/etc/awstats';

$cfg['sslang']      = 'php,ssi,perl,ssl,awstats';

$cfg['ss']['awstats'] = "\tAlias /awstatsclasses \"/usr/local/awstats/wwwroot/classes/\" 
\tAlias /awstatscss \"/usr/local/awstats/wwwroot/css/\" 
\tAlias /awstatsicons \"/usr/local/awstats/wwwroot/icon/\" 
\tScriptAlias /awstats/ \"/usr/local/awstats/wwwroot/cgi-bin/\" 
\t<Directory \"/usr/local/awstats/wwwroot\"> 
\t\tOptions None            
\t\tAllowOverride None        
\t\tOrder allow,deny              
\t\tAllow from all              
\t</Directory>"; 

Add to the english.php file:

$T['ss']['awstats']             = 'Awstats'; 

To get links from inside the cp you can also add:


// External Menu Content
$dom = fetchdata("domain", "domain", $number);
//$T['external'][0]['name']               = 'phpMyAdmin';
//$T['external'][0]['url']                = '/phpmyadmin/';
$T['external'][1]['name']               = 'Webmail';
$T['external'][1]['url']                = 'https://www.'.$dom['domain'].'/webmail';
$T['external'][2]['name']               = 'AwStats';
$T['external'][2]['url']                = 'http://www.' . $dom['domain'] . '/awstats/awstats.pl';
$T['external'][3]['name']               = 'Webalizer';
$T['external'][3]['url']                = 'http://www.' . $dom['domain'] . '/stats/';

These edits have been made in the phpanel version of the english.php file (as well as many other changes - inspect before you make this switch!):

cp /usr/src/phpanel/webcp-patches/lang/english.phps /home/webcp/web/lang/english.phps -f
chown webcp.webcp /home/webcp/web/lang/english.phps
chmod 750   /home/webcp/web/lang/english.phps
Restart webcp and you should find the option to switch on AWStats in the domain cp.
CONFIGURING A PRE-EXISTING WEBCP DOMAIN

note - this is for adding awstats to a virtual domain already present in /etc/apache/httpd.conf

cd /usr/local/awstats/tools/
./awstats_configure.pl

>>> choose none to skip web server setup >>> then when asked to configure enter the domain name and accept the default config directory (/etc/awstats). This will create a SIMPLE config file: /etc/awstats/awstats.phpanel.net.conf You should have a look inside to check and change manually main parameters. In particular you will need to change the location of the log files:

cat > /etc/awstats/awstats.phpanel.net.conf << "EOF"
LogFile="/home/phpanel.net/www/logs/access"
LogType=W
LogFormat=1
LogSeparator=" "
SiteDomain="phpanel.net"
HostAliases="phpanel.net www.phpanel.net"
DNSLookup=2
DirData="/var/lib/awstats"
DirCgi="/awstats"
DirIcons="/awstatsicons"
AllowToUpdateStatsFromBrowser=1
AllowFullYearView=2
EnableLockForUpdate=0
DNSStaticCacheFile="dnscache.txt"
DNSLastUpdateCacheFile="dnscachelastupdate.txt"
SkipDNSLookupFor=""
AllowAccessFromWebToAuthenticatedUsersOnly=0
AllowAccessFromWebToFollowingAuthenticatedUsers=""
AllowAccessFromWebToFollowingIPAddresses=""
CreateDirDataIfNotExists=0
BuildHistoryFormat=text
BuildReportFormat=html
SaveDatabaseFilesWithPermissionsForEveryone=0
PurgeLogFile=0
ArchiveLogRecords=0
KeepBackupOfHistoricFiles=0
DefaultFile="index.html"
SkipHosts=""
SkipUserAgents=""
SkipFiles=""
OnlyHosts=""
OnlyUserAgents=""
OnlyFiles=""
NotPageList="css js class gif jpg jpeg png bmp ico swf"
ValidHTTPCodes="200 304"
ValidSMTPCodes="1 250"
AuthenticatedUsersNotCaseSensitive=0
URLNotCaseSensitive=0
URLWithAnchor=0
URLQuerySeparators="?;"
URLWithQuery=0
URLWithQueryWithOnlyFollowingParameters=""
URLWithQueryWithoutFollowingParameters=""
URLReferrerWithQuery=0
WarningMessages=1
ErrorMessages=""
DebugMessages=0
NbOfLinesForCorruptedLog=50
WrapperScript=""
DecodeUA=0
MiscTrackerUrl="/js/awstats_misc_tracker.js"
LevelForBrowsersDetection=2
LevelForOSDetection=2
LevelForRefererAnalyze=2
LevelForRobotsDetection=2
LevelForSearchEnginesDetection=2
LevelForKeywordsDetection=2
LevelForFileTypesDetection=2
LevelForWormsDetection=0
UseFramesWhenCGI=1
DetailedReportsOnNewWindows=1
Expires=0
MaxRowsInHTMLOutput=1000
Lang="auto"
DirLang="./lang"
ShowMenu=1
ShowSummary=UVPHB
ShowMonthStats=UVPHB
ShowDaysOfMonthStats=VPHB
ShowDaysOfWeekStats=PHB
ShowHoursStats=PHB
ShowDomainsStats=PHB
ShowHostsStats=PHBL
ShowAuthenticatedUsers=0
ShowRobotsStats=HBL
ShowWormsStats=0
ShowEMailSenders=0
ShowEMailReceivers=0
ShowSessionsStats=1
ShowPagesStats=PBEX
ShowFileTypesStats=HB
ShowFileSizesStats=0
ShowOSStats=1
ShowBrowsersStats=1
ShowScreenSizeStats=0
ShowOriginStats=PH
ShowKeyphrasesStats=1
ShowKeywordsStats=1
ShowMiscStats=a
ShowHTTPErrorsStats=1
ShowSMTPErrorsStats=0
ShowClusterStats=0
AddDataArrayMonthStats=1
AddDataArrayShowDaysOfMonthStats=1
AddDataArrayShowDaysOfWeekStats=1
AddDataArrayShowHoursStats=1
IncludeInternalLinksInOriginSection=0
MaxNbOfDomain = 10
MinHitDomain  = 1
MaxNbOfHostsShown = 10
MinHitHost    = 1
MaxNbOfLoginShown = 10
MinHitLogin   = 1
MaxNbOfRobotShown = 10
MinHitRobot   = 1
MaxNbOfPageShown = 10
MinHitFile    = 1
MaxNbOfOsShown = 10
MinHitOs      = 1
MaxNbOfBrowsersShown = 10
MinHitBrowser = 1
MaxNbOfScreenSizesShown = 5
MinHitScreenSize = 1
MaxNbOfWindowSizesShown = 5
MinHitWindowSize = 1
MaxNbOfRefererShown = 10
MinHitRefer   = 1
MaxNbOfKeyphrasesShown = 10
MinHitKeyphrase = 1
MaxNbOfKeywordsShown = 10
MinHitKeyword = 1
MaxNbOfEMailsShown = 20
MinHitEMail   = 1
FirstDayOfWeek=1
ShowFlagLinks=""
ShowLinksOnUrl=1
UseHTTPSLinkForUrl=""
MaxLengthOfShownURL=64
HTMLHeadSection=""
HTMLEndSection=""
Logo="awstats_logo6.png"
LogoLink="http://awstats.sourceforge.net"
BarWidth   = 260
BarHeight  = 90
StyleSheet=""
ExtraTrackedRowsLimit=500
EOF

chmod 644 /etc/awstats/awstats.phpanel.net.conf

You can then manually update your statistics for 'phpanel.net' with:

/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=phpanel.net

You can also build static report pages for 'phpanel.net' with command:

/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -output=pagetype -config=phpanel.net
REFERENCE MATERIAL
RELATED LINKS
Powered By Fat Penguin Hosting   |   Disclaimer