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:
#
# 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