install_roundcube.sh: fis error creating vhost configuration.

This commit is contained in:
Christoph 2019-11-13 23:03:38 +01:00
parent d734611fa6
commit 7775ae21c6

View File

@ -1244,7 +1244,7 @@ if $_create_vhost_config ; then
cat <<EOF > ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file cat <<EOF > ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file
# -- $WEBSITE_NAME -- # # -- $WEBSITE_NAME -- #
<VirtualHost ${_vhost_ip_string_80}:80> <VirtualHost ${_vhost_ip_string_80}>
ServerAdmin $WEBMASTER_EMAIL ServerAdmin $WEBMASTER_EMAIL
@ -1260,18 +1260,18 @@ if $_create_vhost_config ; then
</VirtualHost> </VirtualHost>
<VirtualHost ${_vhost_ip_string_443}:443> <VirtualHost ${_vhost_ip_string_443}>
ServerAdmin $WEBMASTER_EMAIL ServerAdmin $WEBMASTER_EMAIL
ServerName $WEBSITE_NAME ServerName $WEBSITE_NAME
EOF EOF
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
failed=true failed=true
fi fi
if [[ "$PHP_TYPE" = "mod_php" ]] ; then if [[ "$PHP_TYPE" = "mod_php" ]] ; then
cat <<EOF >> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file cat <<EOF >> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file
## - its allowed to overwrite by .htaccess ## - its allowed to overwrite by .htaccess
## - ## -
@ -1289,7 +1289,7 @@ EOF
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
failed=true failed=true
fi fi
elif [[ "$PHP_TYPE" = "fcgid" ]]; then elif [[ "$PHP_TYPE" = "fcgid" ]]; then
cat <<EOF >> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file cat <<EOF >> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file
DocumentRoot "${WEBSITE_BASEDIR}/htdocs/" DocumentRoot "${WEBSITE_BASEDIR}/htdocs/"
<Directory "${WEBSITE_BASEDIR}/htdocs"> <Directory "${WEBSITE_BASEDIR}/htdocs">
@ -1304,7 +1304,7 @@ EOF
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
failed=true failed=true
fi fi
elif [[ "$PHP_TYPE" = "php_fpm" ]]; then elif [[ "$PHP_TYPE" = "php_fpm" ]]; then
cat <<EOF >> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file cat <<EOF >> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file
DocumentRoot "${WEBSITE_BASEDIR}/htdocs/" DocumentRoot "${WEBSITE_BASEDIR}/htdocs/"
@ -1333,8 +1333,8 @@ EOF
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
failed=true failed=true
fi fi
fi fi
cat <<EOF >> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file cat <<EOF >> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file
# ========== # ==========
# - HTTP security Headers # - HTTP security Headers
@ -1441,8 +1441,9 @@ cat <<EOF >> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file
</VirtualHost> </VirtualHost>
EOF EOF
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
_failed=true _failed=true
fi
fi fi
if $_failed ; then if $_failed ; then
echo_failed echo_failed
@ -1497,6 +1498,7 @@ echononl "\tRestart Apache Webservice.."
if [[ -n "$APACHE_SERVICE_FILE" ]] || [[ -n "$APACHE_INIT_SCRIPT" ]] ; then if [[ -n "$APACHE_SERVICE_FILE" ]] || [[ -n "$APACHE_INIT_SCRIPT" ]] ; then
if [[ -n "$APACHE_SERVICE_FILE" ]] ; then if [[ -n "$APACHE_SERVICE_FILE" ]] ; then
systemctl restart $APACHE_SERVICE_FILE > $log_file 2>&1 systemctl restart $APACHE_SERVICE_FILE > $log_file 2>&1
echo "systemctl restart $APACHE_SERVICE_FILE > $log_file 2>&1"
else else
$APACHE_INIT_SCRIPT restart > $log_file 2>&1 $APACHE_INIT_SCRIPT restart > $log_file 2>&1
fi fi