diff options
-rwxr-xr-x | installer/opengnsys_installer.sh | 19 | ||||
-rw-r--r-- | server/etc/apache-prev2.4.conf.tmpl | 12 | ||||
-rw-r--r-- | server/etc/apache.conf.tmpl | 5 |
3 files changed, 28 insertions, 8 deletions
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 + +<Directory CONSOLEDIR> + Options -Indexes FollowSymLinks + DirectoryIndex index.php +</Directory> + 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 <Directory CONSOLEDIR> - Options -Indexes +FollowSymLinks - DirectoryIndex index.php + Require all granted + Options -Indexes +FollowSymLinks + DirectoryIndex index.php </Directory> |