Attaque des vhost et du bind rangé à la Debian

This commit is contained in:
Alan Garcia 2013-02-18 15:52:47 +00:00
parent 097fb930d2
commit 1ce2db723d
12 changed files with 19 additions and 23 deletions

8
debian/alternc.dirs vendored
View File

@ -16,17 +16,15 @@ usr/lib/alternc/install.d
usr/sbin
usr/share/alternc/install
usr/share/locale/fr/LC_MESSAGES
var/alternc/apache-vhost
var/alternc/apacheconf
var/alternc/bind
var/alternc/bind/zones
var/alternc/cgi-bin
var/alternc/db
var/alternc/exec.usr
var/alternc/mla
var/alternc/sessions
var/alternc/tmp
var/alternc/logs
var/backups/alternc
/var/lib/alternc/apache-vhost
/var/lib/alternc/bind
/var/lib/alternc/bind/zones
var/log/alternc
var/run/alternc

View File

@ -245,9 +245,9 @@ EOF
#find /var/alternc/dns/ -type l -lname /var/alternc/bureau -exec rm {} \;
# Bind stuff
touch /var/alternc/bind/automatic.conf /var/alternc/bind/slaveip.conf
chown root:bind /var/alternc/bind/automatic.conf /var/alternc/bind/slaveip.conf
chmod 640 /var/alternc/bind/automatic.conf /var/alternc/bind/slaveip.conf
touch /var/lib/alternc/bind/automatic.conf /var/lib/alternc/bind/slaveip.conf
chown root:bind /var/lib/alternc/bind/automatic.conf /var/lib/alternc/bind/slaveip.conf
chmod 640 /var/lib/alternc/bind/automatic.conf /var/lib/alternc/bind/slaveip.conf
touch /var/run/alternc/refresh_slave
/usr/lib/alternc/slave_dns
# Apache will not start without this file

View File

@ -29,9 +29,9 @@ acl "internal" {
};
// the ip of the slaves generated by alternc
include "/var/alternc/bind/slaveip.conf";
include "/var/lib/alternc/bind/slaveip.conf";
include "/etc/bind/rndc.key";
// the zones generated by the users
include "/var/alternc/bind/automatic.conf";
include "/var/lib/alternc/bind/automatic.conf";

View File

@ -14,8 +14,7 @@ for CONFIG_FILE in \
. "$CONFIG_FILE"
done
#FIXME: should be define in local.sh
ALTERNC_LOGS="$ALTERNC_LOC/logs"
# ALTERNC_LOGS is from local.sh
#Compress logs older than XX days
nice -n 10 find "$ALTERNC_LOGS" -type f -name '*.log' -mtime +$DAYS -exec gzip '{}' \;

View File

@ -14,7 +14,6 @@ for CONFIG_FILE in \
. "$CONFIG_FILE"
done
# FIXME this var should be define in local.sh
ALTERNC_LOGS="$ALTERNC_LOC/logs"
# ALTERNC_LOGS is from local.sh
nice 10 -n find "$ALTERNC_LOGS" -mtime +$DAYS -delete

View File

@ -8,10 +8,10 @@
# Init some other vars
ZONE_TEMPLATE="/etc/alternc/templates/bind/templates/zone.template"
NAMED_TEMPLATE="/etc/alternc/templates/bind/templates/named.template"
NAMED_CONF="/var/alternc/bind/automatic.conf"
NAMED_CONF="/var/lib/alternc/bind/automatic.conf"
dns_zone_file() {
echo "$ALTERNC_LOC/bind/zones/$1"
echo "/var/lib/alternc/bind/zones/$1"
}
dns_is_locked() {

View File

@ -5,8 +5,8 @@
TEMPLATE_DIR="/etc/alternc/templates/apache2"
HOSTING_DIR="/etc/alternc/functions_hosting"
HTML_HOME="$ALTERNC_LOC/html"
VHOST_DIR="$ALTERNC_LOC/apache-vhost"
HTML_HOME="$ALTERNC_HTML"
VHOST_DIR="/var/lib/alternc/apache-vhost"
launch_hooks() {
local ACTION=$1

View File

@ -32,7 +32,7 @@ echo $QUOTA_PART
if [ -z "$QUOTA_PART" ]; then
`sudo $QUOTA -r -g $MID $SIZE $SIZE 0 0 $DATA_PART 2>/dev/null || echo "Group quota are not enabled on $ALTERNC_HTML." >&2`
else
`sudo $QUOTA -r -g $MID $SIZE $SIZE 0 0 "$ALTERNC_LOC/html" 2>/dev/null || echo "Group quota are not enabled on $ALTERNC_HTML." >&2`
`sudo $QUOTA -r -g $MID $SIZE $SIZE 0 0 "$ALTERNC_HTML" 2>/dev/null || echo "Group quota are not enabled on $ALTERNC_HTML." >&2`
fi

View File

@ -25,7 +25,7 @@ command -v $QUOTA >/dev/null || { echo "Quotas uninstalled"; exit 0; }
# the bigger one, and if someone separate it we need to look this one
# particulary. It should be interesting to cumulate quota of all mounted directory.
DATA_PART=`$DF "${ALTERNC_LOC}/html" 2>/dev/null | $AWK 'NR==2 { print $1 }'`
DATA_PART=`$DF "${ALTERNC_HTML}" 2>/dev/null | $AWK 'NR==2 { print $1 }'`
# quota will give over NFS will print the partition using the full NFS name
# (e.g. 10.0.0.1:/var/www/alternc) so we need to lookup first with mount

View File

@ -5,7 +5,7 @@
FLAGFILE="/var/run/alternc/refresh_slave";
TPL="/etc/alternc/templates/bind/slaveip.conf"
TARGET="/var/alternc/bind/slaveip.conf"
TARGET="/var/lib/alternc/bind/slaveip.conf"
TMP=$(mktemp /tmp/slaveip.conf.XXXX)
if [ ! -e "$FLAGFILE" ] ; then

View File

@ -16,7 +16,7 @@ done
# Some vars
umask 022
LOCK_FILE="$ALTERNC_LOC/bureau/cron.lock"
LOCK_FILE="/usr/share/alternc/panel/cron.lock" # FIXME doesn't seem clean to be here
OLDIFS="$IFS"
NEWIFS=" "
LOGFORMAT_FILE="/etc/alternc/apache_logformat.conf"

View File

@ -20,7 +20,7 @@ if [ $# -eq 1 ];then
else
#Fist we set the quotas no 0 (infinite for each already existing account
t=`mysql_query "UPDATE mailbox SET quota='0' WHERE quota IS NULL"`
d=`find "$ALTERNC_LOC/mail/" -maxdepth 2 -mindepth 2 -type d`
d=`find "$ALTERNC_MAIL/" -maxdepth 2 -mindepth 2 -type d`
fi