Installation de Odoo 8 sur Debian 7 - Qui suis je ?
Transcription
Installation de Odoo 8 sur Debian 7 - Qui suis je ?
Installation de Odoo 8 sur Debian 7 Odoo (ex-OpenERP) est sorti il n'y a pas très longtemps en version 8. Sauf que la documentation sur leur site n'est pas très à jour... Je vous partage donc la procédure que j'ai suivie pour une installation sur Debian 7. On commence par l'installation de PostgreSQL : # apt-get install postgresql Ensuite on créer un utilisateur pour la base de données : # su postgres # psql # CREATE USER odoo WITH PASSWORD 'odoo'; # CREATE DATABASE odoo OWNER odoo; # ALTER USER odoo CREATEDB; # \q On test si la connexion à la base fonctionne : # psql -U odoo -W odoo -h localhost # \q # exit De retour sous l'utilisateur root, on ajoute le dépôt de Odoo en entrant la ligne suivante dans le fichier `/etc/apt/sources.list.d/odoo.list` : deb http://nightly.odoo.com/8.0/nightly/deb/ ./ On met à jour la liste des paquets : # apt-get update On installe les pré-requis : # apt-get install python-dateutil python-feedparser python-gdata python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi On installe enfin Odoo : # apt-get install odoo On modifie le fichier `/etc/odoo/openerp-server.conf` pour ressembler à ça : [options] ; This is the password that allows database operations: admin_passwd = your_super_dbadmin_password db_host = localhost db_port = False db_user = odoo db_password = odoo addons_path = /usr/lib/python2.7/dist-packages/openerp/addons On redémarre ensuite le service Odoo : # service odoo restart Et voilà, votre installation devrait être accessible via l'URL : http://adresse-ip:8069/ Pour éviter à vos utilisateurs d'avoir à entrer le numéro de port dans l'URL, il est possible d'installer et configurer Apache en tant que reverse proxy. # apt-get install apache2 # a2enmod proxy_http # service apache2 restart Il faut ensuite créer un fichier `/etc/apache2/sites-available/odoo.conf` comme ce qui suit (à adapter selon votre configuration) : <VirtualHost *:80> ServerAdmin [email protected] ServerName odoo.domaine.com ServerAlias odoo.domaine.com ProxyPass / http://localhost:8069/ ProxyPassReverse / http://localhost:8069/ ErrorLog ${APACHE_LOG_DIR}/error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> On active maintenant le site et recharge la configuration de Apache : # a2ensite odoo.conf # service apache2 reload Et si maintenant, pour des raisons évidentes de sécurité on veut forcer la connexion en HTTPS, il suffit faut activer le module de rewriting : # a2enmod rewrite Ensuite on met la configuration suivante dans le fichier `/etc/apache2/sites-available/odoo.conf` : <VirtualHost *:80> ServerAdmin [email protected] ServerName odoo.domaine.com ServerAlias odoo.domaine.com RewriteEngine on RewriteRule ^(.*) https://odoo.domaine.com$1 [R=301] ErrorLog ${APACHE_LOG_DIR}/error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> <IfModule mod_ssl.c> <VirtualHost *:443> ServerAdmin [email protected] ServerName odoo.wearehein.com ServerAlias odoo.wearehein.com ProxyPass / http://localhost:8069/ ProxyPassReverse / http://localhost:8069/ ErrorLog ${APACHE_LOG_DIR}/error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined SSLEngine on SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory /usr/lib/cgi-bin> SSLOptions +StdEnvVars </Directory> BrowserMatch "MSIE [2-6]" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown </VirtualHost> </IfModule> On active maintenant le site (si ce n'est pas déjà fait) et redémarre Apache : # a2ensite odoo.conf # service apache2 restart Voilà, votre installation de Odoo devrait être accessible en HTTPS avec une belle URL.