hostpc.com
Verified User
Credit to Eugene at HostPC Internet Services:
Since I'm pretty sure DA is planning to rollout AWStats serverwide, we should probably make sure that the local installs won't interfere with it. To this end I propose local AWStats installs be placed in special directories. For the purpose of this tutorial, the paths will be as follows:
http://yd.com/myAWStats/ and http://yd.com/cgi-bin/myAWStats/ .
In the following description, you must replace yd.com with your own domain name and username with your DirectAdmin login name. Also, I will use colors and bolds to highlight various words. Directory names will be displayed in blue for local local directories and red for server directories. Parameters that you must replace will be shown as boldface. Exact lines to change will be indicated in green. (If any of you are color blind, I will assume you already have your machine set up to modify these colors. If not, let me know and I will try and help.)
Let us begin. This text has been written using AWStats version 5.9 available from http://awstats.sourceforge.net.
Download and decompress the files. There will be 3 directories and 1 README.TXT file. You may safely ignore the tools and docs directories at this time. (The docs directory may come in handy for reading at a later time.)
Using either your DirectAdmin control panel (FileManager) or an FTP client (http://sourceforge.net/projects/filezilla/), create a directory named myAWStats in your html root directory. Then, upload the contents of the wwwroot\icon, wwwroot\js, and wwwroot\css directories on your HDD to this new myAWStats directory, thus creating myAWStats/icon, myAWStats/js, and myAWStats/css.
Create a myAWStats directory under the already existing cgi-bin directory in your html root directory. Copy the contents of wwwroot\cgi-bin to this newly created directory, thus creating cgi-bin/myAWStats with all the files and folders in wwwroot\cgi-bin. Make sure that the .pl files (perl scripts) (awredir.pl and awstats.pl) have their execute bits set.
On your local computer, copy the awstats.model.conf file to awstats.yd.com.conf . Open awstats.yd.com.conf in a text editor (http://www.ultraedit.com) and modify the following lines:
Line # 49: From LogFile="/var/log/apache/access.log" to LogFile="/var/log/httpd/domains/yd.com.log"
Line #142: From SiteDomain="" to SiteDomain="yd.com"
Line #156: From HostAliases="localhost 127.0.0.1 REGEX[^.*\.myserver\.com$]" to HostAliases="REGEX[^.*\.yd\.com$]" (Be sure to add the \ before the . in the tld (.com, .org, .net, .us, etc).)
Line #199: From DirCgi="/cgi-bin" to DirCgi="/cgi-bin/myAWStats"
Line #210: From DirIcons="/icon" to DirIcons="/myAWStats/icon"
Upload awstats.yd.com.conf to your cgi-bin/myAWStats directory.
The final step is to set up a cron job to run the log updates.
In the default Direct Admin Web Control Panel, the Cron Jobs setup is under Advanced Tools.
Think of a good time to have your job run. Please keep in mind that it will suck up server resources and thus slow down the server, your site(s) and those of the other clients.
Suppose you wished to run your updates at 3:07 a.m. every day of the week, and you would like the update comments/errors to be written into a file in your html root.
Minute 7
Hour 3
Day of Month *
Month *
Day of Week *
Command /home/username/domains/yd.com/public_html/cgi-bin/myAWStats/awstats.pl -config=yd.com -update >/home/username/domains/yd.com/public_html/myAWStats/errors.txt
If you don't care to see the errors, replace the >/home/username/domains/yd.com/public_html/myAWStats/errors.txt with >/dev/null
Everything should now be done.
-Eugene
Since I'm pretty sure DA is planning to rollout AWStats serverwide, we should probably make sure that the local installs won't interfere with it. To this end I propose local AWStats installs be placed in special directories. For the purpose of this tutorial, the paths will be as follows:
http://yd.com/myAWStats/ and http://yd.com/cgi-bin/myAWStats/ .
In the following description, you must replace yd.com with your own domain name and username with your DirectAdmin login name. Also, I will use colors and bolds to highlight various words. Directory names will be displayed in blue for local local directories and red for server directories. Parameters that you must replace will be shown as boldface. Exact lines to change will be indicated in green. (If any of you are color blind, I will assume you already have your machine set up to modify these colors. If not, let me know and I will try and help.)
Let us begin. This text has been written using AWStats version 5.9 available from http://awstats.sourceforge.net.
Download and decompress the files. There will be 3 directories and 1 README.TXT file. You may safely ignore the tools and docs directories at this time. (The docs directory may come in handy for reading at a later time.)
Using either your DirectAdmin control panel (FileManager) or an FTP client (http://sourceforge.net/projects/filezilla/), create a directory named myAWStats in your html root directory. Then, upload the contents of the wwwroot\icon, wwwroot\js, and wwwroot\css directories on your HDD to this new myAWStats directory, thus creating myAWStats/icon, myAWStats/js, and myAWStats/css.
Create a myAWStats directory under the already existing cgi-bin directory in your html root directory. Copy the contents of wwwroot\cgi-bin to this newly created directory, thus creating cgi-bin/myAWStats with all the files and folders in wwwroot\cgi-bin. Make sure that the .pl files (perl scripts) (awredir.pl and awstats.pl) have their execute bits set.
On your local computer, copy the awstats.model.conf file to awstats.yd.com.conf . Open awstats.yd.com.conf in a text editor (http://www.ultraedit.com) and modify the following lines:
Line # 49: From LogFile="/var/log/apache/access.log" to LogFile="/var/log/httpd/domains/yd.com.log"
Line #142: From SiteDomain="" to SiteDomain="yd.com"
Line #156: From HostAliases="localhost 127.0.0.1 REGEX[^.*\.myserver\.com$]" to HostAliases="REGEX[^.*\.yd\.com$]" (Be sure to add the \ before the . in the tld (.com, .org, .net, .us, etc).)
Line #199: From DirCgi="/cgi-bin" to DirCgi="/cgi-bin/myAWStats"
Line #210: From DirIcons="/icon" to DirIcons="/myAWStats/icon"
Upload awstats.yd.com.conf to your cgi-bin/myAWStats directory.
The final step is to set up a cron job to run the log updates.
In the default Direct Admin Web Control Panel, the Cron Jobs setup is under Advanced Tools.
Think of a good time to have your job run. Please keep in mind that it will suck up server resources and thus slow down the server, your site(s) and those of the other clients.
Suppose you wished to run your updates at 3:07 a.m. every day of the week, and you would like the update comments/errors to be written into a file in your html root.
Minute 7
Hour 3
Day of Month *
Month *
Day of Week *
Command /home/username/domains/yd.com/public_html/cgi-bin/myAWStats/awstats.pl -config=yd.com -update >/home/username/domains/yd.com/public_html/myAWStats/errors.txt
If you don't care to see the errors, replace the >/home/username/domains/yd.com/public_html/myAWStats/errors.txt with >/dev/null
Everything should now be done.
-Eugene