From f9e3393845ded1cf93f61277ae3b2e9348e14c9a Mon Sep 17 00:00:00 2001 From: ramon Date: Wed, 16 Apr 2014 11:11:16 +0000 Subject: #616: Instalador compatible con configuración de Apache 2.4 y de versiones anteriores. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://opengnsys.es/svn/branches/version1.0@4237 a21b9725-9963-47de-94b9-378ad31fedc9 --- installer/opengnsys_installer.sh | 19 +++++++++++++------ server/etc/apache-prev2.4.conf.tmpl | 12 ++++++++++++ server/etc/apache.conf.tmpl | 5 +++-- 3 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 server/etc/apache-prev2.4.conf.tmpl diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh index b20177c3..eecd5745 100755 --- a/installer/opengnsys_installer.sh +++ b/installer/opengnsys_installer.sh @@ -1099,8 +1099,8 @@ function installWebConsoleApacheConf() exit 1 fi - local path_opengnsys_base=$1 - local path_apache2_confd=$2 + local path_opengnsys_base="$1" + local path_apache2_confd="$2" local CONSOLEDIR=${path_opengnsys_base}/www if [ ! -d $path_apache2_confd ]; then @@ -1118,10 +1118,17 @@ function installWebConsoleApacheConf() $APACHEMAKECERT # Genera configuración de consola web a partir del fichero plantilla. - sed -e "s/CONSOLEDIR/${CONSOLEDIR//\//\\/}/g" \ - $WORKDIR/opengnsys/server/etc/apache.conf.tmpl > $path_opengnsys_base/etc/apache.conf - - ln -fs $path_opengnsys_base/etc/apache.conf $path_apache2_confd/$APACHESITESDIR/${APACHEOGSITE}.conf + if [ -n "$(apachectl -v | grep "2\.[0-2]")" ]; then + # Configuración para versiones anteriores de Apache. + sed -e "s/CONSOLEDIR/${CONSOLEDIR//\//\\/}/g" \ + $WORKDIR/opengnsys/server/etc/apache-prev2.4.conf.tmpl > $path_opengnsys_base/etc/apache.conf + ln -fs $path_opengnsys_base/etc/apache.conf $path_apache2_confd/$APACHESITESDIR/${APACHEOGSITE} + else + # Configuración específica a partir de Apache 2.4 + sed -e "s/CONSOLEDIR/${CONSOLEDIR//\//\\/}/g" \ + $WORKDIR/opengnsys/server/etc/apache.conf.tmpl > $path_opengnsys_base/etc/apache.conf + ln -fs $path_opengnsys_base/etc/apache.conf $path_apache2_confd/$APACHESITESDIR/${APACHEOGSITE}.conf + fi $APACHEENABLEOG if [ $? -ne 0 ]; then errorAndLog "${FUNCNAME}(): config file can't be linked to apache conf, verify your server installation" diff --git a/server/etc/apache-prev2.4.conf.tmpl b/server/etc/apache-prev2.4.conf.tmpl new file mode 100644 index 00000000..474ea62a --- /dev/null +++ b/server/etc/apache-prev2.4.conf.tmpl @@ -0,0 +1,12 @@ +# OpenGnSys Web Console template configuration for Apache. + +Alias /opengnsys CONSOLEDIR + +# Overrides default CentOS php.ini configuration. +php_value short_open_tag on + + + Options -Indexes FollowSymLinks + DirectoryIndex index.php + + diff --git a/server/etc/apache.conf.tmpl b/server/etc/apache.conf.tmpl index 1bf6d2c6..5613bf11 100644 --- a/server/etc/apache.conf.tmpl +++ b/server/etc/apache.conf.tmpl @@ -6,7 +6,8 @@ Alias /opengnsys CONSOLEDIR php_value short_open_tag on - Options -Indexes +FollowSymLinks - DirectoryIndex index.php + Require all granted + Options -Indexes +FollowSymLinks + DirectoryIndex index.php -- cgit v1.2.3-18-g5258