View source | Discuss this page | Page history | Printable version   

ERP 2.50:Openbravo environment installation/it


Contents

Introduzione

Questo articolo spiega in dettaglio come installare e configurare l'intero stack richiesto per Openbravo ERP da eseguire , i.e.:

Nota Importante : Se si sta cercando un modo veloce di valutare e testare Openbravo ERP , considerate che si può navigare Openbravo ERP on-line demo o downloading Openbravo ERP virtual appliances.

Passi di installazione di ogni componente vengono spiegati per i seguenti sistemi operativi:

Please feel free to contribute to this article by adding installation steps for more operating systems or improving existing ones.

Database PostgreSQL

Openbravo ERP supporta PostgreSQL come proprio database engine.

La documentazione PostgreSQL e i tutorials sono disponibili su :

Microsoft Windows

Seguire le istruzioni sul PostgreSQL wiki. Assicurarsi di selezionare l'opzione "UUID" durante l'installazione.

Di default, l'installer della versione 8.3.5.2 non include l'uuid, per cui dovete fare il download "uuid-ossp.dll" da here, spacchettarlo nella cartella %Postgresql_directory%/lib e riavviare il server Postgresql.

Debian (Ubuntu/Kubuntu/Linux Mint)

  1. Installare il package usando:
    sudo apt-get install postgresql-8.3 postgresql-contrib-8.3
  2. Set la password postgres usando :
    sudo su - postgres -c psql
    
    alter role postgres with password 'new_password';
    \q

Gentoo

  1. Installare il package usando il seguente comando. Portage vi dirà quale versione specificare:
    echo dev-db/postgresql >> /etc/portage/package.keywords
    
    echo dev-db/postgresql-server >> /etc/portage/package.keywords
    echo dev-db/postgresql-base >> /etc/portage/package.keywords
    echo virtual/postgresql-base >> /etc/portage/package.keywords
    echo app-admin/eselect-postgresql >> /etc/portage/package.keywords
    echo dev-db/libpq >> /etc/portage/package.keywords
    echo dev-libs/ossp-uuid >> /etc/portage/package.keywords
    echo dev-db/postgresql-server uuid >> /etc/portage/package.use
    emerge -av postgresql
    emerge --config =postgresql-8.3.5
    /etc/init.d/postgresql start
    rc-update add postgresql default
  1. Impostare la password di postgres:
    psql -U postgres
    
    alter role postgres with password 'new_password';
    \q
    sed -i 's/trust$/md5/' /var/lib/postgresql/8.3/data/pg_hba.conf
    /etc/init.d/postgresql reload

Oracle database

Openbravo ERP supporta Oracle 10g (>= 10.2.0.4.0) e 11g (>= 11.1.0.6.0) nelle seguenti editzoni:

Per sapere di pù su Oracle, seguire i links:

Microsoft Windows

Seguire queste istruzioni per installare Oracle 11g su Windows.

Debian (Ubuntu/Kubuntu/Linux Mint)

Seguire queste istruzioni per installare Oracle 11g su Debian (Ubuntu/Kubuntu/Mint).

Gentoo

Seguire queste linee guida per installare Oracle 11g database su Gentoo. Seguire queste linee guida per installare Oracle 10g database su Gentoo.

Passi comuni dopo l'installazione

In tutti i casi , dopo aver eseguito l'installazione, controllare che :

  1. Il numero di cursori aperti sia almeno 3000 . Verificarlo , e eseguire l' ALTER SESSION per cambiarlo se necessario:
    SELECT value FROM v$parameter WHERE name = 'open_cursors';
    ALTER SYSTEM SET open_cursors = 3000 SCOPE=BOTH;
  2. Assicurarsi che il numero di processi è almeno 150 . Verificarlo , e eseguire l' ALTER SESSION per cambiare se necessario :
    SELECT value FROM v$parameter WHERE name = 'processes';
    ALTER SYSTEM set processes=150 SCOPE=SPFILE;
  3. Riavviare Oracle dopo aver fatto questo cambio.

Sun JDK

Openbravo supporta i seguenti JDKs:

Tutti gli sviluppatori usano la versione Sun. Per cui è quella raccomandata.

Openbravo non supporta OpenJDK, che è preinstallata con Ubuntu 8.10 (Intrepid Ibex). Invece, installate Sun JDK 1.6 (6.0) per Ubuntu.


Microsoft Windows

  1. Fare il Download e l'installazione del JDK 1.6.
  2. Aggiungere la variabile di ambiente JAVA_HOME :
    1. Tasto destro su Risorse del Computer.
    2. Selezionare Proprietà. Appare la finestra Proprietà del Sistema.
    3. Selezionare il tab Avanzate e cliccare Variabili di ambiente.
    4. Cliccare su Nuova. Appare il box delle Variabili Utente.
    5. Nel campo Nome Variabile , scrivere JAVA_HOME.
    6. Nel campo Valore Variabile scrivere il path della directory di installazione del JDK. This is usually C:\Java\jdk1.6.0_<version>
    7. Selezionare la variabile di ambiente PATH.
    8. Nel campo Valore Variabile , scrivere il path della directory bin relativa all'installatione del JDK. Usualmente è C:\Java\jdk1.6.0_<version>\bin

Debian (Ubuntu/Kubuntu/Linux Mint)

Dovete aggiungere repositories apt instable/non-free per installare sun-java-jdk5. Gli utenti Ubuntu/Kubuntu possono anche aver bisogno di aggiungere il repository Multiverse per installare il sun-java6-jdk. Il repository Multiverse è abilitato di default nella versione Ubuntu 7.10 . Fare riferimento a : https://help.ubuntu.com/ubuntu/desktopguide/C/programming.html.

  1. Installare il package:
     sudo apt-get install sun-java6-jdk
  2. Settare il Sun Java JDK come il JDK di default:
    sudo update-java-alternatives -s java-6-sun
  3. Creare la variabile JAVA_HOME :
     echo 'JAVA_HOME="/usr/lib/jvm/java-6-sun"' | sudo tee -a 
    
    /etc/environment
  4. Per rendere questa variabile disponibile nel terminale corrente eseguire:
    source /etc/environment
  5. Per rendere queste variabili disponibili al sistema, riavviare la sessione utente.

Gentoo

  1. To install the package:
     emerge -av sun-jdk
  2. Set the default JDK:
    java-config -S sun-jdk-1.6

Portage sets the JAVA_HOME variable automatically.

Apache Tomcat

Openbravo ERP raccommanda Apache Tomcat versione 6.0 come servlet container.


Microsoft Windows

  1. Fare il Download e l'installazione del Apache Tomcat 6.0.
  2. Aggiungere le variabili di ambiente CATALINA_HOME, CATALINA_BASE e CATALINA_OPTS:
    1. Tasto destro su Risorse del Computer.
    2. Selezionare Proprietà. Appare la finestra Proprietà del Sistema.
    3. Selezionare il tab Avanzate.
    4. Cliccare Variabili di ambiente.
    5. Cliccare Nuova. Appare il box delle Variabili Utente.
    6. Nel campo Nome Variabile , scrivere CATALINA_HOME.
    7. Nel campo Valore Variabile scrivere il path della directory di installazione del Apache Tomcat. Usualmente è C:\Programmi\Apache Software Foundation\Tomcat 6.0.
    8. Cliccare OK.
    9. Cliccare Nuova. Appare il box delle Variabili Utente.
    10. Nel campo Nome Variabile , scrivere CATALINA_BASE..
    11. Nel campo Valore Variabile scrivere il path della directory di installazione del Apache Tomcat.
    12. Cliccare OK
    13. Cliccare Nuova. Appare il box delle Variabili Utente.
    14. Nel campo Nome Variabile , scrivere CATALINA_OPTS.
    15. In the Variable value type -Xms384M -Xmx512M -XX:MaxPermSize=256M.
    16. Select the PATH environment variable.
    17. Nel campo Valore Variabile scrivere il path della directory bin della cartella di installazione del Apache Tomcat. Usualmente è C:\Programmi\Apache Software Foundation\Tomcat 6.0\bin.
  3. Copiare il file C:\Java\jdk1.6.0_<version>\bin\lib\tools.jar dalla directory di installazione del Sun JDK a C:\Programmi\Apache Software Foundation\Tomcat 6.0\lib\
  4. Per evitare Tomcat dall' auto-reloading itself, commentare la linea WatchedResource in C:\Programmi\Apache Software Foundation\Tomcat 6.0\conf\context.xml:
    <!-- <WatchedResource>WEB-INF/web.xml</WatchedResource> -->
  5. Configurare un utente e password per il Manager di Tomcat , sostituendo il file C:\Programmi\Apache Software Foundation\Tomcat 6.0\conf\tomcat-users.xml con questi contenuti, sostituendo password="admin" con la password scelta :
    <?xml version='1.0' encoding='utf-8'?>
    
    <tomcat-users>
    <role rolename="manager"/>
    <role rolename="admin"/>
    <user username="admin" password="admin" roles="admin,manager"/>
    </tomcat-users>

Si può controllare se Tomcat sia in esecuzione aprendo il link http://localhost:8080 in un web browser.

Debian (Ubuntu/Kubuntu/Linux Mint)

  1. Installare il package:
     sudo apt-get install tomcat6 tomcat6-admin
    
    sudo rm /var/log/tomcat6/catalina.out
    sudo /etc/init.d/tomcat6 start
    Nota: Su Ubuntu il comando 'sudo rm /var/log/tomcat6/catalina.out' può non trovare il file, restituendo un messaggio di errore. Questo non condiziona l'installazione.
  2. Controllare che Tomcat è in esecuzione aprendo http://localhost:8180 in un web browser. Alternativemente usare il seguente comando nmap per controllare che la porta 8180 sia aperta :
     nmap localhost -p 8180
  3. Settare le variabili CATALINA_HOME, CATALINA_BASE e CATALINA_OPTS :
    echo 'CATALINA_HOME="/usr/share/tomcat6"' | sudo tee -a /etc/environment
    
    echo 'CATALINA_BASE="/var/lib/tomcat6"' | sudo tee -a /etc/environment
  4. Modificare il file /etc/default/tomcat6 , e settare la seguente linea :-
    JAVA_OPTS="-Djava.awt.headless=true -Xms384M -Xmx512M -XX:MaxPermSize=256M"
  5. Per rendere disponibile questa variabile nel terminale eseguire :
    source /etc/environment
  6. Per rendere queste variabili disponibili , riavviare la sessione utente.
  7. Aggiungere la libreria tools.jar nel classpath di Tomcat :
    cp $JAVA_HOME/lib/tools.jar /var/lib/tomcat6/lib/
    Per evitare Tomcat dall' auto-reloading itself, commentare la linea WatchedResource in conf/context.xml:
    <!-- <WatchedResource>WEB-INF/web.xml</WatchedResource> -->
  8. Configurare utente e password per il Manager di Tomcat, sostituendo /etc/tomcat6/tomcat-users.xml con il seguente contenuto, sostituendo la password="admin" con la password scelta :
    <?xml version='1.0' encoding='utf-8'?>
    
    <tomcat-users>
    <role rolename="manager"/>
    <role rolename="admin"/>
    <user username="admin" password="admin" roles="admin,manager"/>
    </tomcat-users>
  1. A partire dalla 2.50, la feature della modularità richiede all'utente tomcat di scrivere nella directory Openbravo ERP. So achieve this, edit the /etc/init.d/tomcat6 file, search for umask 022 and replace it with umask 002. Then restart Tomcat.


Important notes:

  • The security policy of Debian's Tomcat package will prevent the Openbravo context from loading. You must either disable the security policy or create a rule to allow the Openbravo context to load.
    1. To create a rule for Openbravo you must create a .policy file. Use a command like:
       sudo nano /etc/tomcat6/policy.d/20openbravo.policy
      to create a file called /etc/tomcat5.5/policy.d/20openbravo.policy.
    2. Open the file and add the following contents:
       // permissions for Openbravo ERP
      
      grant codeBase "file:${catalina.base}/webapps/openbravo/-" {
      permission java.security.AllPermission;
      };
    3. Save the file.
    4. Restart tomcat to make the changes effective.
       sudo /etc/init.d/tomcat6 restart

Gentoo

  1. Install the package:
    emerge -av tomcat
  2. Start Tomcat:
    /etc/init.d/tomcat-6 start
    rc-update add tomcat-6 default
    You can check that Tomcat has been in stalled correctly by opening http://localhost:8080 in a web browser Alternatively, use the following nmap command to check that port 8080 is open:
    nmap localhost -p 8080
  3. Set the CATALINA_HOME and CATALINA_BASE variables:
     touch /etc/env.d/99tomcat
    
    echo 'CATALINA_HOME=/usr/share/tomcat-6' >> /etc/env.d/99tomcat
    echo 'CATALINA_BASE=/var/lib/tomcat-6' >> /etc/env.d/99tomcat
  4. Update the environment and make the newly created environment variables available system-wide:
    env-update && source /etc/profile
  5. Set the CATALINA_OPTS variable by editing the /etc/conf.d/tomcat-6 file:
     CATALINA_OPTS="-server -Xms384M -Xmx512M -XX:MaxPermSize=256M"
  6. Add the tools.jar library to Tomcat's classpath:
    cp $JAVA_HOME/lib/tools.jar /var/lib/tomcat-6/lib/
    In order to avoid Tomcat from auto-reloading itself, comment the WatchedResource line in conf/context.xml:
    <!-- <WatchedResource>WEB-INF/web.xml</WatchedResource> -->
  7. Configure a username and password for the Tomcat Manager, by replacing the /var/lib/tomcat-6/conf/tomcat-users.xml file with these contents, replacing password="admin" with your chosen password:
    <?xml version='1.0' encoding='utf-8'?>
    
    <tomcat-users>
    <role rolename="manager"/>
    <role rolename="admin"/>
    <user username="admin" password="admin" roles="admin,manager"/>
    </tomcat-users>
  8. Starting with 2.50, the modularity feature required the tomcat user to write in the main Openbravo ERP directory. So achieve this, edit the /etc/init.d/tomcat-6 file, search for this line:
    start-stop-daemon ${arguments} --exec ${executor} -- ${OPTS_CP} "$@" \
  9. Replace it with the following ones:
    umask 002 && \
    start-stop-daemon ${arguments} --exec ${executor} -- ${OPTS_CP} "$@" \
    Restart Tomcat to apply the changes:
    /etc/init.d/tomcat-6 restart

Apache Ant

Apache Ant is a Java-based build tool used by Openbravo ERP to automate most of its development tasks. Version 1.7.0 or higher is required.

Microsoft Windows

  1. Download and extract Apache Ant into your system (for instance, C:\Apache-Ant).
  2. Add ANT_HOME environment variable:
    1. Right-click on My Computer.
    2. Select Properties. The System Properties window appears.
    3. Select the Advanced tab.
    4. Click on the Environment Variables button.
    5. Click the New button.
    6. In the Variable name field, type ANT_HOME.
    7. In the Variable value field, type the path of the Ant directory. This is usually C:\Apache-Ant.
    8. Click OK.
    9. Select the PATH environment variable.
    10. In the Variable value field, type the path of the Ant directory's bin folder. This is usually C:\Apache-Ant\bin.
  3. Equally add the ANT_OPTS environment variable:
    1. Click the New button.
    2. In the Variable name field, type ANT_OPTS.
    3. In the Variable value field, type -Xmx1024M. If you're running a 64bit Windows, type this instead: -Xmx1024M -XX:MaxPermSize128M.

Debian (Ubuntu/Kubuntu/Linux Mint)

  1. Install the package:
    sudo apt-get install ant ant-optional
  2. Set the ANT_HOME variable:
    echo 'ANT_HOME="/usr/share/ant"' | sudo tee -a /etc/environment
  3. Set the ANT_OPTS variable:
    echo 'ANT_OPTS="-Xmx1024M"' | sudo tee -a /etc/environment
  4. In case you are running a 64bit operating system, set this ANT_OPTS instead:
    echo 'ANT_OPTS="-Xmx1024M -XX:MaxPermSize128M"' | sudo tee -a /etc/environment
  5. Make the ANT_HOME and ANT_OPTS variables available in your current terminal run:
    source /etc/environment
  6. To make the variables available system wide, restart the user session.

Gentoo

In Gentoo it's enough to install the ant-core package:

emerge -av dev-java/ant-core

Portage sets the ANT_HOME variable automatically. But not ANT_OPTS. To set it:

echo ANT_OPTS="-Xmx1024M" > /etc/env.d/99ant
env-update && source /etc/profile

For a 64bit Gentoo use these values instead:

echo ANT_OPTS="-Xmx1024M -XX:MaxPermSize128M" > /etc/env.d/99ant
env-update && source /etc/profile

To make the variables available system wide, restart the user session.


Operating system permissions

UNIX based operating systems use different system users to run the processes and services. So that Tomcat is usually run by the tomcat user, and a command line and task is run by a normal user, e.g. openbravo. Starting with 2.50's modularity feature, it is necessary to allow tomcat to write in the root directory of the Openbravo ERP installation. And the oppossite is also true: the openbravo user requires write permissions in the Tomcat webapps directory.

This is normally not needed in Windows.

First, we need to tweak the default file permissions for the user running the Ant tasks, e.g. openbravo. Assuming you are using Bash as your shell, append the following line to the /home/openbravo/.bashrc file:

umask 002

Secondly, add openbravo to the tomcat group:

gpasswd -a openbravo tomcat

Then, do the opposite, i.e. to add tomcat o the openbravo group:

gpasswd -a tomcat openbravo


Performance and security tips

For production environments, it is recommended to make some changes in order to improve Openbravo ERP performance and security.


Known issues

Here is a list of known issues during Openbravo environment installation. You could also find your problem at Openbravo ERP installation issues.

JDK and X issue in Debian/Ubuntu

When installing a module from the ERP, you may get an error saying that the tomcat user cannot access the X server. To workaround this, run this with the user running the ant tasks:

xhost +

Jasper Reports

In some configurations to make the JasperReports work, you need to add to environment variable CATALINA_OPTS the parameter -Djava.awt.headless=true. The CATALINA_OPTS should look something similar to CATALINA_OPTS ="-server -Xms384M -Xmx512M -Djava.awt.headless=true".

Tomcat hot-deployment problem on Windows

There is a known issue with Tomcat working under Windows. Openbravo ERP does a hot-deploy a of openbravo.war file to Tomcat but on Windows it often encounters file locking issues. Windows will not let Tomcat undeploy the old application because files are locked by the Operating System. Tomcat has mechanisms to allow avoiding locking. In Tomcat 5.5 and 6.0, this mechanism is disabled by default. To enable it edit %CATALINA_BASE%\conf\context.xml. Find the root <context> and add these two attributes:

<context antiJARLocking="true" antiResourceLocking="true" />


Openbravo ERP FAQ

Openbravo's ERP Frequently Asked Questions (FAQ).

Summary

It is very important to install and configure properly all the stack in order to avoid problems during Openbravo ERP installation.

Support

For any question or doubt regarding Openbravo environment installation, post them in Openbravo Help forum or join #openbravo IRC channel in Freenode.

Retrieved from "http://wiki.openbravo.com/wiki/ERP_2.50:Openbravo_environment_installation/it"

This page has been accessed 13,419 times. This page was last modified on 14 June 2011, at 11:04. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.