Fix IncludeOptional that can throw syntax errors in some cases.
With Apache < 2.4.30, IncludeOptional will throw syntax errors if the file designated without any pattern globbing is absent. We circumvent that with a silly pattern.
This commit is contained in:
parent
b148cf1176
commit
f7659cee6d
|
@ -8,7 +8,9 @@
|
|||
DocumentRoot HOME_DIR/XXX/www/
|
||||
|
||||
# SSL
|
||||
IncludeOptional /etc/apache2/ssl/XXX.conf
|
||||
# Apache < 2.4.30 (Jessie, Stretch) va générer une erreur si le fichier
|
||||
# désigné sans regex n'existe pas. On contourne ça avec [f] à place de f
|
||||
IncludeOptional /etc/apache2/ssl/XXX.con[f]
|
||||
|
||||
# Propriete du repertoire
|
||||
<Directory HOME_DIR/XXX/www/>
|
||||
|
@ -67,4 +69,3 @@
|
|||
#php_value default_charset ISO-8859-15
|
||||
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f www-XXX"
|
||||
php_admin_value open_basedir "/usr/share/php:HOME_DIR/XXX:/tmp"
|
||||
|
||||
|
|
|
@ -438,6 +438,9 @@ EOT
|
|||
|
||||
random=$RANDOM
|
||||
if [ "$WEB_SERVER" == "apache" ]; then
|
||||
# On s'assure que /etc/apache2/ssl pour le IncludeOptional de la conf
|
||||
mkdir -p /etc/apache2/ssl
|
||||
|
||||
vhostfile="/etc/apache2/sites-available/${in_login}.conf"
|
||||
sed -e "s/XXX/$in_login/g ; s/SERVERNAME/$in_wwwdomain/ ; s/RANDOM/$random/ ; s#HOME_DIR#$HOME_DIR#" < $TPL_VHOST > "$vhostfile"
|
||||
|
||||
|
|
Loading…
Reference in a new issue