summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2019-04-11 13:49:15 +0200
committerRamón M. Gómez <ramongomez@us.es>2019-04-11 13:49:15 +0200
commit348641fa2a241d606be10f220bffab6e75509abb (patch)
treec81aed84f9fa81d12ad27bf4859fb9833babc154
parent94a9a0d0c3945f3f9bf69e8fff22659dc3e090d0 (diff)
#761: Fixing some bugs when upgrading to the new web console.
-rw-r--r--admin/WebConsole3/backend/src/Opengnsys/MigrationBundle/Resources/config/doctrine/Repositorios.orm.xml11
-rw-r--r--admin/WebConsole3/backend/src/Opengnsys/ServerBundle/Resources/config/doctrine/Repository.orm.xml2
-rwxr-xr-xinstaller/opengnsys_update.sh13
-rw-r--r--server/etc/apache-console3.conf.tmpl9
4 files changed, 19 insertions, 16 deletions
diff --git a/admin/WebConsole3/backend/src/Opengnsys/MigrationBundle/Resources/config/doctrine/Repositorios.orm.xml b/admin/WebConsole3/backend/src/Opengnsys/MigrationBundle/Resources/config/doctrine/Repositorios.orm.xml
index 78217dc7..8d67960e 100644
--- a/admin/WebConsole3/backend/src/Opengnsys/MigrationBundle/Resources/config/doctrine/Repositorios.orm.xml
+++ b/admin/WebConsole3/backend/src/Opengnsys/MigrationBundle/Resources/config/doctrine/Repositorios.orm.xml
@@ -15,12 +15,6 @@
<option name="default"/>
</options>
</field>
- <field name="passguor" type="string" column="passguor" length="50" nullable="false">
- <options>
- <option name="fixed"/>
- <option name="default"/>
- </options>
- </field>
<field name="idcentro" type="integer" column="idcentro" nullable="true">
<options>
<option name="unsigned"/>
@@ -36,11 +30,6 @@
<option name="fixed"/>
</options>
</field>
- <field name="puertorepo" type="integer" column="puertorepo" nullable="false">
- <options>
- <option name="unsigned"/>
- </options>
- </field>
<field name="apikey" type="string" column="apikey" length="32" nullable="false">
<options>
<option name="fixed"/>
diff --git a/admin/WebConsole3/backend/src/Opengnsys/ServerBundle/Resources/config/doctrine/Repository.orm.xml b/admin/WebConsole3/backend/src/Opengnsys/ServerBundle/Resources/config/doctrine/Repository.orm.xml
index 26995030..9036c2cd 100644
--- a/admin/WebConsole3/backend/src/Opengnsys/ServerBundle/Resources/config/doctrine/Repository.orm.xml
+++ b/admin/WebConsole3/backend/src/Opengnsys/ServerBundle/Resources/config/doctrine/Repository.orm.xml
@@ -15,7 +15,7 @@
<field name="configurationpath" type="string" column="configurationpath" length="250" nullable="false"/>
<field name="adminpath" type="string" column="adminpath" length="250" nullable="false"/>
<field name="pxepath" type="string" column="pxepath" length="250" nullable="false"/>
- <field name="port" type="integer" column="port" nullable="false"/>
+ <field name="port" type="integer" column="port" nullable="true"/>
<field name="description" type="text" column="description" nullable="true"/>
diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh
index f6ca9c2a..f74ef548 100755
--- a/installer/opengnsys_update.sh
+++ b/installer/opengnsys_update.sh
@@ -376,7 +376,7 @@ function installDependencies()
eval $UPDATEPKGLIST
if [ -f /etc/debian_version ]; then
# Basado en paquetes Deb.
- PHP7VERSION=$(apt-cache pkgnames php7 2>/dev/null | sort | head -1)
+ PHP7VERSION=$(apt-cache pkgnames php7 2>/dev/null | grep -v -- - | sort | tail -1)
PHPFPMSERV="${PHP7VERSION}-fpm"
PHP5PKGS=( $(dpkg -l | awk '$2~/^php5/ {print $2}') )
if [ -n "$PHP5PKGS" ]; then
@@ -567,8 +567,9 @@ function apacheConfiguration ()
fi
# Habilitar nueva web.
if [ ! -e $APACHECFGDIR/sites-available/opengnsys3.conf ]; then
- sed -e "s,CONSOLEDIR,$CONSOLEDIR,g" \
+ sed -e "s,CONSOLEDIR3,$INSTALL_TARGET/www3,g" \
$WORKDIR/opengnsys/server/etc/apache-console3.conf.tmpl > $APACHECFGDIR/sites-available/opengnsys3.conf
+ a2dissite opengnsys
a2ensite opengnsys3
fi
# Elegir plantilla según versión de Apache.
@@ -687,9 +688,10 @@ function updateWebFiles()
# Instalar dependencias y copiar ficheros de la nueva web de OpenGnsys 3.
function updateWeb3()
{
+ echoAndLog "${FUNCNAME}(): Installing OpenGnsys 3 Web Console..."
# Copiar ficheros.
mkdir -p $INSTALL_TARGET/www3
- cp -a $WORKDIR/admin/WebConsole3/{frontend,backend} $INSTALL_TARGET/www3
+ cp -a $WORKDIR/opengnsys/admin/WebConsole3/{frontend,backend} $INSTALL_TARGET/www3
# Instalar Composer.
if [ ! -f /usr/local/bin/composer.phar ]; then
@@ -701,6 +703,11 @@ function updateWeb3()
pushd $INSTALL_TARGET/www3/backend
composer.phar update
chmod 777 -R var/cache var/logs
+ echo "Enter MySQL root password: "
+ mysql -u root -p <<< "
+ CREATE DATABASE IF NOT EXISTS ${OPENGNSYS_DATABASE}3;
+ GRANT ALL PRIVILEGES ON ${OPENGNSYS_DATABASE}3.* TO $OPENGNSYS_DBUSER IDENTIFIED BY '$OPENGNSYS_DBPASSWORD';
+"
php app/console doctrine:database:create --if-not-exists
php app/console doctrine:schema:update --force
php app/console doctrine:fixtures:load
diff --git a/server/etc/apache-console3.conf.tmpl b/server/etc/apache-console3.conf.tmpl
index e4c4f8d6..91b61cfb 100644
--- a/server/etc/apache-console3.conf.tmpl
+++ b/server/etc/apache-console3.conf.tmpl
@@ -2,10 +2,17 @@
Alias /opengnsys/v3 CONSOLEDIR3
+# PHP-FPM configuration
+<IfModule proxy_fcgi_module>
+ <FilesMatch ".+\.ph(p[3457]?|t|tml)$">
+ SetHandler "proxy:fcgi://127.0.0.1:9000"
+ </FilesMatch>
+</IfModule>
+
RewriteEngine On
# Redirect HTTP to HTTPS and default configuration.
-<Directory CONSOLEDIR>
+<Directory CONSOLEDIR3>
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R]
Require all granted