Current time: 11-01-2024, 02:32 PM Hello There, Guest! (LoginRegister)


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

Posts: 190
Joined: Dec 2006
Reputation: 6
Post: #1
[HowTo] AwStats Static Pages UPDATED
I was so frustrated so last night I wrote this, and it works with trunk 20070919. It is based on SniperSister's tutorial and please test it and post your experience....



THE TUTOR:


Code:
apt-get install awstats

Edit /etc/ispcp/ispcp.conf

Code:
AWSTATS_ACTIVE = yes
AWSTATS_MODE = 1


Check for dmn_custom_b.tpl typo

Code:
ls /etc/ispcp/cron.d/parts/dmn_cutom_b.tpl

if so
Code:
ln -s /etc/ispcp/cron.d/parts/dmn_cutom_b.tpl /etc/ispcp/cron.d/parts/dmn_custom_b.tpl

Code:
ln -s /usr/share/doc/awstats/examples /var/www/ispcp/engine/awstats
mkdir /var/cache/awstats

Code:
ln -s /usr/share/awstats/icon /var/www/awstats/icon

Edit /etc/ispcp/apache/parts/dmn_entry.tpl

after
Code:
Alias /errors   {WWW_DIR}/{DMN_NAME}/errors/

add
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>


Add following to /etc/ispcp/apache/parts/ispcp_base.tpl just before
Code:
#
# Header End
#

Code:
#
# AWStats
#

Alias /awstatsclasses "/var/www/awstats/classes/"
Alias /awstatscss "/var/www/awstats/css/"
Alias /awstatsicons "/var/www/awstats/icon/"
Alias /awstatsjs "/var/www/awstats/js/"
Alias /stats    {WWW_DIR}/{DMN_NAME}/statistics/
<Directory /usr/lib/cgi-bin/awstats>
    AllowOverride AuthConfig
    Options -Includes FollowSymLinks +ExecCGI MultiViews
    AddHandler cgi-script cgi pl
    DirectoryIndex awstats.pl
    Order deny,allow
    Allow from all
</Directory>

this should show up in /etc/apache2/sites-available/ispcp.conf ( I had to add it manually )... and add the same to /etc/ispcp/apache/working/ispcp.conf




open /var/www/ispcp/engine/ispcp-dmn-mngr

Since a directory for each domain needs to be created, we will add some lines under
Code:
#
        # PHP4 and PHP5 Directory for usual user  
        #

Find the part

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

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


and add some 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 grungy && SniperSister
    #
    # AwStats Directory
    #

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


UNDER

Code:
################################# DOMAIN DATA ##################################

################################################################################​
##
## Add Domain Data
##


search for

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

    $rs = dmn_add_mta_data($dmn_data);



and add

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

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

so it looks like this:

Code:
$rs = dmn_add_mta_data($dmn_data);

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

# Modified by grungy && Snipersister for awstats Support
    $rs = dmn_add_bkp_crontab_data($dmn_data);

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

    push_el(\@main::el, 'dmn_add_data()', 'Ending...');

    return 0;
}

Under


Code:
################################################################################​
##
## Delete Domain Data
##


find

Code:
$rs = dmn_del_mta_data($dmn_data);

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

and add

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

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

so it looks like this

Code:
$rs = dmn_del_mta_data($dmn_data);

    return $rs if ($rs != 0);
# Modified by grungy && Snipersister for awstats Support
     $rs = dmn_del_crontab_data($dmn_data);

    return $rs if ($rs != 0);
    push_el(\@main::el, 'dmn_del_data()', 'Ending...');

    return 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/cron.d/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/


You can generate the statistics manually by entering the following command to the shell:

Code:
perl /var/www/ispcp/engine/awstats/awstats_buildstaticpages.pl -config=DOMAIN.TLD -update -lang=en -awstatsprog=/usr/lib/cgi-bin/awstats.pl -dir=/var/www/virtual/DOMAIN.TLD/statistics/

just put the domain instead of DOMAIN.TLD



The cron jobs will be put into /etc/cron.d/ispcp
(This post was last modified: 10-01-2007 04:30 AM by grungy.)
09-20-2007 08:31 PM
Visit this user's website Find all posts by this user Quote this message in a reply
raphael Offline
Member
***

Posts: 474
Joined: Apr 2007
Reputation: 8
Post: #2
RE: [HowTo] AwStats Static Pages UPDATED
you need to specify the user under which the cronjob is going to run just after the time info
09-21-2007 10:46 AM
Visit this user's website Find all posts by this user Quote this message in a reply
SniperSister Offline
Junior Member
*

Posts: 22
Joined: Feb 2007
Reputation: 0
Post: #3
RE: [HowTo] AwStats Static Pages UPDATED
Hey grungy,
nice to see that somebody else continues the tutorial! I just haven't the time to take a closer look at the current trunk so don't be angry at me - i didn't forget IspCP Wink

Best regards
David
09-21-2007 03:23 PM
Visit this user's website Find all posts by this user Quote this message in a reply
gOOvER Offline
Banned

Posts: 3,561
Joined: Jul 2007
Post: #4
RE: [HowTo] AwStats Static Pages UPDATED
When it works, maybe the Dev's can merge this into the current Trunk Smile
09-21-2007 04:29 PM
Visit this user's website Find all posts by this user Quote this message in a reply
BeNe Offline
Moderator
*****
Moderators

Posts: 5,899
Joined: Jan 2007
Reputation: 68
Post: #5
RE: [HowTo] AwStats Static Pages UPDATED
Maybe - but this is only Static and not Dynamic.
We will see, should be enough for the first Version in my Eyes.
Better than no AWstats.

Greez BeNe
09-21-2007 04:32 PM
Visit this user's website Find all posts by this user Quote this message in a reply
grungy Offline
Junior Member
*

Posts: 190
Joined: Dec 2006
Reputation: 6
Post: #6
RE: [HowTo] AwStats Static Pages UPDATED
This works, tested it on 3 servers.....
09-21-2007 04:46 PM
Visit this user's website Find all posts by this user Quote this message in a reply
BeNe Offline
Moderator
*****
Moderators

Posts: 5,899
Joined: Jan 2007
Reputation: 68
Post: #7
RE: [HowTo] AwStats Static Pages UPDATED
If i have enough time i will test it on my Demo so the People see AWstats and ispCP in Action Wink

Greez BeNe
09-21-2007 05:17 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Zothos Offline
Release Manager
*****
Dev Team

Posts: 1,262
Joined: Feb 2007
Reputation: 10
Post: #8
RE: [HowTo] AwStats Static Pages UPDATED
I have taken a quick look at the howto. This part is fixed in 810. So you dont need it anymore:

Quote:Check for dmn_custom_b.tpl typo

Code:
ls /etc/ispcp/cron.d/parts/dmn_cutom_b.tpl


if so
Code:
ln -s /etc/ispcp/cron.d/parts/dmn_cutom_b.tpl /etc/ispcp/cron.d/parts/dmn_custom_b.tpl[/quote]
09-21-2007 06:29 PM
Find all posts by this user Quote this message in a reply
grungy Offline
Junior Member
*

Posts: 190
Joined: Dec 2006
Reputation: 6
Post: #9
RE: [HowTo] AwStats Static Pages UPDATED
Zothos Wrote:I have taken a quick look at the howto. This part is fixed in 810. So you dont need it anymore:

Quote:Check for dmn_custom_b.tpl typo

Code:
ls /etc/ispcp/cron.d/parts/dmn_cutom_b.tpl


if so
Code:
ln -s /etc/ispcp/cron.d/parts/dmn_cutom_b.tpl /etc/ispcp/cron.d/parts/dmn_custom_b.tpl
[/quote]


I know but for those people who still have older trunks...this typo was present for like 2 months...
(This post was last modified: 09-21-2007 06:53 PM by grungy.)
09-21-2007 06:37 PM
Visit this user's website Find all posts by this user Quote this message in a reply
BeNe Offline
Moderator
*****
Moderators

Posts: 5,899
Joined: Jan 2007
Reputation: 68
Post: #10
RE: [HowTo] AwStats Static Pages UPDATED
I tested it in the Demo and it does not Work!
The Status of all domains is change, delete, or toadd but now no Domain is "OK".

What i not understand - what do you mean with this:
Quote:this should show up in /etc/apache2/sites-available/ispcp.conf ( I had to add it manually )...
Must i copy this:
Code:
#
# AWStats
#

Alias /awstatsclasses "/var/www/awstats/classes/"
Alias /awstatscss "/var/www/awstats/css/"
Alias /awstatsicons "/var/www/awstats/icon/"
Alias /awstatsjs "/var/www/awstats/js/"
Alias /stats    {WWW_DIR}/{DMN_NAME}/statistics/
<Directory /usr/lib/cgi-bin/awstats>
    AllowOverride AuthConfig
    Options -Includes FollowSymLinks +ExecCGI MultiViews
    AddHandler cgi-script cgi pl
    DirectoryIndex awstats.pl
    Order deny,allow
    Allow from all
</Directory>
To ALL Domain in the config ? Could this be ?

Greez BeNe
09-21-2007 07:14 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


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