install_roundcube.sh: fis error creating vhost configuration.
This commit is contained in:
parent
d734611fa6
commit
7775ae21c6
@ -1244,7 +1244,7 @@ if $_create_vhost_config ; then
|
||||
cat <<EOF > ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file
|
||||
# -- $WEBSITE_NAME -- #
|
||||
|
||||
<VirtualHost ${_vhost_ip_string_80}:80>
|
||||
<VirtualHost ${_vhost_ip_string_80}>
|
||||
|
||||
ServerAdmin $WEBMASTER_EMAIL
|
||||
|
||||
@ -1260,19 +1260,19 @@ if $_create_vhost_config ; then
|
||||
</VirtualHost>
|
||||
|
||||
|
||||
<VirtualHost ${_vhost_ip_string_443}:443>
|
||||
<VirtualHost ${_vhost_ip_string_443}>
|
||||
|
||||
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 <<EOF >> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file
|
||||
if [[ "$PHP_TYPE" = "mod_php" ]] ; then
|
||||
cat <<EOF >> ${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 <<EOF >> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file
|
||||
if [[ $? -ne 0 ]]; then
|
||||
failed=true
|
||||
fi
|
||||
elif [[ "$PHP_TYPE" = "fcgid" ]]; then
|
||||
cat <<EOF >> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file
|
||||
DocumentRoot "${WEBSITE_BASEDIR}/htdocs/"
|
||||
<Directory "${WEBSITE_BASEDIR}/htdocs">
|
||||
Require all granted
|
||||
@ -1301,40 +1301,40 @@ elif [[ "$PHP_TYPE" = "fcgid" ]]; then
|
||||
Options +ExecCGI
|
||||
</Directory>
|
||||
EOF
|
||||
if [[ $? -ne 0 ]]; then
|
||||
failed=true
|
||||
fi
|
||||
elif [[ "$PHP_TYPE" = "php_fpm" ]]; then
|
||||
cat <<EOF >> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file
|
||||
if [[ $? -ne 0 ]]; then
|
||||
failed=true
|
||||
fi
|
||||
elif [[ "$PHP_TYPE" = "php_fpm" ]]; then
|
||||
cat <<EOF >> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file
|
||||
DocumentRoot "${WEBSITE_BASEDIR}/htdocs/"
|
||||
|
||||
<FilesMatch \.php$>
|
||||
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 <<EOF >> ${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 <<EOF >> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file
|
||||
SetHandler "proxy:unix:${php_socket_file}|fcgi://127.0.0.1"
|
||||
EOF
|
||||
else
|
||||
cat <<EOF >> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file
|
||||
else
|
||||
cat <<EOF >> ${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 <<EOF >> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file
|
||||
fi
|
||||
cat <<EOF >> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file
|
||||
</FilesMatch>
|
||||
|
||||
<IfModule dir_module>
|
||||
DirectoryIndex index.php index.html
|
||||
</IfModule>
|
||||
EOF
|
||||
if [[ $? -ne 0 ]]; then
|
||||
failed=true
|
||||
if [[ $? -ne 0 ]]; then
|
||||
failed=true
|
||||
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
|
||||
@ -1441,8 +1441,9 @@ cat <<EOF >> ${APACHE_VHOST_DIR}/${WEBSITE_NAME}.conf 2>> $log_file
|
||||
</VirtualHost>
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user