From 846a2159864f6174596abd2df6e06ada596fc44f Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Wed, 21 Sep 2011 13:04:57 +0000 Subject: [PATCH] we replace the openbasedir to the document root by one on the root of relevant alternc account. Restore the behavior of pre-1.0 version. Now you can go back to the other behavior (1.0 one) by changing the vhost.conf template --- etc/alternc/templates/apache2/vhost.conf | 2 +- src/functions_hosting.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/etc/alternc/templates/apache2/vhost.conf b/etc/alternc/templates/apache2/vhost.conf index 918fa45b..a656f2f5 100644 --- a/etc/alternc/templates/apache2/vhost.conf +++ b/etc/alternc/templates/apache2/vhost.conf @@ -3,7 +3,7 @@ DocumentRoot "%%document_root%%" - php_admin_value open_basedir "%%document_root%%:/usr/share/php/:/var/alternc/tmp:/tmp" + php_admin_value open_basedir "%%account_root%%:/usr/share/php/:/var/alternc/tmp:/tmp" Options +MultiViews -FollowSymLinks +SymLinksIfOwnerMatch AllowOverride AuthConfig FileInfo Limit Options Indexes diff --git a/src/functions_hosting.sh b/src/functions_hosting.sh index 37bcea00..31cf438f 100644 --- a/src/functions_hosting.sh +++ b/src/functions_hosting.sh @@ -58,6 +58,7 @@ host_create() { local USER=$(get_account_by_domain $FQDN) local user_letter=`print_user_letter "$USER"` local DOCUMENT_ROOT="${HTML_HOME}/${user_letter}/${USER}/$TARGET_DIR" + local ACCOUNT_ROOT="${HTML_HOME}/${user_letter}/${USER}/" local FILE_TARGET="$VHOST_DIR/${user_letter}/$USER/$FQDN.conf" # In case VTYPE don't have the same name as the template file, @@ -86,6 +87,7 @@ host_create() { sed -i \ -e "s#%%fqdn%%#$FQDN#g" \ -e "s#%%document_root%%#$DOCUMENT_ROOT#g" \ + -e "s#%%account_root%%#$ACCOUNT_ROOT#g" \ -e "s#%%redirect%%#$REDIRECT#g" \ $TMP_FILE