Change name of configuration file to 'create_vhost.conf'.

This commit is contained in:
Christoph 2018-04-20 02:44:54 +02:00
parent afdb4bf7ff
commit c3a13d935e

View File

@ -273,10 +273,10 @@ CREATE_SYMLINK_WEB_BASE_DIR=false
# --- # ---
script_base_dir="$(realpath $(dirname $0))" script_base_dir="$(realpath $(dirname $0))"
conf_file="${script_base_dir}/conf/create_vhost_php.conf" conf_file="${script_base_dir}/conf/create_vhost.conf"
echo "" echo ""
echononl "\tInclude Configuration file.." echononl "\tInclude Configuration file '$conf_file'.."
if [[ ! -f $conf_file ]]; then if [[ ! -f $conf_file ]]; then
echo_skipped echo_skipped
else else
@ -2042,8 +2042,16 @@ EOF
RewriteEngine on RewriteEngine on
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/ RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
EOF
if $_https_only ; then
cat <<EOF >> ${_new_vhost_config_file}
RewriteRule (.*) https://${rewrite_url} [R=301,L]
EOF
else
cat <<EOF >> ${_new_vhost_config_file}
RewriteRule (.*) http://${rewrite_url} [R=301,L] RewriteRule (.*) http://${rewrite_url} [R=301,L]
EOF EOF
fi
if [ -n "$_custom_ip_log" ]; then if [ -n "$_custom_ip_log" ]; then
cat <<EOF >> ${_new_vhost_config_file} cat <<EOF >> ${_new_vhost_config_file}
@ -2834,7 +2842,6 @@ fi
for _alias in "${_server_aliases_arr[@]}" ; do for _alias in "${_server_aliases_arr[@]}" ; do
cat <<EOF >> ${_new_vhost_config_file} cat <<EOF >> ${_new_vhost_config_file}
# --- $_alias # --- $_alias
EOF EOF
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
_failed=true _failed=true
@ -2842,10 +2849,12 @@ EOF
done done
if [ "$_ipv6" != "disabled" ]; then if [ "$_ipv6" != "disabled" ]; then
cat <<EOF >> ${_new_vhost_config_file} cat <<EOF >> ${_new_vhost_config_file}
<VirtualHost $_ipv4:80 [$_ipv6]:80> <VirtualHost $_ipv4:80 [$_ipv6]:80>
EOF EOF
else else
cat <<EOF >> ${_new_vhost_config_file} cat <<EOF >> ${_new_vhost_config_file}
<VirtualHost $_ipv4:80> <VirtualHost $_ipv4:80>
EOF EOF
fi fi