Compare commits

...

8 Commits
master ... ssl

3 changed files with 56 additions and 18 deletions

View File

@ -1,9 +1,11 @@
<VirtualHost *:80>
<VirtualHost *:80 *:443>
# FQDN principal
ServerName SERVERNAME
#ServerAlias SERVERNAME
Include /etc/apache2/ssl/XXX.conf
# Repertoire principal
DocumentRoot HOME_DIR/XXX/www/
@ -48,8 +50,9 @@
# REWRITE
UseCanonicalName On
RewriteEngine On
RewriteCond %{HTTP_HOST} !^SERVERNAME$
RewriteRule ^/(.*) http://%{SERVER_NAME}/$1 [L,R]
RewriteCond %{HTTP_HOST} !^SERVERNAME$ [OR]
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]
# PHP
#php_admin_flag engine off
@ -65,4 +68,4 @@
php_admin_value error_log "HOME_DIR/XXX/log/php.log"
php_admin_value open_basedir "/usr/share/php:HOME_DIR/XXX:/tmp"
</VirtualHost>
</VirtualHost>

View File

@ -90,6 +90,10 @@ del-alias VHOST ALIAS
Del a ServerAlias from an Apache vhost
ssl VHOST
Update SSL for Apache VHOST
EOT
}
@ -251,7 +255,7 @@ create_www_account() {
random=$RANDOM
vhostfile="/etc/apache2/sites-available/${in_login}.conf"
cat $TPL_VHOST | \
sed -e "s/XXX/$in_login/g ; s/SERVERNAME/$in_wwwdomain/ ; s/RANDOM/$random/ ; s#HOME_DIR#$HOME_DIR#" >$vhostfile
@ -263,6 +267,8 @@ create_www_account() {
a2ensite $in_login >/dev/null
yes|make-csr ${in_login}
step_ok "Configuration d'Apache"
############################################################################
@ -328,12 +334,27 @@ create_www_account() {
step_ok "Rechargement d'Apache"
set +e
evoacme $in_login
set -e
############################################################################
DATE=$(date +"%Y-%m-%d")
echo "$DATE [web-add.sh] Ajout $in_login" >> /var/log/evolix.log
}
op_ssl() {
if [ $# -lt 1 ]; then
usage
exit 1
else
yes|make-csr $1
set +e
evoacme $1
set -e
fi
}
op_del() {
if [ $# -lt 1 ]; then
usage
@ -370,6 +391,7 @@ op_del() {
sed -i.bak "/-config=$login /d" /etc/cron.d/awstats
apache2ctl configtest
set +x
rm -f $CRT_DIR/${login}* $KEY_DIR/${login}.key $CSR_DIR/${login}.csr $AUTO_CRT_DIR/${login}.pem
if [ -n "$dbname" ]; then
echo "Deleting mysql DATABASE $dbname and mysql user $login. Continue ?"
@ -406,6 +428,9 @@ arg_processing() {
;;
del-alias)
op_aliasdel $*
;;
ssl)
op_ssl $*
;;
*)
usage
@ -443,6 +468,10 @@ op_aliasadd() {
[ -f $VHOST_PATH/$vhost ] && sed -i -e "s/\(ServerName .*\)/\1\n\tServerAlias $alias/" $VHOST_PATH/$vhost --follow-symlinks
yes|make-csr $1
set +e
evoacme $1
set -e
apache2ctl configtest 2>/dev/null
/etc/init.d/apache2 force-reload >/dev/null
@ -457,6 +486,10 @@ op_aliasdel() {
[ -f $VHOST_PATH/$vhost ] && sed -i -e "/ServerAlias $alias/d" $VHOST_PATH/$vhost --follow-symlinks
yes|make-csr $1
set +e
evoacme $1
set -e
apache2ctl configtest 2>/dev/null
/etc/init.d/apache2 force-reload >/dev/null

View File

@ -22,19 +22,21 @@
<thead>
<tr>
<?php if(is_superadmin()) {
print '<th>Propriétaire</th>';
} ?>
<th>Domaine</th>
<!--<th>Opérations</th>-->
<?php if($conf['cluster']) { ?>
<th>Bdd</th>
<th>Mail</th>
<th>Replication</th>
<th>Master</th>
<th>Slave</th>
<?php if(is_superadmin()) {
print '<th>Alias</th>';
}} ?>
printf('<th>Propriétaire</th>');
printf('<th>Domaine</th>');
}
if($conf['cluster']) {
printf('<th>Bdd</th>');
printf('<th>Mail</th>');
printf('<th>Replication</th>');
printf('<th>Master</th>');
printf('<th>Slave</th>');
}
printf('<th>Alias</th>');
if(is_superadmin()) {
printf('<th>Opérations</th>');
}
?>
<tr>
</thead>
<tbody>