ERP 2.50:Stack configuration
This article explains in detail how to configure the whole stack required for a Openbravo ERP production environment. This is the configuration used in the Openbravo ERP Appliances, which includes the following software:
- Apache httpd: web server.
- mod_jk: JK module for connecting Tomcat and Apache using the ajp13 protocol.
- Apache Tomcat: servlet container.
- Apache Tomcat Native library: native APR library for Tomcat.
- PostgreSQL: database server.
- Sun JDK: Java Development Kit (virtual machine, compiler, etc).
- Apache Ant: build tool similar to make that uses XML configuration files.
- Version 1.7.1 is required.
- Add $ANT_HOME/bin to the $PATH.
- In order for ant export.database to work properly wstx-asl-3.0.2.jar and stax-api-1.0.1.jar must be copied into the $ANT_HOME/lib directory. They can be copied from the src-db/database/lib directory.
- Some build tasks require more memory than what Ant allocates by default. So set the ANT_OPTS variable to "-Xmx1024M -XX:MaxPermSize=128M".
- Version 1.6 is required.
- Define the $JAVA_HOME variable and add $JAVA_HOME/bin to the $PATH.
- Define $CATALINA_HOME and optionally also $CATALINA_BASE.
- Optionally create a dedicated system user and group. Make that user the owner of the Tomcat process. And make this user part of the openbravo system group (the owner of the OpenbravoERP source directory). Also make sure that every file generated by the tomcat system user is writable by the tomcat system group. This is necessary to make the module installation/uninstallation/update to work properly. Patch $CATALINA_HOME/bin/catalina.sh as follows:
--- bin/catalina.sh 2008-09-02 09:27:18.000000000 +0200 +++ bin/catalina.sh 2008-09-02 09:27:10.000000000 +0200 @@ -80,6 +80,9 @@ Darwin*) darwin=true;; esac +# Friendly permissions for openbravo +umask 002 + # resolve links - $0 may be a softlink PRG="$0"
- Openbravo ERP requires more allocated memory than the default one. Set the CATALINA_OPTS variable to "-server -Xms128M -Xmx1024M -XX:MaxPermSize=256M"
- Configure a valid username and password in $CATALINA_BASE/conf/tomcat-users.xml, and assign the admin and mnagaer roles to it.
- Disable the WEB-INF/web.xml monitorization in the $CATALINA_BASE/conf/server.xml file. This is necessary for the Tomcat restart to work properly after installing/uninstalling/updating a module using the Module Management Console:
<!-- <WatchedResource>WEB-INF/web.xml</WatchedResource> -->
- Disable the HTTP connector, it will not be used. Only the AJP connector is required.
- Optionally, set up the init script not to return success till Tomcat is really started. You can use this code snippet:
SHUTDOWN_PORT=$(netstat -vtnl|grep $csport|wc -l) while [ $SHUTDOWN_PORT -eq 0 ]; do sleep 0.5 SHUTDOWN_PORT=$(netstat -vtnl|grep $csport|wc -l) done
- Version 1.1.15 or higher is required.
- Make sure that the Tomcat startup script detects this library. To force it append -Djava.library.path=/path/to/libs indicating the location of the libtcnative* files.
- Version 1.2.26 or higher is required.
- Configure a workers file as follows:
worker.list=ajp13 worker.ajp13.port=8009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 worker.ajp13.lbfactor=1
- Configure the mod_jk main configuration file as follows. The paths may vary depending on the operating system:
JkWorkersFile /etc/httpd/conf/jk-workers.properties JkShmFile /etc/httpd/logs/jk-runtime-status JkLogFile /var/log/httpd/mod_jk.log JkLogLevel info JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories JkRequestLogFormat "%w %V %T" jkAutoAlias /var/lib/tomcat/webapps/ jkMount /openbravo* ajp13 jkMount /manager* ajp13 jkMount /OpenbravoDiagnostics* ajp13
- Version 2.2.x is required.
- Enable the mod_deflate module, which provides GZIP compression. And create the following configuration file for this module:
- Set the KeepAlive option to On in the global configuration. This is specially required for not noticing a slowdown when using SSL.
- Version 8.3.x is required, where x>=5.
- The UUID component must be enabled, using the ossp-uuid 1.6.2 package.
- The rest of the configuration is the standard one.
Openbravo ERP sources
- Create a dedicated system user and group for Openbravo ERP.
- Make the openbravo system user belong to the tomcat system group.
- Modify the openbravo system user's umask to that all the files and directories generated by this users are writable by the openbravo system group. In case of the Bash shell:
echo umask 002 >> /home/openbravo/.bashrc