summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/ldap2apache3
-rw-r--r--etc/config6
2 files changed, 9 insertions, 0 deletions
diff --git a/bin/ldap2apache b/bin/ldap2apache
index 5f961b5..7da9b1f 100755
--- a/bin/ldap2apache
+++ b/bin/ldap2apache
@@ -27,6 +27,7 @@ clients = ldap.conn.search2(@config['basedn'], LDAP::LDAP_SCOPE_SUBTREE, 'object
@configtest = @config['module']['apache']['configtest']
@reload = @config['module']['apache']['reload']
@statsbind = @config['module']['apache']['statsbind']
+@statsvhostaddto = @config['module']['apache']['statsvhostaddto']
files = {}
@@ -243,6 +244,8 @@ clients.each{ |c|
config << ' Alias /awstats-icon/ "/usr/share/awstats/icon/"'
config << " ScriptAlias /awstats.pl /usr/lib/cgi-bin/awstats.pl"
config << " ScriptAlias / /usr/lib/cgi-bin/awstats.pl"
+ config << ""
+ config << " #{@statsvhostaddto}" if @statsvhostaddto
config << "</VirtualHost>"
config << '# vim:ft=apache:'
diff --git a/etc/config b/etc/config
index ae1a9c6..a0f9ef1 100644
--- a/etc/config
+++ b/etc/config
@@ -62,6 +62,12 @@ module:
reload: /usr/sbin/apache2ctl graceful
# for webstats vhosts
statsbind: 127.0.0.1:2862
+ statsvhostaddto: " <Location />\n
+ AuthType Basic\n
+ AuthName \"Web Statistics\"\n
+ AuthUserFile \"/etc/apache2/passwords/webstats\"\n
+ require valid-user\n
+ </Location>"
analog:
rmagic: /var/cache/analog/rmagic
output: /var/cache/analog/output