Override file 000-dehydrated.conf even if it exists yet.

This commit is contained in:
Christoph 2020-04-06 11:02:34 +02:00
parent fc889b5469
commit 38b620bcb3

View File

@ -375,33 +375,30 @@ if [[ -n "$APACHE_CONF_DIR" ]]; then
_apache_dh_conf_file=${APACHE_CONF_DIR}/000-dehydrated.conf _apache_dh_conf_file=${APACHE_CONF_DIR}/000-dehydrated.conf
echononl " Configure Apache Webserver: Create alias for WELL-KNOWN Directory.." echononl " Configure Apache Webserver: Create alias for WELL-KNOWN Directory.."
if [[ -f "$_apache_dh_conf_file" ]] ; then if [[ -x "$apache_control_script" ]] && $apache_control_script -M 2> /dev/null | grep -q version_module > /dev/null 2>&1 ; then
echo_skipped cat << EOF > $_apache_dh_conf_file
else Alias /.well-known/acme-challenge ${DH_WELL_KNOWN_DIR}/
if [[ -x "$apache_control_script" ]] && $apache_control_script -M 2> /dev/null | grep -q version_module > /dev/null 2>&1 ; then
cat << EOF > $_apache_dh_conf_file
Alias /.well-known/acme-challenge /var/www/dehydrated/
<Directory /var/www/dehydrated/> <Directory /var/www/dehydrated/>
Options +FollowSymLinks Options +FollowSymLinks
AllowOverride None AllowOverride None
<IfVersion < 2.4> <IfVersion < 2.4>
Order allow,deny Order allow,deny
Allow from all Allow from all
</IfVersion> </IfVersion>
<IfVersion >= 2.4> <IfVersion >= 2.4>
Require all granted Require all granted
Satisfy Any Satisfy Any
</IfVersion> </IfVersion>
</Directory> </Directory>
EOF EOF
if [[ $? -eq 0 ]] ; then if [[ $? -eq 0 ]] ; then
echo_ok echo_ok
else
echo_failed
fi
else else
cat << EOF > $_apache_dh_conf_file echo_failed
fi
else
cat << EOF > $_apache_dh_conf_file
Alias /.well-known/acme-challenge ${DH_WELL_KNOWN_DIR}/ Alias /.well-known/acme-challenge ${DH_WELL_KNOWN_DIR}/
# - Notice: # - Notice:
@ -411,20 +408,19 @@ Alias /.well-known/acme-challenge ${DH_WELL_KNOWN_DIR}/
# - Allow from all # - Allow from all
# - # -
<Directory /var/www/dehydrated/> <Directory /var/www/dehydrated/>
Options +FollowSymLinks Options +FollowSymLinks
AllowOverride None AllowOverride None
Require all granted Require all granted
Satisfy Any Satisfy Any
</Directory> </Directory>
EOF EOF
if [[ $? -eq 0 ]] ; then if [[ $? -eq 0 ]] ; then
echo_ok echo_ok
else else
echo_failed echo_failed
fi
fi fi
apache_config_changed=true
fi fi
apache_config_changed=true
if $_set_apache_conf_symlink ; then if $_set_apache_conf_symlink ; then
echononl " Activate \"000-dehydrated.conf\" .. " echononl " Activate \"000-dehydrated.conf\" .. "