From 99cb22d717aefea1b76ebfab33cada925c1d5e31 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Mon, 02 Mar 2009 10:46:14 -0500
Subject: [PATCH] - Changed default root for websites from /var/clients to /var/www/clients. - Added deny directives to prevent direct access to the /var/www/clients and /var/www/domain.tld directories.
---
server/conf/vhost.conf.master | 8 +++++++-
server/conf/apache_ispconfig.conf.master | 6 ++++++
install/tpl/server.ini.master | 4 ++--
install/tpl/apache_ispconfig.conf.master | 6 ++++++
4 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/install/tpl/apache_ispconfig.conf.master b/install/tpl/apache_ispconfig.conf.master
index 3289801..650a944 100644
--- a/install/tpl/apache_ispconfig.conf.master
+++ b/install/tpl/apache_ispconfig.conf.master
@@ -7,4 +7,10 @@
LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
CustomLog "| /usr/sbin/vlogger -s access.log -t \"%Y%m%d-access.log\" /var/log/ispconfig/httpd" combined_ispconfig
+<Directory /var/www/clients>
+ AllowOverride None
+ Order Deny,Allow
+ Deny from all
+</Directory>
+
diff --git a/install/tpl/server.ini.master b/install/tpl/server.ini.master
index f7a3d66..cb65306 100644
--- a/install/tpl/server.ini.master
+++ b/install/tpl/server.ini.master
@@ -29,8 +29,8 @@
getmail_config_dir=/etc/getmail
[web]
-website_path=/var/clients/client[client_id]/web[website_id]
-website_symlinks=/var/www/[website_domain]/:/var/clients/client[client_id]/[website_domain]/
+website_path=/var/www/clients/client[client_id]/web[website_id]
+website_symlinks=/var/www/[website_domain]/:/var/www/clients/client[client_id]/[website_domain]/
vhost_conf_dir=/etc/apache2/sites-available
vhost_conf_enabled_dir=/etc/apache2/sites-enabled
diff --git a/server/conf/apache_ispconfig.conf.master b/server/conf/apache_ispconfig.conf.master
index ed6b67a..1211285 100644
--- a/server/conf/apache_ispconfig.conf.master
+++ b/server/conf/apache_ispconfig.conf.master
@@ -6,6 +6,12 @@
LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
CustomLog "| /usr/sbin/vlogger -s access.log -t \"%Y%m%d-access.log\" /var/log/ispconfig/httpd" combined_ispconfig
+<Directory /var/www/clients>
+ AllowOverride None
+ Order Deny,Allow
+ Deny from all
+</Directory>
+
<tmpl_loop name="ip_adresses">
NameVirtualHost {tmpl_var name="ip_address"}:80
NameVirtualHost {tmpl_var name="ip_address"}:443
diff --git a/server/conf/vhost.conf.master b/server/conf/vhost.conf.master
index 61edbf6..03f6bc1 100644
--- a/server/conf/vhost.conf.master
+++ b/server/conf/vhost.conf.master
@@ -1,4 +1,10 @@
+<Directory /var/www/{tmpl_var name='domain'}>
+ AllowOverride None
+ Order Deny,Allow
+ Deny from all
+</Directory>
+
<VirtualHost <tmpl_var name='ip_address'>:80>
<tmpl_if name='php' op='==' value='suphp'>
DocumentRoot <tmpl_var name='web_document_root'>
@@ -27,7 +33,7 @@
ErrorDocument 500 /error/500.html
ErrorDocument 503 /error/503.html
</tmpl_if>
-
+
<Directory {tmpl_var name='web_document_root_www'}>
Options FollowSymLinks
AllowOverride Indexes AuthConfig Limit FileInfo
--
Gitblit v1.9.1