Go to Top

Installazione Odoo 8 su server Ubuntu 14.04 x64

Ecco una guida passo-passo per l’installazione di Odoo V8 su server Ubuntu 14.04 LTS x64

  1. Prima di tutto aggiorna il server
    sudo apt-get update
    sudo apt-get upgrade
  2. Installa python e le librerie necessarie
    sudo apt-get install python-dateutil python-decorator python-docutils python-feedparser python-gdata python-gevent python-imaging python-jinja2 python-ldap python-libxslt1 python-lxml python-mako python-mock python-openid python-passlib python-psutil python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-pypdf python-reportlab python-requests python-simplejson python-tz python-unittest2 python-vatnumber python-vobject python-werkzeug python-xlwt python-yaml python-matplotlib python-pychart python-webdav graphviz ghostscript postgresql-client
  3. Installa altre librerie
    sudo apt-get install gcc python-dev mc bzr python-setuptools python-babel python-reportlab-accel python-zsi python-openssl python-egenix-mxdatetime lptools make python-psutil python-paramiko poppler-utils python-pdftools antiword postgresql
  4. Installa librerie wkhtmltopdf (è richiesto da odoo)
    sudo wget http://sourceforge.net/projects/wkhtmltopdf/files/archive/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
    sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
    ln -s /usr/local/bin/wkhtmltopdf /usr/bin/wkhtmltopdf
    ln -s /usr/local/bin/wkhtmltoimage /usr/bin/wkhtmltoimage
  5. Aggiungi/Crea l’utente odoo con gruppo di sistema odoo che ha home in /opt/odoo
    sudo adduser --system --home=/opt/odoo --group odoo
  6. Entra in postgres
    sudo su - postgres
  7. crea l’utente postgres odoo
    createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo
    (il prompt chiederà la password pre la connessione dell’uetnte odoo a postgres)
  8. esci da postgres
    exit
  9. scarica l’ultima versione 8 di odoo dal sito odoo.com e rinominala come odoo
    cd /opt/
    sudo wget http://nightly.odoo.com/8.0/nightly/src/odoo_8.0.latest.tar.gz  
  10. Decomprimi
    sudo tar -xvzf odoo_8.0.latest.tar.gz
    ls (controlla il nome della cartella decompressa)
  11. rinomina
    sudo mv odoo-8.0-(completa con la data come sopra)/* odoo
  12. dentro la cartella opt/odoo crea la sottodirectory per gli addons, poi esegui il file di installazione
    cd /opt/odoo
    sudo mkdir /addons
    sudo python setup.py install
  13. edita il file di configurazione
    nano /etc/odoo-server.conf
    Copia/incolla le righe qua sotto:
    [Options] admin_passwd = admin
    db_host = localhost
    db_port = 5432
    db_user = odoo
    db_password = your postgres pass from step #3
    addons_path = /opt/odoo/openerp/addons,/opt/odoo/addons
    logfile = /var/log/odoo/odoo-server.log
    (ctrl +x then y press enter)
    sudo chown odoo:root /etc/odoo-server.conf
    sudo chmod 640 /etc/odoo-server.conf
  14. loggati come utente odoo
    su - odoo -s /bin/bash
    ed esegui la seguente riga:
    /opt/odoo/openerp-server
    se tutto funziona vai avanti
    (ctrl) c
    exit
  15. Crea il file /etc/init.d/odoo-server
    #!/bin/sh### BEGIN INIT INFO
    # Provides: odoo-server
    # Required-Start: $remote_fs $syslog
    # Required-Stop: $remote_fs $syslog
    # Should-Start: $network
    # Should-Stop: $network
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: Complete Business Application software
    # Description: Odoo is a complete suite of business tools.
    ### END INIT INFO
    PATH=/bin:/sbin:/usr/bin
    DAEMON=/opt/odoo/openerp-server
    NAME=odoo-server
    DESC=odoo-server# Specify the user name (Default: odoo).
    USER=odoo
    # Specify an alternate config file (Default: /etc/odoo-server.conf).
    CONFIGFILE="/etc/odoo-server.conf"
    # pidfile
    PIDFILE=/var/run/$NAME.pid
    # Additional options that are passed to the Daemon.
    DAEMON_OPTS="-c $CONFIGFILE"
    [ -x $DAEMON ] || exit 0
    [ -f $CONFIGFILE ] || exit 0
    checkpid() {
    [ -f $PIDFILE ] || return 1
    pid=`cat $PIDFILE`
    [ -d /proc/$pid ] && return 0
    return 1
    }
    case "${1}" in
    start)
    echo -n "Starting ${DESC}: "
    start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
    --chuid ${USER} --background --make-pidfile \
    --exec ${DAEMON} -- ${DAEMON_OPTS}
    echo "${NAME}."
    ;;
    stop)
    echo -n "Stopping ${DESC}: "
    start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \
    --oknodo
    echo "${NAME}."
    ;;
    restart|force-reload)
    echo -n "Restarting ${DESC}: "
    start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \
    --oknodo
    sleep 1
    start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
    --chuid ${USER} --background --make-pidfile \
    --exec ${DAEMON} -- ${DAEMON_OPTS}
    echo "${NAME}."
    ;;
    *)
    N=/etc/init.d/${NAME}
    echo "Usage: ${NAME} {start|stop|restart|force-reload}" >&2
    exit 1
    ;;
    esac
    exit 0
  16. cambia i permessi ai file di configurazionesudo chown odoo:root /etc/init.d/odoo-server
    sudo chmod 750 /etc/init.d/odoo-server
  17. Crea la cartella e i file di log della tua installazione odoo
    mkdir -pv /var/log/odoo/
    touch /var/log/odoo/odoo-server.log
    chown -R odoo:root /var/log/odoo/
  18. reboot di tutto:
    sudo /etc/init.d/odoo-server start
    sudo /etc/init.d/odoo-server stop
    sudo update-rc.d odoo-server defaults
  19. Reboota ancora e Congrats!