Browse Source

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.
master-fix-48033
Ludovic Poujol 1 year ago
parent
commit
f7659cee6d
2 changed files with 7 additions and 3 deletions
  1. +4
    -3
      scripts/vhost
  2. +3
    -0
      scripts/web-add.sh

+ 4
- 3
scripts/vhost View File

@ -8,8 +8,10 @@
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/>
#Options +Indexes +SymLinksIfOwnerMatch
@ -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"

+ 3
- 0
scripts/web-add.sh View File

@ -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…
Cancel
Save