View Full Version : User installed AWStats for DirectAdmin
eugene
12-06-2003, 02:30 PM
<s>Since Joe is planning to rollout AWStats serverwide,</s> 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. (http://prdownloads.sourceforge.net/awstats/awstats-59.zip)
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 (permission 0755).
On your local computer, copy the awstats.model.conf file to <s>awstats.yd.com.conf </s> awstats.conf . Open <s>awstats.yd.com.conf</s> awstats.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 <s>awstats.yd.com.conf </s> awstats.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. Enjoy your new AWStats install! B)
-Eugene
<center>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-</center>
As I have mentioned in other posts, it is a good idea to password-protect your stats page. This way no unauthorized person should have access to it and, it won't be index by google or some other search engine. Fortunately, this process is much easier under DirectAdmin than it was under ENSIM.
Log in to your Direct Admin Web Control Panel and use the FileManager to navigate to the cgi-bin directory. Click the Protect link in the Action column for the myAWStats directory. Enter a user name and passwords in the box, making sure to check the box next to "Use Password Protection on ...". Hit Save and you are done!
-Eugene
Please run these no more than ONCE a day, between 1am - 6am ET... hourly crons will be deleted without warning!
eugene
12-13-2003, 12:47 AM
As I have mentioned in other posts*, it is a good idea to password-protect your stats page. This way no unauthorized person should have access to it and, it won't be index by google or some other search engine. Fortunately, this process is much easier under DirectAdmin than it was under ENSIM.
Log in to your Direct Admin Web Control Panel and use the FileManager to navigate to the cgi-bin directory. Click the Protect link in the Action column for the myAWStats directory. Enter a user name and passwords in the box, making sure to check the box next to "Use Password Protection on ...". Hit Save and you are done!
-Eugene
*Securing AWSTATS (http://www.hostpc.com/forums/index.php?showtopic=215) and awstats question (http://www.hostpc.com/forums/index.php?showtopic=214&view=findpost&p=709)
I'm not having much luck with this. Going to danandsherree.com I can see that I have AWStats installed correctly, but it reports it was "Never Updated." I've set up the cron job; it creates an empty errors.txt file, but no logs. Any ideas?
eugene
12-16-2003, 10:02 PM
You may have to wait for the cron job to finish. For what time is it scheduled? Has that time come and gone?
If you want some personalized help right now, go to the HostPC chat room and look for me there.
IRC Live Chat: irc.hostpc.com #hostpc
OR http://www.hostpc.com/cgi-bin/irc.cgi
It's currently scheduled for 3:18am, daily, though I've tried several "run it in 1 minute" jobs to see if it was working and to help figure out what's wrong. So it certainly should be finished by now! :) Sorry I missed you on chat, but thanks for the offer of help!
Dan
eugene
12-17-2003, 10:48 AM
Danw-
I wrote you an email. We'll try and deal with this privately.
-Eugene
QuickGold
12-17-2003, 01:27 PM
I had a similiar problem and the way I fixed it was to go into the Awstats config and check on the option to have the update awtsats now option enabled. What it does is allow you to click a link at awstats.pl and it will update it then.
eugene
12-17-2003, 02:53 PM
You are referring to setting AllowToUpdateStatsFromBrowser=1 on line 227. I had not mentioned it in the above "main" post as zealous updaters have a great potential to flood the system with "update NOW" requests and suck up CPU time.
-Eugene
QuickGold
12-17-2003, 05:26 PM
Originally posted by eugene@Dec 17 2003, 01:53 PM
You are referring to setting AllowToUpdateStatsFromBrowser=1 on line 227. I had not mentioned it in the above "main" post as zealous updaters have a great potential to flood the system with "update NOW" requests and suck up CPU time.
-Eugene
You're right, but I understand what it does to the server so I only update two or 3 times a week.
thomas
12-26-2003, 12:54 PM
I tried the steps above and got the following error:
--------------------------
Error: Couldn't open config file "awstats.www.greeklandscapes.com.conf" nor "awstats.conf" after searching in path ",/etc/awstats,/etc/opt/awstats,/etc,/usr/local/etc/awstats": No such file or directory
Setup (Config file, web server or permissions) may be wrong.
See AWStats documentation in 'docs' directory for informations on how to setup awstats.
--------------------------
I did the installation twice from scratch and both times I got the same error.
Looking back at the directions I have one question: what does it mean "copy the awstats.model.conf file to awstats.yd.com.conf" ?
I took it to mean that I should be renaming the "awstats.model.conf" to "awstats.greeklandscapes.com.conf". I renamed it and modified it a specified.
According to the error I received the process is looking for "awstats.www.greeklandscapes.com.conf" (should I include the www? part on the file name?), in certain paths that I don't know how to modify.
Any help would be appreciated.
Thomas
Added: here is a copy of the config file: http://www.greeklandscapes.com/awstats.gre...scapes.com.conf (http://www.greeklandscapes.com/awstats.greeklandscapes.com.conf)
eugene
12-26-2003, 01:18 PM
Thomas-
Oh my. Thomas, you caught an error in my instructions. I never type www.mydomain.com, but rather only use the mydomain.com when accessing my site. Perhaps you should rename the file awstats.conf so that it will be accessible via www.mydomain.com and mydomain.com. On the other hand, if you always use the www prefix, just name your file awstats.www.greeklandscapes.com.conf.
-Eugene
I will make corrections to my first post.
thomas
12-26-2003, 01:31 PM
Hi Eugene,
funny thing is my site is accessible either way, but in the error message awstats is trying to access it strictly using www.mydomain.com although nowhere did I include the www part in the confing file or in the cron or in any file name.
I will give it one more shot
Thanks for your help
Thomas
thomas
12-26-2003, 02:06 PM
Hi Eugene,
this worked and I can see the awstats page now, however it just shows zero everywhere. It is as if it cannot read the log file.
I am going through my config file, but if you have any clues let me know.
Has it worked fine for you so far?
Thomas
eugene
12-26-2003, 02:10 PM
You will need to have the data updated. Since the config file name was changed, AWStats needs to be re-run.
If you have made the change of AllowToUpdateStatsFromBrowser=1 on line 227 of the config file, then just click the update button on the AWStats page. If not, set up a cron job to run and update.
-Eugene
thomas
12-26-2003, 02:17 PM
thanks for all your help once again eugene,
It all works fine now.
Regards,
Thomas
thomas
12-28-2003, 11:02 AM
Well, it almost works...
AWstats seems to work fine when I update it manually, but my cron job is having issues.
My cron job looks like this:
home/greeklands/domains/greeklandscapes.com/public_html/cgi-bin/myawstats/awstats.pl -config=greeklandscapes.com -update >/dev/null
It is set to fire at 4:24 every morning
The path looks fine , but he cron deamon keeps sending me this message via email every morning:
/bin/sh: line 1: home/greeklands/domains/greeklandscapes.com/public_html/cgi-bin/myawstats/awstats.pl: No such file or directory
Needless to say the cron job does not update awstats. I have looked the cron job over and over but I cannot find an error in the path (my site is accessible with or without www).
I would love some guidance with this one if anyone can see something that I have missed here.
Regards,
Thomas
thomas
12-28-2003, 11:18 AM
Ignore previous message, I solved the problem.
I used this:
public_html/cgi-bin/myawstats/awstats.pl -config=greeklandscapes.com -update >/dev/null
So eugene, you might want to update the original message.
Thomas
Guest
12-28-2003, 06:56 PM
I think you were missing the initial / so the path would be /home/greeklands/domains/greeklandscapes.com/public_html/cgi-bin/myawstats/awstats.pl
-Eugene
eugene
12-28-2003, 06:58 PM
Sorry, previous message was from me. (Different web browser.)
flyer
01-23-2004, 02:13 PM
Does anyone know what version of Perl we have (or how to look that up)?
There's a new stable version 6.0 of awstats that requires Perl 5.00503 and I'd like to know if our version fits that before I spend an hour per domain installing stats.
And just to clarify, does "upload the contents of the wwwroot\icon, wwwroot\js, and wwwroot\css directories " mean to include all the subdirectories of those and their contents? icon has a whole bunch of them.
Should all those .png files be uploaded as binary or ascii?
Thanks.
eugene
01-23-2004, 03:58 PM
Perl 5.8.0
For future reference, the revision, version, and subversion of the Perl interpreter are represented as a string composed of characters with those ordinals. So, to display the current version of perl, use should convert $^V into its string representation using sprintf()'s "%vd" conversion:
printf "Current Perl Version is %vd\n", $^V;
Originally posted by flyer
And just to clarify, does "upload the contents of the wwwroot\icon, wwwroot\js, and wwwroot\css directories " mean to include all the subdirectories of those and their contents? icon has a whole bunch of them.
Should all those .png files be uploaded as binary or ascii?
Yes, upload all subdirectories too.
.png files should be binary. In fact, pretty much everything except .html, .php, .pl, .pm, .txt, .asp, .jsp should be uploaded as binary.
-Eugene
eugene
01-23-2004, 04:06 PM
Originally posted by flyer@Jan 23 2004, 12:13 PM
Does anyone know what version of Perl we have (or how to look that up)?
There's a new stable version 6.0 of awstats that requires Perl 5.00503 and I'd like to know if our version fits that before I spend an hour per domain installing stats.
And just to clarify, does "upload the contents of the wwwroot\icon, wwwroot\js, and wwwroot\css directories " mean to include all the subdirectories of those and their contents? icon has a whole bunch of them.
Should all those .png files be uploaded as binary or ascii?
Thanks.
Sorry, I accidentally posted twice :blink:
-Eugene
flyer
01-23-2004, 05:23 PM
Thanks. I assume that command you listed is called from Perl itself, which people installing stats don't need to bother with.
eugene
01-23-2004, 08:25 PM
Originally posted by flyer@Jan 23 2004, 03:23 PM
Thanks. I assume that command you listed is called from Perl itself, which people installing stats don't need to bother with.
Yes, just create a file in the cgi-bin directory. (You can do this from within the DirectAdmin interface.)
Example displayversion.pl
#!/usr/bin/perl
print "content-type: text/html\n\n"; #necessary to set these headers
printf "Current Perl Version is %vd\n", $^V;
Set the permissions to 755.
Then access the file via http://yourdomain.com/cgi-bin/displayversion.pl.
-Eugene
hssoftware
02-14-2004, 06:12 AM
I've tried in vain to get awatsts to work having (hopefuly!) folowed the instrurcuions to the letter. Although the page loads I get a "never updatde" messae even thjugh I'm sure I set up the cron job right. In desperation I changed the config file as in above posts so that an update now button appears but all I get from that is an error message:
Error: Couldn't open server log file "/var/log/httpd/hsworlds.log" : No such file or directory
Help!!
hssoftware
02-14-2004, 06:22 AM
Originally posted by hssoftware@Feb 14 2004, 05:12 AM
I've tried in vain to get awstats to work having (hopefuly!) folowed the instructions to the letter. Although the page loads I get a "never updatde" message even though I'm sure I set up the cron job right. In desperation I changed the config file as in above posts so that an update now button appears but all I get from that is an error message:
Error: Couldn't open server log file "/var/log/httpd/hsworlds.log" : No such file or directory
Help!!
1 Apologies for spelling on post - I'm more accurate on my files - honest!
2 I'm running/trying to tun version 6.0 of awstats
hssoftware
02-14-2004, 07:27 AM
Problem solved - decided to use 5.9 instead - that seems to work OK!
QuickGold
02-26-2004, 12:06 PM
Has anyone else had a problem where once maybe every two or 3 months Awstats will update but it will just list there being 0 people having visited for that day?
thevillageinn
02-26-2004, 10:14 PM
were there actually 0 visitors on that day? like, for example, my cron job runs at 3 am so I rarely ever have any hits on that day...or were there hits and they disappeared from the count after it updated later on at some point?
QuickGold
02-27-2004, 12:25 AM
Originally posted by thevillageinn@Feb 26 2004, 09:14 PM
were there actually 0 visitors on that day? like, for example, my cron job runs at 3 am so I rarely ever have any hits on that day...or were there hits and they disappeared from the count after it updated later on at some point?
There most certainly was. My site averages around 400-500 visits per day(30000 hits per day) and I get one day where it's 0 across the board.
eugene
02-27-2004, 12:43 AM
This could easily happen in conjunction with a log rotate.
Guest
03-05-2004, 06:35 PM
Yes, my awstats return only one tenth of the daily traffic once per week. I suspected something about the logs being changed some way, but webalizer is not affected, so go figure. I never had "0" returns though. I have the cron job set at 4:06 am and I will change the time to 3:00 pm to see if it makes a difference.
Has anyone else had a problem where once maybe every two or 3 months Awstats will update but it will just list there being 0 people having visited for that day?
Thomas
thomas
03-09-2004, 09:50 PM
Update:
Changing the Cron job to take place at 2:56 instead of 4:06 made no difference. Sunday's Awstats recorded 140 visits - one twentieth of the actual visits for this day.
Not sure what is wrong.
Anyone see this afterwards?
Error: AWStats database directory defined in config file by 'DirData' parameter (/domains/domain.net/public_html/stats) does not exist or is not writable.
Setup ('awstats.conf' file, web server or permissions) may be wrong.
See AWStats documentation in 'docs' directory for informations on how to setup awstats.
stats is a subdomain and it is set to CHMOD 777. So it does exist and IS writeable.
I realize that my naming structure is a bit different, but I did follow all the steps, set the paths accordingly and this is what I get.
I should point out that this is an AWSTATS moved from an ENSIM setup, so I am trying to keep all my historical data etc.
Any help would be much appreciated.
*EDIT*
Fixed... slight error in dirpath
Can you have AWSTATS check two or more logs at once? I just noticed that DA keeps a seperate log for subdomains???? ACK!
I need it to check both!!
eugene
04-20-2004, 10:57 AM
Originally posted by Andrax@Apr 19 2004, 05:41 PM
Can you have AWSTATS check two or more logs at once? I just noticed that DA keeps a seperate log for subdomains???? ACK!
I need it to check both!!
I'm not sure about that, however, you might be able to use a Perl package I wrote a while ago that will make the multiple file issues adjusted transparently.
Fooled around with it last night and spoke to Nick about it.
Apparently, adding the subdomain log info on the line below the domain log file appears to be working...
ztohn
05-21-2004, 01:49 PM
I have two IPs hosting different sites under one apache.
have their differect config files
but when i do this
.../awstats.pl?config=ip1
and
.../awstats.pl?config=ip2
both show the same hits and other stats
both have different data dirs /var/lib/awstats/ip1, /var/lib/awstats/ip2
any idea whats wrong
and
Error: Couldn't open file "/var/lib/awstats/ip1/awstats052004.ip1.tmp.2403" for write: Permission denied
Setup ('/etc/awstats/awstats.ip1.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).
have set chmod 777 for both files but still facing this error
mharvey
12-02-2004, 11:43 AM
I was able to configure my own copy of AWStats and I have it working for my main domain. I would now like to get AWStats working for my subdomain. I have not been able to figure out what I should use for the LogFile path to use to pick up the subdomain web log. Has anyone done this? What would the path be? I know the a seperate log for the subdomain is out there somewhere as I can see it from DirectAdmin.
For the main domain I used:
LogFile="/var/log/httpd/domains/mydomain.com.log"
On my previous host the subdomain log was in a file subdomain.mydomain.com.log. When I tried using:
LogFile="/var/log/httpd/domains/subdomain.mydomain.com.log"
I received an error saying that file could not be opened or found.
Any ideas? Thanks!
EDIT
I found the answer to my problem. The logfile for a subdomain is named:
"/var/log/httpd/domains/mydomain.com.subdomain.log"
Once I used that in the AWStats.conf file all is well. I now have AWStats running for my main domain and each of my subdomains.
lnguyen
12-03-2004, 04:48 PM
is there any way to add subdomains to the awstats plugin that is used? Or do we have to use our own install to get that working?
Qacer
12-29-2004, 05:21 PM
Originally posted by mharvey@Dec 2 2004, 11:43 AM
EDIT
I found the answer to my problem. The logfile for a subdomain is named:
"/var/log/httpd/domains/mydomain.com.subdomain.log"
Once I used that in the AWStats.conf file all is well. I now have AWStats running for my main domain and each of my subdomains.
Quoted post
Can you elaborate on how you managed to do this exactly? I can't find the AWStats.conf file on my account. I would also like AWStats to keep track of logs from a subdomain.
Thanks!
mharvey
12-29-2004, 05:31 PM
Originally posted by Qacer@Dec 29 2004, 05:21 PM
Can you elaborate on how you managed to do this exactly? I can't find the AWStats.conf file on my account. I would also like AWStats to keep track of logs from a subdomain.
Thanks!
Quoted post
If you are using the server wide version of AwStats (that shows up in your DirectAdmin control panel) then you will not see and do not have access to the conf files that are used. It appears that you can only track your main domain with the server wide AwStats.
If you want to track your subdomains you have to make your own local installation of the AwStats script. Then you can create conf files for each subdomain that you want to track. The problem that I had was figuring out the path to the logfile for the subdomains.
If you have a personal installation of AwStats, it is CRITICAL that you update it to a version no older than 1/25/05. We've been alerted to a serious vulnerability as Joe posted in the thread below.
http://www.hostpc.com/forums/index.php?showtopic=1875
We will be seeking these installations out today and disabling them if they are not updated.
Originally posted by Jeff@Jan 26 2005, 11:01 AM
If you have a personal installation of AwStats, it is CRITICAL that you update it to a version no older than 1/25/05.
Quoted post
Unless I'm missing something 1/22/05 looks to be the latest?
There's another patch that will be released today.
thevillageinn
01-26-2005, 11:32 AM
I won't be able to patch my personal AWSTATS today - is something like password protecting it enough in the interim, or is there another way to easily de-activate it prior to patching?
Originally posted by thevillageinn@Jan 26 2005, 09:32 AM
I won't be able to patch my personal AWSTATS today - is something like password protecting it enough in the interim, or is there another way to easily de-activate it prior to patching?
Quoted post
Deactivate it by renaming awstats.pl to something else, like awstatspl.old.
Joe is requesting that these installs be disabled for security reasons.
http://www.hostpc.com/forums/index.php?showtopic=1909
FYI, from http://www.hostpc.com/forums/index.php?showtopic=1909&st=30#
Originally posted by Joe@Feb 13 2005, 08:08 PM
I've just updated all the servers with the most current release. I am however requesting (ie demanding) that there be NO client installled versions of AWStats at this time. It's too risky to have versions that are several lifetimes old on the servers - lest your site, or others, get defaced, or worse. At this time, please do NOT install your own version. If found, they will be disabled.
flyer
04-03-2005, 05:30 PM
Where is awstats on the control panel? I don't see it.
Originally posted by flyer@Apr 3 2005, 03:30 PM
Where is awstats on the control panel? I don't see it.
Quoted post
Due to many serious security issues with the script, AWstats has been disabled on all servers (http://www.hostpc.com/forums/index.php?showtopic=1909) until further notice.
Powered by vBulletin™ Version 4.0.3 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.