From 7775ae21c62763f3c3173357407138d8cda40dc0 Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 13 Nov 2019 23:03:38 +0100 Subject: [PATCH] install_roundcube.sh: fis error creating vhost configuration. --- install_roundcube.sh | 68 +++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/install_roundcube.sh b/install_roundcube.sh index 5f487a2..76329ab 100755 --- a/install_roundcube.sh +++ b/install_roundcube.sh @@ -1244,7 +1244,7 @@ if $_create_vhost_config ; then cat < ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file # -- $WEBSITE_NAME -- # - + ServerAdmin $WEBMASTER_EMAIL @@ -1260,19 +1260,19 @@ if $_create_vhost_config ; then - + ServerAdmin $WEBMASTER_EMAIL ServerName $WEBSITE_NAME EOF -if [[ $? -ne 0 ]]; then - failed=true -fi + if [[ $? -ne 0 ]]; then + failed=true + fi -if [[ "$PHP_TYPE" = "mod_php" ]] ; then - cat <> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file + if [[ "$PHP_TYPE" = "mod_php" ]] ; then + cat <> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file ## - its allowed to overwrite by .htaccess ## - php_value error_reporting "E_ALL & ~E_NOTICE" @@ -1286,11 +1286,11 @@ if [[ "$PHP_TYPE" = "mod_php" ]] ; then DocumentRoot "${WEBSITE_BASEDIR}/htdocs/" EOF - if [[ $? -ne 0 ]]; then - failed=true - fi -elif [[ "$PHP_TYPE" = "fcgid" ]]; then - cat <> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file + if [[ $? -ne 0 ]]; then + failed=true + fi + elif [[ "$PHP_TYPE" = "fcgid" ]]; then + cat <> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file DocumentRoot "${WEBSITE_BASEDIR}/htdocs/" Require all granted @@ -1301,40 +1301,40 @@ elif [[ "$PHP_TYPE" = "fcgid" ]]; then Options +ExecCGI EOF - if [[ $? -ne 0 ]]; then - failed=true - fi -elif [[ "$PHP_TYPE" = "php_fpm" ]]; then - cat <> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file + if [[ $? -ne 0 ]]; then + failed=true + fi + elif [[ "$PHP_TYPE" = "php_fpm" ]]; then + cat <> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file DocumentRoot "${WEBSITE_BASEDIR}/htdocs/" EOF - if $PHP_DEBIAN_INSTALLATION ; then - php_socket_file="/run/php/php${php_major_version}-fpm.sock" - if [[ -S "/run/php$(echo $php_major_version | cut -d'.' -f1)-fpm.sock" ]]; then - php_socket_file="/run/php$(echo $php_major_version | cut -d'.' -f1)-fpm.sock" - fi - cat <> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file + if $PHP_DEBIAN_INSTALLATION ; then + php_socket_file="/run/php/php${php_major_version}-fpm.sock" + if [[ -S "/run/php$(echo $php_major_version | cut -d'.' -f1)-fpm.sock" ]]; then + php_socket_file="/run/php$(echo $php_major_version | cut -d'.' -f1)-fpm.sock" + fi + cat <> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file SetHandler "proxy:unix:${php_socket_file}|fcgi://127.0.0.1" EOF - else - cat <> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file + else + cat <> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file SetHandler "proxy:unix:/tmp/php-${php_latest_ver}-fpm.www.sock|fcgi://127.0.0.1" EOF - fi - cat <> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file + fi + cat <> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file DirectoryIndex index.php index.html EOF - if [[ $? -ne 0 ]]; then - failed=true + if [[ $? -ne 0 ]]; then + failed=true + fi fi -fi -cat <> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file + cat <> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file # ========== # - HTTP security Headers @@ -1441,8 +1441,9 @@ cat <> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file EOF -if [[ $? -ne 0 ]]; then - _failed=true + if [[ $? -ne 0 ]]; then + _failed=true + fi fi if $_failed ; then 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" ]] ; then systemctl restart $APACHE_SERVICE_FILE > $log_file 2>&1 + echo "systemctl restart $APACHE_SERVICE_FILE > $log_file 2>&1" else $APACHE_INIT_SCRIPT restart > $log_file 2>&1 fi