summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2014-04-16 11:11:16 +0000
committerramon <ramongomez@us.es>2014-04-16 11:11:16 +0000
commitf9e3393845ded1cf93f61277ae3b2e9348e14c9a (patch)
tree33eb2ba3614b471738e3834aa62f20bbf270749f
parentb97f2dc35edde578a0802b50615b1edcf0c899bf (diff)
#616: Instalador compatible con configuración de Apache 2.4 y de versiones anteriores.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4237 a21b9725-9963-47de-94b9-378ad31fedc9
-rwxr-xr-xinstaller/opengnsys_installer.sh19
-rw-r--r--server/etc/apache-prev2.4.conf.tmpl12
-rw-r--r--server/etc/apache.conf.tmpl5
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>