Current time: 02-17-2025, 08:55 AM Hello There, Guest! (LoginRegister)


Post Reply 
[HowTo] AwStats Static Pages
Author Message
SniperSister Offline
Junior Member
*

Posts: 22
Joined: Feb 2007
Reputation: 0
Post: #1
[HowTo] AwStats Static Pages
Hi @all,

During the last days I tried to integrate the static pages, which can be generated by awstats. The following HowTo is not finished at all, because the generated stats aren't protected by a passwort or something. I'm currently thinking about howto realize this protection. On top of that, I wasn't able to test it on other distris than Debian Etch and ispCP Omega RC2

First of all, install awstats:
Code:
apt-get install awstats

To get static pages, you'll first have to enable Omega's ability to generate awstats configuration files for each domain. Open your ispcp configuration file (should be in /etc/ispcp/) and search the following line:
Code:
AWSTATS_DIR = no

Replace the "no" with the place where the awstats configuration file should be stored, for example /etc/awstats:
Code:
AWSTATS_DIR = /etc/awstats

When you add a new domain, Omega will generate a awstats-configuration file now. In the next step, we need to create a cronjob for each domain. Omega provides a function to create cronjobs, but this function is disabled at the moment, so we need to enable it. Open /var/www/ispcp/engine/ispcp-dmn-mngr and search for these lines (should be around 3540):

Code:
return $rs if ($rs != 0);

    $rs = dmn_add_mta_data($dmn_data);

Below at the following lines:

Code:
# Modified by Snipersister for awstats Support
    $rs = dmn_add_crontab_data($dmn_data);

    return $rs if ($rs != 0);

Around line 3640 are the following lines:

Code:
$rs = dmn_del_mta_data($dmn_data);

    return $rs if ($rs != 0);

Again, add the following code below:

Code:
# Modified by Snipersister for awstats Support    
     $rs = dmn_del_crontab_data($dmn_data);

    return $rs if ($rs != 0);

We need to create a directory for each domain, where the stats can be stored, so lets add some lines behind (should be around 1798)

Code:
$rs = make_dir(
                    "$starter_dir/$dmn_name/php5",
                    $sys_user,
                    $sys_group,
                    0750
                    );

    return $rs if ($rs != 0);
    }

Add the following lines behind this code, so it looks like this:

Code:
$rs = make_dir(
                    "$starter_dir/$dmn_name/php5",
                    $sys_user,
                    $sys_group,
                    0750
                    );

    return $rs if ($rs != 0);
    }

    # Added by SniperSister
    #
    # AwStats Directory
    #

    $rs = make_dir(            
                    "$www_dir/$dmn_name/statistics",
                    $sys_user,
                    $sys_group,
                    0755
                    );
    return $rs if ($rs != 0);

Okay, now Omega will generate a crontab file for each domain - but with the wrong cronjob! We'll have to change this by editing the template file /etc/ispcp/crontab/parts/dmn_bk_entry.tpl
In the template you'll find a backup cronjob which isn't used anymore. So we'll replace him with our awstats cronjob:
Code:
{MINUTE} {HOUR}  * * *   perl /var/www/ispcp/engine/awstats/awstats_buildstaticpages.pl -config={DMN_NAME} -update -lang=en -awstatsprog=/usr/lib/cgi-bin/awstats.pl -dir=/var/www/virtual/{DMN_NAME}/statistics/

Finally we'll have to edit the apache templates, so each user can view his stats:

At first, edit /etc/ispcp/apache/httpd.conf and remove this line:
Code:
Alias /stats "/usr/lib/cgi-bin/awstats/"

Afterwards, edit /etc/ispcp/apache/parts/ispcp_base.tpl and remove this line again (why doubly?!):
Code:
Alias /stats "/usr/lib/cgi-bin/awstats/"

Now open /etc/ispcp/apache/parts/dmn_entry.tpl and replace
Code:
Redirect /stats http://{DMN_NAME}/awstats/awstats.pl
with
Code:
Alias /stats    {WWW_DIR}/{DMN_NAME}/statistics/


Below
Code:
# httpd dmn entry cgi support END.

you'll have to add:
Code:
<Directory "{WWW_DIR}/{DMN_NAME}/statistics">
        AllowOverride None
        DirectoryIndex awstats.{DMN_NAME}.html
        Order allow,deny
        Allow from all
    </Directory>

The next step is to link the awstats staticpages script into the right directory:
Code:
ln -s  /var/www/ispcp/engine/awstats /usr/share/doc/awstats/examples

and copying the icons which are shown:
Code:
mkdir /var/www/awstats
ln -s /var/www/awstats/icon /usr/share/awstats/icon

The last step is to create a database directory for awstats:
Code:
mkdir /var/cache/awstats

Now you're finished! Add a new domain, wait a 24 Hours until the stats have been generated and open them with http://www.domainname.com/stats/

Best Regards
Snipy
(This post was last modified: 05-24-2007 11:23 PM by SniperSister.)
03-30-2007 06:48 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
[HowTo] AwStats Static Pages - SniperSister - 03-30-2007 06:48 PM
RE: [HowTo] AwStats Static Pages - BeNe - 03-31-2007, 01:38 AM
RE: [HowTo] AwStats Static Pages - xister - 04-01-2007, 03:14 AM
RE: [HowTo] AwStats Static Pages - RatS - 04-01-2007, 07:51 AM
RE: [HowTo] AwStats Static Pages - BeNe - 04-12-2007, 01:22 AM
RE: [HowTo] AwStats Static Pages - grungy - 04-13-2007, 04:25 AM
RE: [HowTo] AwStats Static Pages - grungy - 04-13-2007, 10:59 PM
RE: [HowTo] AwStats Static Pages - grungy - 04-19-2007, 07:09 PM
RE: [HowTo] AwStats Static Pages - grungy - 04-23-2007, 08:57 PM
RE: [HowTo] AwStats Static Pages - grungy - 04-23-2007, 09:21 PM
RE: [HowTo] AwStats Static Pages - grungy - 04-23-2007, 11:30 PM
RE: [HowTo] AwStats Static Pages - BeNe - 04-23-2007, 11:31 PM
RE: [HowTo] AwStats Static Pages - grungy - 04-23-2007, 11:37 PM
RE: [HowTo] AwStats Static Pages - grungy - 04-24-2007, 06:37 PM
RE: [HowTo] AwStats Static Pages - BeNe - 04-24-2007, 06:39 PM
RE: [HowTo] AwStats Static Pages - grungy - 04-24-2007, 06:47 PM
RE: [HowTo] AwStats Static Pages - BeNe - 04-24-2007, 07:10 PM
RE: [HowTo] AwStats Static Pages - grungy - 04-26-2007, 04:42 PM
RE: [HowTo] AwStats Static Pages - petzsch - 04-27-2007, 01:39 PM
RE: [HowTo] AwStats Static Pages - grungy - 05-09-2007, 05:24 PM
RE: [HowTo] AwStats Static Pages - grungy - 05-18-2007, 11:11 PM
RE: [HowTo] AwStats Static Pages - grungy - 05-18-2007, 11:17 PM
RE: [HowTo] AwStats Static Pages - grungy - 05-23-2007, 05:10 AM
RE: [HowTo] AwStats Static Pages - grungy - 05-23-2007, 05:23 AM
RE: [HowTo] AwStats Static Pages - grungy - 05-23-2007, 04:12 PM
RE: [HowTo] AwStats Static Pages - BeNe - 05-24-2007, 07:16 PM
RE: [HowTo] AwStats Static Pages - grungy - 05-24-2007, 08:43 PM
RE: [HowTo] AwStats Static Pages - BeNe - 05-24-2007, 09:07 PM
RE: [HowTo] AwStats Static Pages - BoMan - 06-21-2007, 04:06 AM
RE: [HowTo] AwStats Static Pages - grungy - 09-17-2007, 02:11 AM
RE: [HowTo] AwStats Static Pages - grungy - 09-20-2007, 11:59 PM
RE: [HowTo] AwStats Static Pages - ArcAiN6 - 12-07-2007, 05:20 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)