AWStats on DirectAdmin

hostpc.com

Verified User
Joined
Aug 2, 2003
Messages
1,178
Location
Schenectady, NY
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
 
ive already created a script that needs next to no config, and its in this forum somewhere. It manages stats for all domains on the server...
 
Hi guys - I'm sorry if it's a repost, and I certainely didnt mean to "step on your toes" - but the last post said:

im trying to get time to finish this script, so that everything works 100%

And this is instructions for a single user install, rather than a server wide install - which I still haven't been able to do following your instructions in that thread, due to errors.

If the mods wanna remove this thread, thats fine - as I said - didn't mean to step on your toes - just another way to do it, site by site, rather than server wide. Just trying to help where I can.

Joe
 
Thanks Mark - next you're gonna tell me someone really HAS had time to work on a backup script... then I'll really feel foolish :)

LOL - Happy Holidays bud.
 
Well, let me paint a picture for you:

I recently started @ phriendly, i get up at 6am, and get home from work at between 6 and 11pm. I walk about 4km's to work (and have a bus trip in between) and the same distance back. Im used to getting up at 11pm and going to bed at 12-1pm, so im pretty outta whack right now and feeling a bit tired from the exersise (used to walking about 2km a week)
 
Thank you

Many thanks to Joe and Eugene for this helpful guide. Worked great for me.
 
wow, it's been a while.. you'd think awstats would be here by now :) Thanks for the directions, will probably try it out later.
 
Back
Top