Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mini-Howto webapp-config install of awstats
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
jmckay123456789
n00b
n00b


Joined: 16 Aug 2003
Posts: 46

PostPosted: Tue Mar 15, 2005 6:56 pm    Post subject: Mini-Howto webapp-config install of awstats Reply with quote

The only other Howto that I could find specifically didn't use webapp-config. Since webapp-config is the way that the Gentoo developers seem to endorse, I thought I would try it that way. So here you go. Let me know if you have problems.


Awstats is the best web log analyzer that I know of. I used to have awstats installed manually, but now gentoo has an ebuild for it. I tried
Code:
# emerge awstats

which 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. My website is installed in localhost, but if yours is somewhere else, you will have to modify the command line.



Create a directory called "awstats" in your root web directory. Then:
Code:
# webapp-config -I -h localhost -d /awstats/ awstats 6.3-r2
Change version number and hostname as necessary.

Take the output of the above command and paste into the /etc/apache2/conf/commonapache2.conf file, then:
Code:
# /etc/init.d/apache2 restart


If you don't already have a config file setup, copy /etc/awstats/awstats.model.conf to /etc/awstats/awstats.yourdomain.conf

Edit awstats.yourdomain.conf. It is pretty easy just by reading the comments.

OK it is installed. Now update the stats:
Code:
# /usr/share/webapps/awstats/6.3-r2/hostroot/cgi-bin/awstats.pl -config=yourdomain.com -update

again, adjust version name and domain name as needed.

Now look at your stats by using your browser to look at:
http://yourwebsite/awstats/awstats.pl

That worked for me.
Back to top
View user's profile Send private message
MaxDamage
l33t
l33t


Joined: 03 Jan 2004
Posts: 650
Location: Oviedo, Spain

PostPosted: Sat Apr 23, 2005 10:58 pm    Post subject: Reply with quote

Hey it worked great! It was much easier than the manual install, and automates upgrades. I don't know if it's necessary but there is a way to force files to be created belonging to user apache an group apache:

Code:
sudo webapp-config -I -h localhost -u apache -g apache -d awstats awstats 6.4


Thanx again!
_________________
La PDA de tungsteno
Back to top
View user's profile Send private message
jmckay123456789
n00b
n00b


Joined: 16 Aug 2003
Posts: 46

PostPosted: Wed May 04, 2005 5:40 pm    Post subject: Reply with quote

Thanks, I'm glad it was helpful. I haven't tried your tip, but I will next time I update.
Back to top
View user's profile Send private message
jbNet
n00b
n00b


Joined: 07 Oct 2003
Posts: 39
Location: Oregon, USA

PostPosted: Wed May 04, 2005 5:52 pm    Post subject: Reply with quote

also don't forget about the >> operator

so you could do..

Code:

# webapp-config -I -h localhost -d /awstats/ awstats 6.3-r2 >> /etc/apache2/conf/commonapache2.conf


just be sure you have two '>'s otherwise you'll overwrite stuff
_________________
~Jake B
Back to top
View user's profile Send private message
jmckay123456789
n00b
n00b


Joined: 16 Aug 2003
Posts: 46

PostPosted: Wed May 04, 2005 9:30 pm    Post subject: Reply with quote

bjNet, though your tip is perfecty correct, I personally prefer to see the output myself just to check it for sanity. Also for upgrades you will be wanting to remove the previous stuff so you will be mucking around in that config file anyway.

best,
Cedar
Back to top
View user's profile Send private message
BlinkEye
Veteran
Veteran


Joined: 21 Oct 2003
Posts: 1043
Location: Gentoo Forums

PostPosted: Fri Jun 03, 2005 4:25 pm    Post subject: Reply with quote

thanks for this easy howto. i got awstats quickly up and running. i just read http://awstats.sourceforge.net/docs/awstats_faq.html#MAIL to create a statistic for my mail.log. this worked out well (i see the created *.txt files in /var/www/localhost/htdocs/awstats) but how do i convince awstat to actually display these stats? i tried to remove my apache txt files within that directory but still no mail stats ...
_________________
Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick
Back to top
View user's profile Send private message
NightDragon
Veteran
Veteran


Joined: 21 Aug 2004
Posts: 1143
Location: Vienna (Austria)

PostPosted: Tue Nov 01, 2005 9:34 am    Post subject: Reply with quote

Hi!

My basic directory for Websites is /server/www (the file /var/www points as symlink to /server/www).
Inside that dir, i have some domains hosted (controlled by vhost-settings in /etc/apache2/httpd.conf).

e. g.
shadowghost.net
thesilence.nightdragon.at
...

Now... i tried to do this howto, but i can't get awstat running (correctly or overall).

Does anybody know, what i've to do?
_________________
You are the problem too all my solutions ;)
Back to top
View user's profile Send private message
mingotta
n00b
n00b


Joined: 11 Oct 2003
Posts: 52
Location: Roma, Italy

PostPosted: Sun Jan 29, 2006 11:00 pm    Post subject: Reply with quote

hello
Your howto looks great, but I'm stuck.

I get an error when I launch
/usr/share/webapps/awstats/6.5/hostroot/cgi-bin/awstats.pl -config=localhost -update

This is the error:
Code:
 # /usr/share/webapps/awstats/6.5/hostroot/cgi-bin/awstats.pl -config=localhost -update
Update for config "/etc/awstats/awstats.localhost.conf"
With data in log file "/var/log/apache2/access_log"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
AWStats did not find any valid log lines that match your LogFormat parameter, in the 50th first non commented lines read of your log.
Your log file /var/log/apache2/access_log must have a bad format or LogFormat parameter setup does not match this format.
Your AWStats LogFormat parameter is:
1
This means each line in your web server log file need to have "combined log format" like this:
111.22.33.44 - - [10/Jan/2001:02:14:14 +0200] "GET / HTTP/1.1" 200 1234 "http://www.fromserver.com/from.htm" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"
And this is an example of records AWStats found in your log file (the record number 50 in your log):
10.0.0.85 - - [29/Jan/2006:22:26:30 +0100] "GET /wordpress/wp-images/wp-small.png HTTP/1.1" 304 -
Setup ('/etc/awstats/awstats.localhost.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).


I suppose it's about the apache logfile, which must be "combined".

So I did a grep of the apache config file and this is what I got:
Code:
 # grep -i -R "logformat" ../apache2/
../apache2/httpd.conf:LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
../apache2/httpd.conf:LogFormat "%h %l %u %t \"%r\" %>s %b" common
../apache2/httpd.conf:LogFormat "%{Referer}i -> %U" referer
../apache2/httpd.conf:LogFormat "%{User-agent}i" agent
../apache2/httpd.conf:LogFormat "%v %h %l %u %t \"%r\" %>s %b %T" script
../apache2/httpd.conf:LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" VLOG=%{VLOG}e" vhost
../apache2/httpd.conf:#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

which, unfortunately, doesn't lead me much farther... anybody can suggest where to go from here?
Thanks!

P.s.: I noticed I don't have the file commonapache.conf!!
Back to top
View user's profile Send private message
mellow
n00b
n00b


Joined: 21 Jan 2004
Posts: 6

PostPosted: Wed Feb 01, 2006 1:39 am    Post subject: Reply with quote

mingotta wrote:
hello
Your howto looks great, but I'm stuck.

I get an error when I launch
/usr/share/webapps/awstats/6.5/hostroot/cgi-bin/awstats.pl -config=localhost -update

P.s.: I noticed I don't have the file commonapache.conf!!


I had the same problem, but i solved it by adding

------
Alias /awstats/classes "/usr/share/webapps/awstats/6.5/htdocs/classes/"
Alias /awstats/css "/usr/share/webapps/awstats/6.5/htdocs/css/"
Alias /awstats/icons "/usr/share/webapps/awstats/6.5/htdocs/icon/"
ScriptAlias /awstats/ "/usr/share/webapps/awstats/6.5/hostroot/cgi-bin/"
ScriptAlias /awstats "/usr/share/webapps/awstats/6.5/hostroot/cgi-bin/awstats.p$
ScriptAlias /awstats.pl "/usr/share/webapps/awstats/6.5/hostroot/cgi-bin/awstat$

<Directory "/usr/share/webapps/awstats/6.5/htdocs">
Options None
AllowOverride None
<IfModule mod_access.c>
Order allow,deny
Allow from all
</IfModule>
</Directory>
-------
at the end at "/etc/apache2/httpd.conf" you also need to change your a line

CustomLog logs/access_log common

to

CustomLog logs/access_log combined
.

Just to enable the info the awstats need to generate the report..

Hope the info it's of any use to anyone..

Pether

ps. have a good toke !
Back to top
View user's profile Send private message
vf1sveritech
Tux's lil' helper
Tux's lil' helper


Joined: 14 May 2004
Posts: 90

PostPosted: Tue Feb 07, 2006 6:04 am    Post subject: Reply with quote

how the hell do you remove a config file from the config? say you added a awstats.myftp.conf and you don't need it anymore, so you delete it, but then when you go to awstats.pl it says it can't find it, how do you get rid of it from awstats?
_________________
VT
Back to top
View user's profile Send private message
electroarts
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jan 2004
Posts: 86

PostPosted: Tue Feb 28, 2006 6:51 am    Post subject: Reply with quote

Great tutorial, helped getting it up and running so far. I was able to get awstats to update, as follows:

Code:
# /usr/share/webapps/awstats/6.5/hostroot/cgi-bin/awstats.pl -config=soundtransit.nl -update
Update for config "/etc/awstats/awstats.soundtransit.nl.conf"
With data in log file "/var/log/apache/access_log"...
Warning: HostAliases parameter is not defined, awstats choose "soundtransit.nl localhost 127.0.0.1".
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: 3845291
 Found 73 dropped records,
 Found 226 corrupted records,
 Found 0 old records,
 Found 3844992 new qualified records.


But I get a "404 Not Found" at http://soundtransit.nl/awstats/awstats.pl

I did a "chgrp -R apache" and "chown -R apache" in /var/www/soundtransit.nl/cgi-bin, where the awstats.pl script is located, and even restarted Apache a few different times, but still no luck. What am I missing? Something added to the /etc/apache/conf/apache.conf or the Vhosts file so that Apache can find it??
Back to top
View user's profile Send private message
electroarts
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jan 2004
Posts: 86

PostPosted: Tue Feb 28, 2006 6:59 am    Post subject: Reply with quote

OK, added the "Alias" lines a couple posts up, and now I get a "Forbidden: You don't have permission to access /awstats/awstats.pl on this server" error. So I know they are there. What permissions do you recommend changing now to get this acessible?

TIA!
Back to top
View user's profile Send private message
HRH_H_Crab
Tux's lil' helper
Tux's lil' helper


Joined: 30 Jul 2003
Posts: 115
Location: Sarf East Lahndahn

PostPosted: Fri Mar 10, 2006 2:09 pm    Post subject: Reply with quote

Like NightDragon I am having problems figuring out how to make this stuff work with vhosts.
My setup is plain vanilla gentoo, with the web server stuff under /var/www/.
However, (and this is where I think things are falling down), under htdocs, Ive made other directories for the various sites, so under there I have foo.org bar.com etc...

Ive followed this how-to, but things just dont seem to work. Ive tried the standard issue symlink kludge, (to the awstats directory, which I made under htdocs too, and to the cgi-bin directory, which lives in localhost, but this doesnt work.
Anyone got any pointers for me?
Back to top
View user's profile Send private message
HRH_H_Crab
Tux's lil' helper
Tux's lil' helper


Joined: 30 Jul 2003
Posts: 115
Location: Sarf East Lahndahn

PostPosted: Sun Mar 12, 2006 1:47 pm    Post subject: Reply with quote

Got it working, was just a case of sorting out my apache config (bringing it up to date) and rearranging the location of the web roots for my various vhosts in a sane manner!
Back to top
View user's profile Send private message
cpdsaorg
Guru
Guru


Joined: 16 Oct 2003
Posts: 359

PostPosted: Thu Apr 06, 2006 3:18 pm    Post subject: Reply with quote

my webserver is a bit insane. I moved the doc root to a folder in a user directory called /home/website/public_html/3.0/

now whenever I install a webapp I have to copy it from htdocs to this /3.0/ directory.

I think I have everything configured right but when i try to access ~website/awstats/cgi-bin/awstats.pl it tries to download the file.

where am i going wrong?
_________________
PentiumM 2.0 GHz, MSI 915GM Speedster-FA4, Seagate ST3500641AS SATA 400GB
Back to top
View user's profile Send private message
maiku
Guru
Guru


Joined: 24 Mar 2004
Posts: 500
Location: Long Island, NY

PostPosted: Wed Mar 19, 2008 3:52 pm    Post subject: Reply with quote

Is't at all possible to make webapp-config use /home/*/public_html instead of /var/www/*/htdocs?
_________________
- Mike A. Leonetti
Back to top
View user's profile Send private message
g2g591
Tux's lil' helper
Tux's lil' helper


Joined: 17 Sep 2007
Posts: 103

PostPosted: Thu Apr 03, 2008 6:18 pm    Post subject: Reply with quote

there is but, its apache config related.
PS, dude don't dig up 2 year old threads
Back to top
View user's profile Send private message
longint
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2002
Posts: 100
Location: good old germany

PostPosted: Thu Sep 25, 2008 11:19 pm    Post subject: Reply with quote

Can someone please verify if this HowTo is working for current installations at all?
I just can not make it...

What config entries do I have to add to my vhost confs?
Where is the datadir?

Thx a lot!
Back to top
View user's profile Send private message
neofutur
n00b
n00b


Joined: 18 Jun 2006
Posts: 13
Location: France

PostPosted: Sun Aug 23, 2009 3:01 am    Post subject: Reply with quote

longint wrote:
Can someone please verify if this HowTo is working for current installations at all?
I just can not make it...

What config entries do I have to add to my vhost confs?
Where is the datadir?

Thx a lot!


you re right the current awstats/webapp-config is completely broken, the instructions given after install are completely outdated, better make it manually . . .
_________________
http://english.feeder.ww7.be-http://neofutur.net-http://waisse.org
Back to top
View user's profile Send private message
adherr
n00b
n00b


Joined: 03 Mar 2011
Posts: 1

PostPosted: Thu Mar 03, 2011 1:56 am    Post subject: no more webapp-config in 7.0 Reply with quote

This HowTo helped me as lately as Oct2001, but unfortunately as of 7.0 you can no longer install awstats with webapp-config in this way. See Gentoo bug #352600. So your best bet is to use the directions on the awstats sourceforge site: http://awstats.sourceforge.net/docs/awstats_setup.html. You'll have to change the Alias directives to point to /usr/share/... rather than /usr/local/...

I hope that helps someone.
Back to top
View user's profile Send private message
upengan78
l33t
l33t


Joined: 27 Jun 2007
Posts: 676
Location: IL

PostPosted: Mon Aug 15, 2011 4:20 pm    Post subject: Reply with quote

Hi,

Is there any document for awstats -7.0_p20101205-r3 installation on Gentoo? vhosts flag is not there. I am not understanding where to start with the configuration process after installing this particular version.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum