[rel] AWStats - For all you domains (availiable now)

FarCry

Verified User
Joined
Jun 6, 2003
Messages
280
Location
Perth, Australia
Well, a few months ago i said i would toy with awstats to get it going with DA, this i have done, and have been pretty much successfull. about 10% of domains dont generate pages, i have no idea why... but anyways, its very easy to install, very easy to get running.

I've tried to take all the pain out of installing awstats, it automaticaly creates config files, runs updates stats, and creates html files! there are 12 steps to install it, it does require use of SSH to install but is dead easy. All commands are provided if you dont know them, you should have no problems!

Requires:
- Domains/Logs
- DirectAdmin (well duh)

Get it now!
http://sourceforge.net/project/showfiles.php?group_id=87578&release_id=198816

Demo:
http://awstats.spinnahost.com/wa-league.com.html
http://awstats.spinnahost.com/clanmayhem.org.html
http://awstats.spinnahost.com/spinnahost.com.html
http://awstats.spinnahost.com/wieisdemol.com.html ( moved to another server )

Warnings:
Can take along time to parse logs depending on the amount of domains/log file size. Initial update can take quite a while to do.

URGENT: IF YOU HAVE THIS RUNNING, DELETE YOUR CRONTAB, RECREATE AS FOLLOWS. IF YOU DONT, YOU MAY TAKE YOU SERVER DOWN.
minute: 0
hour: 0
rest: *
cmd: php /etc/awstats/domainlist.php


Changelog:
0.11 -
Subdomain's stats are now parsed correctly (no more errors)!
 
Last edited:
actualy if you just goto the link i provided you can get a mirror that is close and fast :)

I would not just untar it anywhere as its not extracted to its own self contained directory.

Hence, here is my idea of how you should download (is pretty much a changed about version of the first steps in the install.txt)

# mkdir /etc/awstats/
# mkdir /etc/awstats/data/
# chmod 777 /etc/awstats/ -R
(recursive so you get the data dir too)
# cd /etc/awstats/
# wget [link address you get at the top of the source forge download page when you choose a mirror]
# tar xzvf awstats59-md.tar.gz

open a new shell window, to use when following the install file, then
# vi install.txt
(or)
# pico install.txt
and then follow instructions from there.
 
SpinnaHost-Mark said:
actualy if you just goto the link i provided you can get a mirror that is close and fast :)

No UK mirrors... and the others were extremely slow, think i might have chose a busy American time :D
 
ok i have my cron job set
min *
hour 0
the rest *

command php /etc/awstats/domainlist.php

and i get

/bin/sh: php: command not found
what did i do wrong
 
Login to shell and try
# php /etc/awstats/domainlist.php


If this gives the same response:
try the full php path... (to find see below)
# which php
/usr/local/bin/php

if this fails, make sure php actualy exists there by running it:
# /usr/local/bin/php

then just type in:
<?php echo "hello\n\n"; ?>

then press ctrl-d to execute it...

If you get nothing or a command not found you have a few problems....


if it does exist:

edit domainlist.php and add the following line as the VERY first line (before <?php even)
#!/usr/local/bin/php
(or where php was found with which)

make it executable:
# chmod 755 /etc/awstats/domainlist.php


try it again with the following command:
# /etc/awstats/domainlist.php

If this works, then update your cron to be:
command: /etc/awstats/domainlist.php


If you get any more problems, create a bug report on the DA Tools sf.net project page: http://www.sf.net/projects/datools/
 
well i think i found the problem i set awstats up ad root now when i do i from admin it say permission not allow do i have to start all over again.
 
you dont have to start again, just login as root and:

# chown admin.admin /etc/awstats/ -R
# chown admin.admin /home/admin/public_html/awstats/ -R
# chmod 777 /home/admin/public_html/awstats/
# chmod 777 /etc/awstats/data/
 
Hi,

I do not have the path /home/admin/public_html/ on my server.
I have tried setting this up using /home/admin/domains/mydomain.com/public_html/awstats (where mydomain.com is my main admin account) but without success.

Am I supposed to have /home/admin/public_html/ by default ?
 
/home/admin/public_html/ should be a syslink to your /home/admin/domains/domain.com/public_html.

To create it:
# cd /home/admin
# ln -s ./domains/<yourdomain>/public_html public_html

ln info/syntax/usage can be gained by ln --help

First section here:
--
Usage: ln [OPTION]... TARGET [LINK_NAME]
or: ln [OPTION]... TARGET... DIRECTORY
or: ln [OPTION]... --target-directory=DIRECTORY TARGET...
Create a link to the specified TARGET with optional LINK_NAME.
If LINK_NAME is omitted, a link with the same basename as the TARGET is
created in the current directory. When using the second form with more
than one TARGET, the last argument must be a directory; create links
in DIRECTORY to each TARGET. Create hard links by default, symbolic
links with --symbolic. When creating hard links, each TARGET must exist.
 
[admin@215 admin]$ chown admin.admin /etc/awstats/ -R
[admin@215 admin]$ chown admin.admin /home/admin/public_html/awstats/ -R
[admin@215 admin]$ chmod 777 /home/admin/public_html/awstats/
[admin@215 admin]$ chmod 777 /etc/awstats/data/
[admin@215 admin]$ /etc/awstats/domainlist.php
bash: /etc/awstats/domainlist.php: Permission denied
 
Try this:

[root@localhost /]# chown admin.admin /home/admin/public_html/awstats/ -R
[root@localhost /]# chown admin.admin /etc/awstats/ -R
[root@localhost /]# chmod 777 /etc/awstats/data/ -R
[root@localhost /]# chmod 777 /home/admin/public_html/awstats/
[root@localhost /]# chmod +w /home/admin/public_html/awstats/*
[root@localhost /]# exit
[admin@localhost /]$ cd /etc/awstats/
[admin@localhost awstats]$ chmod +x domainlist.php
[admin@localhost awstats]$ php domainlist.php
... and away it goes ...


And keep using "php /etc/awstats/domainlist.php" as the cron command, if all works well.
 
Last edited:
OK, sysmlink created but......

php domainlist.php runs OK for me but does not output anything to /home/admin/public_html/awstats (chmod 777) All I have there are the original files untarred from html.tar.gz

My config file looks like

<?php
$loglocation = '/var/log/httpd';
$outputlocation = '/home/admin/public_html/awstats';
?>
 
it runs for about 2 seconds, (about 15 domains on this server) and does not give any output on command line but does create files in /etc/awstats/ for each domain

awstas.domain.com.conf
 
strange,

try
# chmod +w /home/admin/public_html/awstats -R

OR

just change your config file to be the "full" path to the domain.
eg: /home/admin/domains/spinnahost.com/public_html/awstats
 
Back
Top