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

Here's a very simple script based on what was just given:

Code:
USER="insertuser"
EDITOR="pico"
cd /home/$USER/public_html
mkdir awstats
cd awstats
wget [url]http://www.febox.com/DA-awstats.tar.gz[/url]
tar xzvf DA-awstats.tar.gz
cd ..
chown -R $USER.$USER awstats
cd awstats
$EDITOR common.conf
$EDITOR config.php
$EDITOR domains.txt
su - $USER
cd public_html/awstats
php domainlist.php

A couple of things wrong, which have yet to be corrected in any version of this:
Firstly, when using "domainlist", you get a bunch (and I do mean a bunch) of Malformed UTF errors. There's a good 1-200 of those errors so I'm not going to paste those.

Secondly, "all" does not work, at least for RHEL3. I couldn't get it to work under 9 either, so its probably NOT the OS. Error follows:

Warning: Syntax error line 5 in file './aws.wolfstream.net.conf'. Config line is ignored.

Error: LogFormat parameter is not defined in config/domain file

Setup ('./aws.wolfstream.net.conf' file, web server or permissions) may be wrong.
See AWStats documentation in 'docs' directory for informations on how to setup aws.

It's generating the html stuff, but it's not generating them properly, obviously.
 
Last edited:
You need to change domainlist.txt to domains.txt.

Also, yes I know it spits out the Malformed UTF-8 errors, however it generates everything fine as far as I've seen.

I never tested it with All. I'm testing it now actually.
 
Changed, thanks for pointing that out.
I had that in there because as "all" it doesn't work oddly enough. I'd bet that once I generated the configs with "domains", it'd read from "all" just fine, or the conf's that've been generated.
I'm not sure why it does it, but I've had that problem with "all" since I started pokin around.
 
I fixed it. :)

Cleaning up and repackaging. I'll let you know when its done.
 
Ok, its updated.

I have also prepared this automated script.

The reason why I didn't include an su - at the end is because it doesn't execute any of the other commands. So I worked around it.

We should also find out whats causing the Malformed UTF errors...they are quite annoying... :p

Code:
#!/bin/bash
############################################################
#           AWStats installer for DirectAdmin              #
#       Prepared by Anthony Drimones of FeBox, LLC.        #
#            Contact: anthony [@] febox.com                #
############################################################
EDITOR="pico"
echo "Enter what username you would like Awstats installed on:"
read USER

file1="/home/$USER/public_html/awstats/common.conf"
file2="/home/$USER/public_html/awstats/config.php"

cd /home/$USER/public_html
mkdir awstats
cd awstats
wget [url]http://www.febox.com/DA-awstats.tar.gz[/url]
tar xzvf DA-awstats.tar.gz
cd ..
chown -R $USER.$USER awstats
cd awstats
perl -pi -e "s/USERNAME/$USER/g" $file1
perl -pi -e "s/USERNAME/$USER/g" $file2
echo "Would you like to use all the domains or a list of your choosing? Type 'all' for All and 'list' for list"
read CHOICE

if [ "$CHOICE" = "all" ]; then
        php domainlist.php
        chown -R $USER.$USER *
        echo "Awstats complete!"
        echo "For future updates, please su - to $USER and run the command 'php domainlist.php'"
else
        perl -pi -e "s/= 'all'/= 'domainlist'/g" /home/$USER/public_html/awstats/config.php
        $EDITOR /home/$USER/public_html/awstats/domains.txt
        php domainlist.php
        chown -R $USER.$USER *
        echo "Awstats complete!"
        echo "For future updates, please su - to $USER and run the command 'php domainlist.php'"
fi
 
For this to effectively work through cron, you need to make a couple of adjustments to domainlist.php
We'll take my setup for example
$username="wolf";
chdir ( '/home/'.$username.'/public_html/awstats/' );
include ( 'config.php' );
You've got to have the $username defined before the chdir, and the config after that. Otherwise, the script will bail when trying to run it.
Looks like everything works as it should though, great job.
 
Thanks and nice job to you too. :)

Maybe this will speed up the process of getting it officially released with DA. :D
 
Last edited:
why?

why can i only run /etc/awstats/domainlist.php if i logd in as root user?? i like to have an cronjob that update the stats before logrotation at the end of the month. can some help me please how to do that (when do an cronjob as admin i get all error "permission dinied") as root user everithing works fine.
 
I think the awstats directory belongs to root so any lesser user will not be able to do anything that involves it unless permissions / ownership is changed.
 
awstats consuming heavy resources ??

I installed awstats for all the websites (automatica installation for each site created) and heard that we could only do 50 sites per server (P4, 512Ram, 80G IDE HDD, 100M shared with 5M dedicated).

Anybody running more than 50 or 100 or 200 sites ?? How is the servers stress level ??
 
Is there a simple guide to doing this with the latest versions of DA and awstats? Also does the server load look for those of you who have installed this?
 
Server load is normal. It only spikes a little when a user updates his statistics.

This is a DA Plugin. At the admin level install the plugin in the plugin page, then in the user level choose the domain you want to install it on, then select the link to install it, view stats, or password protect the directory.

No instructions are really needed.

If your not the admin, then you must contact you admin and see if you can convince them to install the plugin on the server.
 
without reading through 4 pages of posts, can someone tell me if there is still any problem with "about 10% of domains dont generate pages, i have no idea why"

also, the link on the first post goes to AWStats Multi Domain 0.59, while the current version of awstats is 0.61, is it not?
 
Thank you very much for this script ! It's run very good in my server, but i've got the problem of "Malformed UTF-8 errors" and i don't resolve it, have you got a solution ? Thanks. Bye.
 
its rather easy, UTF errors have something to do with languages, so there are errors in the text.

Open the search_engines.pm and robots.pm and get the errorline and look for things like é á ä ë etc, and make just a and e from it. Then its solved :)

Dont delete whole lines, then it wont work anymore :)
 
Hi,

I am a newbi to DA...

How can I add this as a plugin?

Simply copy and paste the script above in a file and upload it to the plugin page. And run it ?

Or am I wrong on this one....

Maybe an Idea to build a plugin link collection page on the forum...


Cheers
 
pinooo said:
Hi,

I am a newbi to DA...

How can I add this as a plugin?

Simply copy and paste the script above in a file and upload it to the plugin page. And run it ?

Or am I wrong on this one....

Maybe an Idea to build a plugin link collection page on the forum...


Cheers

That's my big question to!

I tried everything to get it working but there's still noting.

It's impossible to install Awstats on every domain on my servers. 2049 accounts, that's a lot of work.

Is it so difficult for DirectAdmin to ad it to DA as an options/plugin so it can be accessed true DA

DA is a great panel but there's a lot to do in offering options. A whole lot!
 
Back
Top