Post Reply  Post Thread 
Pages (4): « First [1] 2 3 4 Next > Last »
[HowTo] AwStats Static Pages UPDATED
Author Message
grungy
Junior Member
*


Posts: 185
Group: Registered
Joined: Dec 2006
Status: Offline
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


- OMEGUS FANATICUS -

- Nicaš Do Jaja -

- "If ispCP the dominating hosting system becomes, there is a faith war less" -

Debian Etch 4.0 User

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
Member
****
Dev Team

Posts: 474
Group: Dev Team
Joined: Apr 2007
Status: Offline
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


YaHost Me | Text Link Ads | my Debian repository | Donate! | No OOXML! | Project HoneyPot | ... and more

Quote:
This is Linux land. In silent nights you can hear the Windows machines rebooting.

If you want to be helped, don't PM me but post in the forums | If you want private support PM me and we'll discuss the price

09-21-2007 10:46 AM
Visit this user's website Find all posts by this user Quote this message in a reply
SniperSister
Junior Member
*


Posts: 21
Group: Registered
Joined: Feb 2007
Status: Offline
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
Documentation Team
***
Docu Team

Posts: 1,283
Group: Docu Team
Joined: Jul 2007
Status: Offline
Reputation: 11
Post: #4
RE: [HowTo] AwStats Static Pages UPDATED

When it works, maybe the Dev's can merge this into the current Trunk Smile


OS : Debian 4.0 Etch 64bit
ispCP Version : RC6 r1257 - 01.07.08 (NightlyBuild)
Activated : AWStats dynamic
Mods : none
->SmileThis Signature is OpenSourceSmile<-
09-21-2007 04:29 PM
Visit this user's website Find all posts by this user Quote this message in a reply
BeNe
Moderator
*****


Posts: 2,557
Group: Moderators
Joined: Jan 2007
Status: Offline
Reputation: 35
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




:: ispCP Omega RC5 Live Demo - r1267 (19.05.08) --> http://www.isp-control.net/forum/ispcp-o...ml#pid2169 <--
09-21-2007 04:32 PM
Visit this user's website Find all posts by this user Quote this message in a reply
grungy
Junior Member
*


Posts: 185
Group: Registered
Joined: Dec 2006
Status: Offline
Reputation: 6
Post: #6
RE: [HowTo] AwStats Static Pages UPDATED

This works, tested it on 3 servers.....


- OMEGUS FANATICUS -

- Nicaš Do Jaja -

- "If ispCP the dominating hosting system becomes, there is a faith war less" -

Debian Etch 4.0 User
09-21-2007 04:46 PM
Visit this user's website Find all posts by this user Quote this message in a reply
BeNe
Moderator
*****


Posts: 2,557
Group: Moderators
Joined: Jan 2007
Status: Offline
Reputation: 35
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




:: ispCP Omega RC5 Live Demo - r1267 (19.05.08) --> http://www.isp-control.net/forum/ispcp-o...ml#pid2169 <--
09-21-2007 05:17 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Zothos
Member
****
Dev Team

Posts: 581
Group: Dev Team
Joined: Feb 2007
Status: Offline
Reputation: 7
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]


Real programmers don't comment their code - it was hard to write, it should be hard to understand

OS : Gentoo 32bit Stage1
ispCP Version : RC4
Mods : Dovecot | Pure-ftpd

09-21-2007 06:29 PM
Find all posts by this user Quote this message in a reply
grungy
Junior Member
*


Posts: 185
Group: Registered
Joined: Dec 2006
Status: Offline
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...


- OMEGUS FANATICUS -

- Nicaš Do Jaja -

- "If ispCP the dominating hosting system becomes, there is a faith war less" -

Debian Etch 4.0 User

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
Moderator
*****


Posts: 2,557
Group: Moderators
Joined: Jan 2007
Status: Offline
Reputation: 35
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




:: ispCP Omega RC5 Live Demo - r1267 (19.05.08) --> http://www.isp-control.net/forum/ispcp-o...ml#pid2169 <--
09-21-2007 07:14 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Pages (4): « First [1] 2 3 4 Next > Last »
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump:

| All rights reserved : isp-control.net |