Allez, on attaque MPM-ITK

This commit is contained in:
Alan Garcia 2011-05-17 16:36:01 +00:00
parent 9c85bac55b
commit 254739664d
4 changed files with 10 additions and 1 deletions

2
debian/control vendored
View File

@ -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

View File

@ -1,6 +1,7 @@
<VirtualHost *:80>
ServerName %%fqdn%%
DocumentRoot "%%document_root%%"
AssignUserId #%%UID%% #%%GID%%
<Directory "%%document_root%%">
php_admin_value open_basedir "%%document_root%%:/usr/share/php/:/var/alternc/tmp:/tmp"

View File

@ -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à

View File

@ -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