diff --git a/debian/control b/debian/control index f63cb7fb..e8a6bf57 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,7 @@ Standards-Version: 3.8.0 Package: alternc Architecture: all Pre-depends: debconf (>= 0.5.00) | debconf-2.0 -Depends: debianutils (>= 1.13.1), apache2, libapache2-mod-php5, courier-ssl, courier-imap-ssl, courier-pop-ssl, php5-mysql, phpmyadmin, postfix, proftpd-mod-mysql, proftpd-basic, squirrelmail, squirrelmail-locales, postfix-tls, bind9, wget, rsync, quota, courier-authmysql | courier-authlib-mysql, ca-certificates, locales, perl-suid, perl, postfix-mysql, wwwconfig-common, sasl2-bin, fam, libsasl2-modules, php5-cli, lockfile-progs (>= 0.1.9), gettext (>= 0.10.40-5), pdksh (>= 5.2.14-6), adduser, mysql-client, dnsutils, bash +Depends: debianutils (>= 1.13.1), apache2-mpm-itk, libapache2-mod-php5, courier-ssl, courier-imap-ssl, courier-pop-ssl, php5-mysql, phpmyadmin, postfix, proftpd-mod-mysql, proftpd-basic, squirrelmail, squirrelmail-locales, postfix-tls, bind9, wget, rsync, quota, courier-authmysql | courier-authlib-mysql, ca-certificates, locales, perl-suid, perl, postfix-mysql, wwwconfig-common, sasl2-bin, fam, libsasl2-modules, php5-cli, lockfile-progs (>= 0.1.9), gettext (>= 0.10.40-5), pdksh (>= 5.2.14-6), adduser, mysql-client, dnsutils, bash Recommends: apache2, mysql-server Conflicts: alternc-admintools, alternc-awstats (<= 0.3.2), alternc-webalizer (<= 0.9.4) Provides: alternc-admintools diff --git a/etc/alternc/templates/apache2/vhost.conf b/etc/alternc/templates/apache2/vhost.conf index f9e858b8..d65869c8 100644 --- a/etc/alternc/templates/apache2/vhost.conf +++ b/etc/alternc/templates/apache2/vhost.conf @@ -1,6 +1,7 @@ ServerName %%fqdn%% DocumentRoot "%%document_root%%" + AssignUserId #%%UID%% #%%GID%% php_admin_value open_basedir "%%document_root%%:/usr/share/php/:/var/alternc/tmp:/tmp" diff --git a/src/functions.sh b/src/functions.sh index 5047a7f2..929dda28 100755 --- a/src/functions.sh +++ b/src/functions.sh @@ -26,6 +26,10 @@ print_user_letter() { echo "$user" | awk '{print substr($1, 1, 1)}' } +get_uid_by_name() { + mysql_query 'SELECT uid FROM membres WHERE login="'"$1"'" LIMIT 1;' +} + # imprime le nom d'usager associé au domaine get_account_by_domain() { # les admintools ne sont peut-être pas là diff --git a/src/functions_hosting.sh b/src/functions_hosting.sh index 37bcea00..a5a71f82 100644 --- a/src/functions_hosting.sh +++ b/src/functions_hosting.sh @@ -56,6 +56,8 @@ host_create() { local REDIRECT=$3 # Yes, TARGET_DIR and REDIRECT are the same local TARGET_DIR=$3 # It's used by different template local USER=$(get_account_by_domain $FQDN) + local U_ID=$(get_uid_by_name "$USER") + local G_ID=$(get_uid_by_name "$USER") local user_letter=`print_user_letter "$USER"` local DOCUMENT_ROOT="${HTML_HOME}/${user_letter}/${USER}/$TARGET_DIR" local FILE_TARGET="$VHOST_DIR/${user_letter}/$USER/$FQDN.conf" @@ -87,6 +89,8 @@ host_create() { -e "s#%%fqdn%%#$FQDN#g" \ -e "s#%%document_root%%#$DOCUMENT_ROOT#g" \ -e "s#%%redirect%%#$REDIRECT#g" \ + -e "s#%%UID%%#$U_ID#g" \ + -e "s#%%GID%%#$G_ID#g" \ $TMP_FILE # Check if all is right in the conf file