From c7437b7a31cb238fc46e42933a5ac246f270f8f2 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 18 Oct 2006 14:50:09 +0000 Subject: Make stats optional git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@217 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- bin/ldap2apache | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'bin') diff --git a/bin/ldap2apache b/bin/ldap2apache index 09bb71a..c1627c9 100755 --- a/bin/ldap2apache +++ b/bin/ldap2apache @@ -220,27 +220,29 @@ clients.each{ |c| #config << " ScriptAlias /cgi-stats/awstats.pl /usr/lib/cgi-bin/awstats.pl" #config << " Redirect permanent " + @webstat_location + " http://"+server_name+"/cgi-stats/awstats.pl" - config = [] - config << "" - config << " ServerName stats.#{server_name}" - config << " ServerAdmin #{server_admin}" - config << " UserDir disabled" - config << " ErrorLog #{client_home}/logs/stats.#{server_name}-error.log" - config << " LogLevel warn" - config << " CustomLog #{client_home}/logs/stats.#{server_name}-access.log combined" - config << " ServerSignature On" - config << "" - config << ' Alias /awstats-classes/ "/usr/share/awstats/classes/"' - config << ' Alias /awstats-css/ "/usr/share/awstats/css/"' - config << ' Alias /awstats-icon/ "/usr/share/awstats/icon/"' - config << " ScriptAlias /cgi-stats/awstats.pl /usr/lib/cgi-bin/awstats.pl" - config << " Redirect permanent / http://stats.#{server_name}/cgi-stats/awstats.pl" - config << "" - config << '# vim:ft=apache:' + unless property['stats'] == "no" + config = [] + config << "" + config << " ServerName stats.#{server_name}" + config << " ServerAdmin #{server_admin}" + config << " UserDir disabled" + config << " ErrorLog #{client_home}/logs/stats.#{server_name}-error.log" + config << " LogLevel warn" + config << " CustomLog #{client_home}/logs/stats.#{server_name}-access.log combined" + config << " ServerSignature On" + config << "" + config << ' Alias /awstats-classes/ "/usr/share/awstats/classes/"' + config << ' Alias /awstats-css/ "/usr/share/awstats/css/"' + config << ' Alias /awstats-icon/ "/usr/share/awstats/icon/"' + config << " ScriptAlias /cgi-stats/awstats.pl /usr/lib/cgi-bin/awstats.pl" + config << " Redirect permanent / http://stats.#{server_name}/cgi-stats/awstats.pl" + config << "" + config << '# vim:ft=apache:' - sn2 = server_name +'-stats' - throw "Clash on #{sn2} of client#{c['o'][0]}" if files[ c['o'][0] +"-"+ sn2 ] - files[ c['o'][0] +"-"+ sn2 ] = config + sn2 = server_name +'-stats' + throw "Clash on #{sn2} of client#{c['o'][0]}" if files[ c['o'][0] +"-"+ sn2 ] + files[ c['o'][0] +"-"+ sn2 ] = config + end } } -- cgit v1.2.3