Install awstats on gentoo

Awstats is the best web log analyzer that I know of, at least for low traffic servers. I don’t have experience with in high traffic situations. I used to have awstats installed manually, but now gentoo has an ebuild for it. I tried
# emerge awstatswhich is sufficient for most apps in gentoo, including webapps. Squirrelmail and gallery both installed fine this way. However, the awstats ebuild tells us that we have to use webapp-config to complete the install of awstats. They do not give a suggested command line. Long story short, this is how I managed to install awstats to my host (localhost in this case)
# emerge awstats- Create a directory called “awstats” in your root web directory.
#webapp-config -I -h localhost -d /awstats/ awstats 6.3-r2Change version number as necessary.- Take the output of the above command and paste into the /etc/apache2/conf/commonapache2.conf file
# /etc/init.d/apache2 restart# cd /etc/awstats/- If there isn’t already a config file, copy awstats.model.conf to awstats.yourdomain.conf
- Edit awstats.yourdomain.conf. It is pretty easy just reading the comments.
OK it is installed. Now update the stats:
#/usr/share/webapps/awstats/6.3-r2/hostroot/cgi-bin/awstats.pl -config=yourdomain.com -update
I put this in my cronfile so that it updates every night:
30 02 * * * /usr/share/webapps/awstats/6.3-r2/hostroot/cgi-bin/awstats.pl -config=aliandcedar.com -update >> /var/log/awstats/awstats.log 2>&1
That worked for me.
April 2nd, 2005 at 9:27 am
Thx for the help, everything worked, but what now? Everything is installed but how do you run it? I have only folders in my /localhost/awstats folder, I don’t have an awstats.pl file…
Greets
April 2nd, 2005 at 9:55 am
If you have updated your stats with the command I gave, then simply point your browser to
http://yourdomain/awstats/awstats.pl
and you should see your stats. Don’t worry that you have a /localhost/awstats folder without the awstats.pl file in there. That is handled as an alias by that stuff you pasted into your apache config file.
If things are not working, my first guess is that your apache config file is not set up correctly.
April 2nd, 2005 at 10:06 am
Yes, I found I out already, now it works, I can see my stats, other people too, just one problem… It is al zero’s …. It doesn’t update, so I think something went wrong..
PS: Is it normal that it names “awstats.localhost.localdomain.conf” ? Because only that way works, when I give my domain… He sais that he can’t find “awstats.localhost.localdomain.conf”.
April 2nd, 2005 at 1:34 pm
A few suggestions:
1) make sure that your website domain matches the name of your config file. For instance my domain aliandcedar.com has a config file named “awstats.aliandcedar.com.conf”. Then point your browser to that same domain name. If I point to “localhost” rather than that domain it won’t work.
2) carefully edit your config file. You might check over it again. Then re-run the update command
#/usr/share/webapps/awstats/6.3-r2/hostroot/cgi-bin/awstats.pl -config=yourdomain.com -updateMake sure you use the same domain name for this command too. Also pay attention to the console output as it updates, it might give you hints as to why it isn’t working.3) Finally, have you set your apache config file to use the “combined” log format?
good luck,
cedar
April 3rd, 2005 at 8:31 am
great tutorial. all worked fine.
April 5th, 2005 at 9:22 am
a hint
#webapp-config -I -h localhost -d /awstats/ awstats 6.3-r2 >> /etc/apache2/conf/commonapache2.conf
no nasty copy and paste
April 6th, 2005 at 2:00 am
Thx Flow, will try that. The only problem is:
There was a very big security bug in the 6.3 version, many people were hacked and got worms on there systems. But that security bug was fixed in the new 6.4 version, so I emerged the 6.4 version, but when I use webapp-config, he sais that I need to emerge awstats 6.4 first, but it is already emerged..
April 6th, 2005 at 7:33 am
As far as I understand, the current stable version, 6.3-r2, is not vulerable. I refer you to bug 83657
Do you own checking though.
April 14th, 2005 at 7:31 am
Hey,
I emerged the new awstats 6.4 version and did this:
#webapp-config -I -h localhost -d /awstats/ awstats 6.4
Then I putted this:
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthType Basic
AuthName “AWStats authenticated zone”
AuthUserFile /etc/awstats/.htpasswd
Require valid-user
in the /etc/apache2/conf/commonapache2.conf file.
Then I’ve did the rest of the manual, created 2 files in the awstats folder:
awstats.gentoo.serveftp.org.conf
awstats.localhost.localdomain.conf
Now when I surf to http://192.168.1.4/cgi-bin/awstats.pl or on the server http://localhost/cgi-bin/awstats.pl I see that it works, but I have always 0 users…
Greets
April 14th, 2005 at 9:19 am
Did you try:
#/usr/share/webapps/awstats/6.4/hostroot/cgi-bin/awstats.pl -config=localhost.localdomain -update
as root?
Remember to change your version number and domain there.
Then try a couple of things:
1) instead of visiting http://localhost/cgi-bin/awstats.pl
try
http://localhost/cgi-bin/awstats.pl?config=localhost.localdomain
and
http://localhost/awstats/awstats.pl?config=localhost.localdomain
good luck
April 14th, 2005 at 11:20 am
Hey,
I did the update as root, but still it doesn’t work, also not with the ?config=localhost.localdomain after it.
/awstats/awstats.pl doesn’t exists, only cgi-bin/awstats.pl
I think I made some mistakes at the apache2.conf file and the other .conf file, but I don’t know what…
Greets
May 28th, 2005 at 11:59 am
I’ve searched the web for simple instructions on how to install AWStats to my hosting account. This is the best I’ve found so far, but it’s still greek to me. I’m more of a visual learner. Could someone please make a video tutorial for technical dummies like me?
I’d be willing to pay for some simple instructions.
May 28th, 2005 at 7:12 pm
These instructions are specific to a particular distribution of Linux, in this case Gentoo linux. These instructions will not work for you if you are trying to install to a non-gentoo system. Mel, I’m afraid I can’t make instructions to help you, particulary since the details of the system you are trying to install are unknown. My advice would be to find a local “geek” and hire him/her to help you directly.
May 29th, 2005 at 4:00 am
Well, what do you need to know in order to help me?
Here’s a list of information about the hosting account I use.
General server information:
* Operating system - Linux
* Kernel version - 2.4.22-1.2199.nptlsmp
* Machine Type - i686
* Apache version - 1.3.33 (Unix)
* PERL version - 5.8.6
* Path to PERL - /usr/bin/perl
* Path to sendmail - /usr/sbin/sendmail
* PHP version - 4.3.10
* MySQL version - 4.0.22-standard
* cPanel Build - 10.2.0-RELEASE 82
* Theme - cPanel X v2.5.0
I’m trying to install AWStats 6.4 to my server. I hope this helps clarify the details.
May 29th, 2005 at 9:09 am
Mel, I’m sorry if I gave the impression that I’m willing to work to resolve your issue. I was mostly trying to point out that my tutorial would not be useful for you unless you are trying to install awstats on gentoo linux. My advice would be to look at these:
http://awstats.sourceforge.net/docs/index.html
http://awstats.sourceforge.net/docs/awstats_faq.html
http://sourceforge.net/forum/forum.php?forum_id=43428
confirm with your isp that they allow perl, cgi and access to the web logs
and finally, hire a local geek to help you directly if you still can’t get it to work.
best of luck,
Cedar
October 16th, 2005 at 6:23 pm
your how-to worked almost like a charm. Charmy enough that this was exactly what i needed to get 95% of the way to awstat workingness. I attribute to other 5% to subtle version differences and structuring etc. thanks !
July 30th, 2006 at 12:53 pm
The simplest way to determine errors when you’re faced with a bunch of zero’s in awstats.pl is to enable the “AllowToUpdateStatsFromBrowser” in your domain’s conf file. Then when you refresh the awstats page, a link “Update now” will apear. Click on the link and wait for it to tell you your problem.
I hope this helps.
- Caleb