PDA

View Full Version : awstats?


mindblender
02-03-2005, 07:21 PM
Anyone replaced webalizer with awstats? Ideally I'd like to complety replace webalizer integration with awstats but until I learn a little mor eI doubt that will happen. :)

Was thinking of adding a custom button for my clients so that they could view the stats for their domains from Plesk. Obviously they would be able to access the stats view the domain as well.

Any thoughts, concerns, suggestions?

brucew
02-10-2005, 11:11 AM
4PSA's Advanced Statistics, http://4psa.com/products/4psaadvancedstats.php does all that and more, (email a PDF to the client, etc). True, it's a hundred bucks, but it's worth it in timesavings.

Jason Lee
02-10-2005, 11:13 AM
There is a good chance we will see awstats in Plesk 8.

mindblender
02-10-2005, 03:45 PM
Thanks for the replies :)


Bruce,
I'd prefer to not have to pay for the web stats, hence using awstats. I currently use awstats on my production box but since I'm migrating all my sites to the 1and1 box I needed to setup awstats since thats what my clients are used to seeing.

Jason,
I had read that in the SW-Soft forums. Unfortunatly I haven't seen an estimated release date and I can't wait for version 8 to come out.

Jason Lee
02-10-2005, 06:25 PM
Jason,
I had read that in the SW-Soft forums. Unfortunatly I haven't seen an estimated release date and I can't wait for version 8 to come out.

I belive I read on the SW-Soft forums that Plesk 8 should be out within half a year. But if you need it right now there are several tutorials mentioned on the SW-Soft forums that explain how to setup AW-Stats.

brucew
02-11-2005, 12:09 AM
Bruce,
I'd prefer to not have to pay for the web stats, hence using awstats. I currently use awstats on my production box but since I'm migrating all my sites to the 1and1 box I needed to setup awstats since thats what my clients are used to seeing.

No problem. Just wanted to point out there's more than one way to skin the cat. Personally, there's nothing Plesk does (or 1&1 for that matter) that I can't do myself. For me, it's less aggrivation to pay for it and it frees my time up for other things.

To each their own.

mindblender
02-21-2005, 06:29 PM
Well I finally had a moment to tackle this issue. My goal was to install a new global domain, such as stats.clientdomain.com, that would point to AWSTATS.

Below are the steps I took to get it working for me. I did not write this as I was doing it, but ater the fact so I' hope I didnt' forget anything. If someone could verify my steps then maybe we can get this added to the How-To section.

Here's the instructions:
Steps to install AWSTATS and make it accessible via a global domain such as stats.yourdmain.com. Obviously replace any yourdomain.com with your actual domain and change the IP addresses to your actual IP addresses.

- Set up global domain -
=======================
- In Plesk:
1. Under Server->DNS create a new "A" record and enter "stats" in the domain field.
2. Enter your IP address.
3. Click "OK"

- From the command line you need to manually add the stats.* to your web server. Here's how I did it
1. SSH/Telnet to your server and create a new folder called "stats" in the /home/httpd/vhosts/ directory.
2. Create a httpdocs folder in the /home/httpd/vhosts/stats/ folder
3. Change into the /home/httpd/vhosts/stats/ folder
4. Create another folder called conf and change directories into it: cd conf
5. type vi httpd.include and enter in the following:

############
# Directives to allow use of AWStats as a CGI
#
#Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
#Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
#Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
#ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"

Alias /awstatsclasses "/home/httpd/vhosts/stats/httpdocs/classes/"
Alias /awstatscss "/home/httpd/vhosts/stats/httpdocs/css/"
Alias /awstatsicons "/home/httpd/vhosts/stats/httpdocs/icon/"
ScriptAlias /awstats/ "/home/httpd/vhosts/stats/httpdocs/cgi-bin/"
#
# This is to permit URL access to scripts/files in AWStats directory.
#
#<Directory "/usr/local/awstats/wwwroot">
<Directory "/home/httpd/vhosts/stats/httpdocs">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>

<VirtualHost \
11.22.33.44:80 \
11.22.34.45:80 \
>
DocumentRoot /home/httpd/vhosts/stats/httpdocs
ServerName stats
ServerAlias stats.*
UseCanonicalName Off
<Directory /home/httpd/vhosts/stats/httpdocs>
Options FollowSymLinks
Options -Includes -ExecCGI
<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_flag magic_quotes_gpc off
php_admin_flag safe_mode off
php_admin_value open_basedir "/home/httpd/vhosts/stats:/etc/psa:/tmp"
</IfModule>
</Directory>
</VirtualHost>

<IfModule mod_ssl.c>

<VirtualHost \
11.22.33.44:443 \
11.22.34.45:443 \
>
DocumentRoot /home/httpd/vhosts/stats/httpdocs
ServerName stats
ServerAlias stats.*
UseCanonicalName Off
SSLEngine on
SSLVerifyClient none
SSLCertificateFile /etc/httpd/conf/httpd.pem
<Directory /home/httpd/vhosts/stats/httpdocs>
SSLRequireSSL
</Directory>
</VirtualHost>
</IfModule>


6. Now type vi /etc/httpd/conf/httpd.include and insert the following at the very end:
Include /home/httpd/vhosts/stats/conf/httpd.include
7. Now let's create an index file to make sure that the stats.yourdomain.com is working properly. Type the following:
vi /home/httpd/vhost/stats/httdocs/index.php
Then enter:

<html>
<head>
<title>Stats for: <? echo $_SERVER['HTTP_HOST']; ?></title>
</head>
<body>
<? echo $_SERVER['HTTP_HOST']; ?>
</body>
</html>

Save the above by typing :wq
8. Restart your web server by typing: /etc/rc.d/init.d/httpd restart
9. You should now be able to access stats.yourdomain.com

If you were able to access the stats.yourdomain.com then continue to the AWSTATS installation

- Setup AWSTATS -
=================
1. cd into the /home/httpd/vhosts/stats/ folder
2. Download a copy of AWSTATS from awstats.sourceforge.net or type" wget http://easynews.dl.sourceforge.net/sourceforge/awstats/awstats-6.3.tgz"
- However you get the distrobution copy copy the .tgz file into your /home/httpd/vhosts/stats/ folder
3. Type tar -xvz awstats-6.3.tgz
4. After it has extracted you should see four new folders and a README>TXT file. The folders should be:
docs/
tools/
README.TXT
5. Change into the wwwroot folder and do cp * ../httpdocs/
- This should move the following folder:
cgi-bin/
classes/
css/
icons/
js/
6. Create the following directories and change the permissions:
/var/lib/awstats - chmod 777
/etc/awstats - chmod 755
7. For further organization I created a subfolder under /var/lib/awstats for each of the sites I host. This is where awstats will store its site databases, aka DirData in the configuration file.

8. Copy the /home/httpd/vhosts/stats/httdocs/cgi-bin/awstats.model.conf file to /etc/awstats
9. Move the awstats.model.conf file to awstats.yourdomian.com.conf
10. Edit the awstats.yourdomain.com.conf file and change the following lines:

LogFile="/home/httpd/vhosts/yourdomain.com/statistics/logs/access_log.processed"
SiteDomain="yourdomain.com"
HostAliases="yourdomain.com www.yourdomain.com"
DirData="/var/lib/awstats/yourdomain.com"

11. At this point you should be able to isse the following command:
perl /home/httpd/vhosts/stats/httpdocs/cgi-bin/awstats.pl -config=yourdomain.com -update

You should get something similar to the following output:

Update for config "/etc/awstats/awstats.yourdomain.com.conf"
With data in log file "/home/httpd/vhosts/yourdomain.com/statistics/logs/access_log.processed"...
Phase 1 : First bypass old records, searching new record...
Direct access after last parsed record (after line 202)
Jumped lines in file: 202
Found 202 already parsed records.
Parsed lines in file: 0
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 0 new qualified records.

12. If you did not receive any errors then you can now access the stats page at the folowing url:
http://stats.yourdomain.com/awstats/awstats.pl?config=yourdomain.com

13. Once you have verified that you can view the stats via the web browser I'd suggest you modify the /home/httpd/vhosts/stats/httpdocs/index.php file to the following:

<?
$redirect = "http://".$_SERVER['HTTP_HOST']."/awstats/awstats.pl?config=".substr($_SERVER['HTTP_HOST'], (strpos($_SERVER['HTTP_HOST'], '.')+1));
header("Location:$redirect");
exit;
?>
<html>
<head>
<title>Stats Page for: <? echo "$domain_name"; ?></title>
</head>
<body>
</body>
</html>

What this does is redirects to the awstats.pl file and passes it whatever domain was used to access the stats.domain.com url, for example if you went to stats.yourdomain.com then it would redirect to: http://stats.yourdomain.com/awstats/awstats.pl?config=yourdomain.com and if you went to stats.abc123.com then it would redirect to: http://stats.abc123.com/awstats/awstats.pl?config=abc123.com

14. Thats it. For the most part its fairly easy to get installed. Any error messages may get might be due to a permission issue or an incorrect path. Feel free to post any suggestions, questions or problems.

Thanks

Edit:
Forgot to mention that once you have one domain setup, you can copy the awstats.yourdomain.conf to awstats.newdomain.conf and just edit the settings listed above.

Also, in order to have the stats get updated automatically you can add the following to the bottom of your crontab:
type: crontab -e
10 5 * * * /home/httpd/vhosts/stats/tools/awstats_updateall.pl now

##########################################
UPDATE: 2005-11
##########################################
Thought I'd give an update regarding one issue that I'm having and haven't had a chance to look at. The above steps work properly, however when you add a new domain or site to your server and restart the service (http or dns, I'm not 100% sure) it will cause the stats.<domain name> to stop working and go to the default-domain.

I'm assuming that Plesk is overwriting the httpd.include file and it might be a simple matter of finding the soruce httpd.include file Plesk is using and modifying that one.

I'll update this post if I find a solution.

eWebtricity
02-23-2005, 12:58 AM
Nice job

nullensc
10-30-2005, 07:52 AM
Thanks Mindblender

I'm going through the procedure and am having the following issues or have made slight diversions to your instruction which I record here for informational purposes:

DNS

- Section 1: I ignored the "set DNS in Plesk" part and did this on my eNom control panel since I'm using their DNS servers.

STATS folder

Section5: I copied the text this into Notepad and WinSCP'ed it across to the server and renamed it.

AWS Section

- Section 3: the tar command hung on my system so I downloaded a .zip version of awstats 6.4, unzipped on my PC and WinSCP'ed across to the server

- Section 8: the path is shown as

copy the /home/httpd/vhosts/stats/httdocs/cgi-bin/awstats.model.conf file to /etc/awstats

I think it should be (or is on my system);

copy the /home/httpd/vhosts/stats/wwwroot/cgi-bin/awstats.model.conf file to /etc/awstats

- Section 9: I presume you mean to duplicate awstats.model.conf file within /etc/awstats/ and name awstats.yourdomain.model.conf

- Section 10: I couldn't find the lines you indicate in awstats.ecusb.net.conf so I added them at the end of the file

- Section 11: I got stuck here with a permission error (possibly) as follows:

perl /home/httpd/vhosts/stats/wwwroot/cgi-bin/awstats.pl -config=ecusb.net
Error: AWStats database directory defined in config file by 'DirData' parameter (/var/lib/awstats/ecusb.net) does not exist or is not writable.
Setup ('/etc/awstats/awstats.ecusb.net.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

I resolved this by creating a writable directory at /var/lib/awstats/ecusb.net - this is because I made a mistake in AWS section 7 where I created this folder within /home/httpd/vhosts/ecusb.net/var/lib instead of the path [easy to get confused with so many paths to think about ;-)]

The output I got included a phase 2, presumably because I have existing stats for this domain:


# perl /home/httpd/vhosts/stats/wwwroot/cgi-bin/awstats.pl -config=ecusb.net
Update for config "/etc/awstats/awstats.ecusb.net.conf"
With data in log file "/home/httpd/vhosts/ecusb.net/statistics/logs/access_log.processed"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Jumped lines in file: 0
Parsed lines in file: 52469
Found 0 dropped records,
Found 2030 corrupted records,
Found 0 old records,
Found 50439 new qualified records.


And it works: see an example here http://stats.ecusb.net/

I had some trouble with the redirect script so went with the following instead:


<?php
$redirect = "http://".$_SERVER['HTTP_HOST']."/awstats/awstats.pl?config=".substr($_SERVER['HTTP_HOST'], (strpos($_SERVER['HTTP_HOST'], '.')+1));
header("HTTP/1.1 301 Moved Permanently");
header("Location:".$redirect);
?>


- Section 13 of AWS has a minor typo in the url httdocs instead of httpdocs

Cheers
Charles

aftdesign
11-06-2005, 12:33 AM
MindBlender: I followed your instructions to the letter and it works perfectly. Thank you very much. I really appreciate it!



-Andrew

nullensc
11-09-2005, 05:52 AM
I noticed that 'Include /home/httpd/vhosts/stats/conf/httpd.include'

drops out of etc/httpd/conf/http.include when I add a new domain to the server and restart Apache.

I guess that's because the 'domain' stats isn't set up within Plesk but am not sure how to resolve this permanently.

Any ideas?

Cheers
Charles

mindblender
11-13-2005, 02:17 PM
Glad I could help :)

I had forgotten I wrote that. hehe

Sorry for any typos.

snowboarder04
11-14-2005, 01:40 PM
<VirtualHost \
11.22.33.44:80 \
11.22.34.45:80 \
>


in step 5, i presume these IP addresses need to be changed?

mindblender
11-14-2005, 03:59 PM
<VirtualHost \
11.22.33.44:80 \
11.22.34.45:80 \
>


in step 5, i presume these IP addresses need to be changed?

Yes, you need to change the sample IPs with your actual IPs.

Mario
11-21-2005, 06:23 PM
I have Urchin on another machine (not with 1and1) and it's a great tool for stats :smile:

aftdesign
11-21-2005, 09:06 PM
I noticed that 'Include /home/httpd/vhosts/stats/conf/httpd.include'

drops out of etc/httpd/conf/http.include when I add a new domain to the server and restart Apache.

I guess that's because the 'domain' stats isn't set up within Plesk but am not sure how to resolve this permanently.

Any ideas?

Cheers
Charles


I am having that exact same problem also.

Any ideas as to what I can do so that I don't have to keep updating the main httpd.include?

Thanks.


Andrew

mindblender
11-22-2005, 11:22 AM
I noticed that 'Include /home/httpd/vhosts/stats/conf/httpd.include'

drops out of etc/httpd/conf/http.include when I add a new domain to the server and restart Apache.

I guess that's because the 'domain' stats isn't set up within Plesk but am not sure how to resolve this permanently.

Any ideas?

Cheers
Charles

I am aware of this issue and haven't had the time to really look into a fix. The problem is that Plesk recreates the httpd.include file when the services get restarted, either manually or automatically.

I'd like to find out where Plesk is getting the core httpd.include from and see if I can append the "Include ..." statement there so it gets re-added each time or maybe there is a way to setup the global domain up inside Plesk. Not sure. The other option is to maybe write a shell script that will run each day shortyly after Plesk does its thing and see if the Include statement is there. If it isn't then add it automatically.

The first solution would be the best but not sure when I'll have time to look into it. :(

As far as Urchin, I was reading about that the other day. Didn't Google buy them out? Looks like urchin gives yo more statistics on visitor models and how they move about your site. Its on my list of things to look into and possibly add to the server for clients, but unlike awstats, you have to include a javascript file in order for it to work. Awstats works off the raw web server files.

nullensc
11-22-2005, 05:31 PM
Its on my list of things to look into

No rush as they're not accepting new clients - and it is indeed part of Google now. The Urchin site redirects to Google Analytics but there's this message:

"Google Analytics has experienced extremely strong demand, and as a result, we have temporarily limited the number of new signups as we increase capacity. In the meantime, please submit your name and email address and we will notify you as soon as we are ready to add new accounts."

Looking at the screenshots it seems you'll need another lifetime to go through the various reports they offer. :cool:

mindblender
11-22-2005, 06:51 PM
Looking at the screenshots it seems you'll need another lifetime to go through the various reports they offer.

hehe yep. I'm currently working on a project plan for implementing WebSideStory (hitbox) at my comapny and it looks similar to urchin. More reports than you could ever want. But thats what the executives like to see :)

Mario
11-22-2005, 07:32 PM
As far as Urchin, I was reading about that the other day. Didn't Google buy them out? Looks like urchin gives yo more statistics on visitor models and how they move about your site. Its on my list of things to look into and possibly add to the server for clients, but unlike awstats, you have to include a javascript file in order for it to work. Awstats works off the raw web server files.

The Urchin version I have on my other box is a server script so there is no javascript to install on all my sites. But since Google bought ět, it's different and hope the server version will be available too. It's a very nice tool

mindblender
11-23-2005, 12:36 AM
I noticed that 'Include /home/httpd/vhosts/stats/conf/httpd.include'

drops out of etc/httpd/conf/http.include when I add a new domain to the server and restart Apache.

I guess that's because the 'domain' stats isn't set up within Plesk but am not sure how to resolve this permanently.

Instead of adding the line:
Include /home/httpd/vhosts/stats/conf/httpd.include in the httpd.include file, I put it in the httpd.conf file since it doesn't appear that the httpd.conf file gets rewritten like the httpd.include files do.

I'll post back if that doesn't work, but so far it seems to be.

nullensc
12-04-2005, 07:12 PM
Thanks MB, the change to httpd.conf works fine - just added a domain and restarted Apache and stats still working ok. Make sense when you think about it.

Cheers
Charles

AntiochWebHost
02-04-2006, 05:44 PM
A additions from my installation of aw-stats...

An answer to the 'where to place the httpd.include' file --

Place the file in:

/etc/httpd/conf.d/

Rename to:

awstats.conf

PLESK will never overwrite files in this directory and will automatically include any httpd directives in here.

Alternate to Changing your PLESK DNS Configuration for EVERY Domain
This method allows www.everydomainonyourserver.com/stats/ to display AW-Stats

There is an easier way to setup aw-stats to work GLOBALLY for EVERY domain. If you would like a subdomain, follow the original manual instructions - if a simple directory alias is fine for you, read on!

pico /etc/httpd/conf.d/awstats.conf


Alias /stats "/home/httpd/vhosts/stats/httpdocs/"
Alias /awstatsclasses "/home/httpd/vhosts/stats/httpdocs/classes/"
Alias /awstatscss "/home/httpd/vhosts/stats/httpdocs/css/"
Alias /awstatsicons "/home/httpd/vhosts/stats/httpdocs/icon/"
ScriptAlias /awstats/ "/home/httpd/vhosts/stats/httpdocs/cgi-bin/"

<Directory "/home/httpd/vhosts/stats/httpdocs/">
Options None
AllowOverride None
Order allow,deny
Allow from all
php_admin_flag engine on
php_admin_value include_path "."
</Directory>


apachectl restart

Remember ... you will still have to setup each domain with an awstats config file in /etc/awstats

Premature end of script headers: awstats.pl

Depending on how you uploaded the scripts and how your system is setup, you may get this error. Make sure that the ownerships are correct.

in /home/httpd/vhosts/stats/

chown -R root:root *

Adding to CronTab

You can actually do this in PLESK. Click Server > CronTab.

I suggest placing awstats to occur BEFORE PLESK processes log files.

/home/httpd/vhosts/stats/tools/awstats_updateall.pl now

Your stats may be a day behind webalizer - but this way, you'll process all of your stats before PLESK archives them.

Creating a SH Script

I created a script that generates the /etc/awstats/* files. It makes much more sense than doing it manually.

So ...

pico /root/makeawstats.sh

#!/bin/bash

echo "
LogFile=\"/home/httpd/vhosts/$1/statistics/logs/access_log\"
LogType=W
LogFormat=1
LogSeparator=\" \"
SiteDomain=\"$1\"
HostAliases=\"$1 www.$1\"
DNSLookup=2
DirData=\"/var/lib/awstats/$1\"
DirCgi=\"/cgi-bin\"
DirIcons=\"/awstatsicons\"
AllowToUpdateStatsFromBrowser=0
AllowFullYearView=2
EnableLockForUpdate=0
DNSStaticCacheFile=\"dnscache.txt\"
DNSLastUpdateCacheFile=\"dnscachelastupdate.txt\"
SkipDNSLookupFor=\"\"
AllowAccessFromWebToAuthenticatedUsersOnly=0
AllowAccessFromWebToFollowingAuthenticatedUsers=\"\"
AllowAccessFromWebToFollowingIPAddresses=\"\"
CreateDirDataIfNotExists=1
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=\"en\"
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=\"\"
color_Background=\"FFFFFF\" # Background color for main page (Default = \"FFFFFF\")
color_TableBGTitle=\"CCCCDD\" # Background color for table title (Default = \"CCCCDD\")
color_TableTitle=\"000000\" # Table title font color (Default = \"000000\")
color_TableBG=\"CCCCDD\" # Background color for table (Default = \"CCCCDD\")
color_TableRowTitle=\"FFFFFF\" # Table row title font color (Default = \"FFFFFF\")
color_TableBGRowTitle=\"ECECEC\" # Background color for row title (Default = \"ECECEC\")
color_TableBorder=\"ECECEC\" # Table border color (Default = \"ECECEC\")
color_text=\"000000\" # Color of text (Default = \"000000\")
color_textpercent=\"606060\" # Color of text for percent values (Default = \"606060\")
color_titletext=\"000000\" # Color of text title within colored Title Rows (Default = \"000000\")
color_weekend=\"EAEAEA\" # Color for week-end days (Default = \"EAEAEA\")
color_link=\"0011BB\" # Color of HTML links (Default = \"0011BB\")
color_hover=\"605040\" # Color of HTML on-mouseover links (Default = \"605040\")
color_u=\"FFAA66\" # Background color for number of unique visitors (Default = \"FFAA66\")
color_v=\"F4F090\" # Background color for number of visites (Default = \"F4F090\")
color_p=\"4477DD\" # Background color for number of pages (Default = \"4477DD\")
color_h=\"66DDEE\" # Background color for number of hits (Default = \"66DDEE\")
color_k=\"2EA495\" # Background color for number of bytes (Default = \"2EA495\")
color_s=\"8888DD\" # Background color for number of search (Default = \"8888DD\")
color_e=\"CEC2E8\" # Background color for number of entry pages (Default = \"CEC2E8\")
color_x=\"C1B2E2\" # Background color for number of exit pages (Default = \"C1B2E2\")
ExtraTrackedRowsLimit=500
" > /etc/awstats/awstats.$1.conf

perl /home/httpd/vhosts/stats/httpdocs/cgi-bin/awstats.pl -config=$1 -update


And make sure to chmod +x makeawstats.conf

Then you can simply type:

/root/makeawstats yourdomain.com

And you'll instantly add a domain to awstats as well as generating the first reports.

Importing All Existing Domains (Really Fast)

You're going to want to add of all your existing domains to awstats...

So, let's be stupid b/c this is faster for me than writing a script with a for loop...

cd /home/httpd/vhosts
ls --width=1
[Copy and Paste to EditPad / Notepad, or whatever]

Use search and replace, replace all linebreaks with:
"/root/makeawstats "

Copy and paste to your shell.
Hit Enter.

^ That's the lazy man's method. Anyone care to submit a script for doing this -- or better yet, a way to have this happen whenever a new domain is added to PLESK?



--

This is an excellent tutorial, may I request that this thread be consolodated and the original how-to be rewritten as a sticky?