sábado, 18 de enero de 2014

Install OpenERP7 in Linux with HTTPS (Instalar OpenERP7 en Linux con HTTPS)

Is the time to upgrade. Ok, i will change many things. Conclude with Ubuntu and only use Debian. Continued...
Es la hora de actualizarse. Ok, voy a cambiar muchas cosas. Termino con Ubuntu y sólo usaremos Debian. Continuamos...

The new version has changed many things, easier installation. (in previous post Instalar OpenERP 6 de un golpe):
La nueva versión a cambiado muchas cosas, una instalación más sencilla. (en post anteriores Instalar OpenERP 6 de un golpe):

Add in /etc/apt/sources.list
echo "deb http://nightly.openerp.com/7.0/nightly/deb/ ./" >> /etc/apt/sources.list
sudo apt-get update; sudo apt-get install openerp

And wait...
sudo service openerp start

We can see the log, while loading
Podemos ver el log, mientras carga
watch tail /var/log/openerp/openerp-server.log

When loaded, configure the HTTPS
Cuando esté cargado, configuramos el HTTPS
First, we block the default port 8069
Primero, bloqueamos el puerto por defecto 8069
sudo iptables -A INPUT -i eth0 -p tcp --destination-port 8069 -j DROP

Second, we create the SSL
Segundo, creamos el SSL
#need these packages
sudo aptitude install apache2
sudo a2enmod ssl proxy_http headers rewrite

#Create de certificate
sudo mkdir /etc/ssl/openerp
cd /etc/ssl/openerp
openssl genrsa -des3 -out openERPserver.pkey 1024
openssl rsa -in openERPserver.pkey -out openERPserver.key
openssl req -new -key openERPserver.key -out openERPserver.csr

openssl x509 -req -days 365 -in openERPserver.csr -signkey openERPserver.key -out openERPserver.crt

Now we need to configure Apache to use SSL with openERP.
Ahora tenemos que configurar apache para que use SSL con openERP.
#Create the openerp file withthis content
sudo nano /etc/apache2/sites-available/openerp

#openerp file

       SSLEngine on
       SSLCertificateFile /etc/ssl/openerp/oeserver.crt
       SSLCertificateKeyFile /etc/ssl/openerp/oeserver.key

       ProxyRequests Off

       
              Order deny,allow
              Allow from all
       

       ProxyVia On
       ProxyPass / http://127.0.0.1:8069/

       
              ProxyPassReverse /
       

       RequestHeader set “X-Forwarded-Proto” “https”

       SetEnv proxy-nokeepalive 1

And finally we enable our configuration
Ya por último habilitamos nuestra configuración
sudo a2ensite openerp

We have already completed. Now run
Ya hemos finalizado. Ahora ejecutamos
https://ipservidor