ERP 2.50:Openbravo environment installation/zh cn
Languages: |
English | Italiano | 日本語 | zh cn | Translate this article... |
Contents |
介绍
This article explains in detail how to install and configure the whole stack required for Openbravo ERP to run. The stack consists of:
重要提示: if you are looking for a quick way to explore Openbravo ERP, without installing the full system stack, try the Openbravo ERP on-line demo or download the Openbravo ERP virtual appliance. |
Installation steps of each component are explained for the following operating systems:
Please feel free to contribute to this article by adding installation steps for more operating systems or improving existing ones. |
PostgreSQL数据库
Openbravo ERP supports PostgreSQL as its database engine.
- 8.3.5 is the minimum required version.
- The UUID contrib package is required.
PostgreSQL documentation and tutorials are available from:
在视窗环境安装PostgreSQL数据库
Follow the instructions on the PostgreSQL wiki. Make sure to select the "UUID" option during the installation.
There's two installers right now: pgInstaller and One click installer, We suggest you use pgInstaller to install PostgreSQL.
By default, One click installer version does not include the UUID, if you use it you will need to also do this three steps:
- Download "uuid-ossp.dll" from zip file at winpg.jp
- Unpack the zip file into %Postgresql_directory%/lib directory
- Restart the Postgresql server.
在Debian (Ubuntu/Kubuntu/Linux Mint)安装PostgreSQL数据库
- Install the package using
sudo apt-get install postgresql-8.3 postgresql-contrib-8.3
- Set the postgres password using:
sudo su - postgres -c psql
- alter role postgres with password 'new_password';
- \q
在Gentoo安装PostgreSQL数据库
- 按下列方式安装。Portage会告诉你该用哪些版本的:
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-server
- emerge --config postgresql-server
- /etc/init.d/postgresql-8.3 start
- rc-update add postgresql-8.3 default
- 设置PostgresSQL密码:
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-8.3 reload
甲骨文数据库
Openbravo ERP also supports the following editions of Oracle 10g (version 10.2.0.4.0 or later) and 11g (version 11.1.0.6.0 or later):
To learn more about Oracle, follow the links:
在视窗环境安装甲骨文数据库
Follow 安装指令 to install Oracle 11g on Windows.
在Debian (Ubuntu/Kubuntu/Linux Mint)安装甲骨文数据库
按照[1]在Ubuntu 8.04上安装Oracle 11g数据库
或者按照安装指令在其他Debian (Ubuntu/Kubuntu/Mint)版本上安装Oracle 11g。
在Gentoo安装甲骨文数据库
Follow these guidelines to install Oracle 10g database on Gentoo.
Follow these guidelines to install Oracle 11g database on Gentoo.
通用安装步骤
- Select AL32UTF8 as the database's NLS_CHARACTERSET.
- Select AL16UTF16 as the database's NLS_NCHAR_CHARACTERSET.
常用安装后事宜
In all the cases, after running the installation, check the following:
- The number of open cursors should be 3000 at least. Verify it, and tun the ALTER SESSION to change if needed:
SELECT value FROM v$parameter WHERE name = 'open_cursors'; ALTER SYSTEM SET open_cursors = 3000 SCOPE=BOTH;
- Make sure that the number of processes is 150 at least. Verify it, and tun the ALTER SESSION to change if needed:
SELECT value FROM v$parameter WHERE name = 'processes'; ALTER SYSTEM SET processes=150 SCOPE=SPFILE;
- Restart Oracle after doing this change.
Sun JDK
Openbravo supports the following JDKs:
- Sun Java Development Kit version 1.6 (also known as JDK 6.0).
- IBM JDK
All the developers use Sun's version and therefore is the recommended one.
Openbravo does not support OpenJDK, that comes preinstalled with Ubuntu 8.10 (Intrepid Ibex). Instead, install Sun JDK 1.6 (6.0) for Ubuntu.
在视窗环境下安装JDK
- Download and install JDK 1.6.
- Add the JAVA_HOME environment variable:
- Right-click on My Computer.
- Select Properties. The System Properties window appears.
- Select the Advanced tab then click Environment Variables.
- Click New. The New System Variable box appears.
- In the Variable name field, type JAVA_HOME.
- In the Variable value field type the path of the JDK installation directory. This is usually C:\Java\jdk1.6.0_<version>
- Select the PATH environment variable.
- In the Variable value field, type the path of the JDK installation directory's bin folder. This is usually C:\Java\jdk1.6.0_<version>\bin
在Debian (Ubuntu/Kubuntu/Linux Mint)安装JDK
You must add unstable/non-free apt repositories to install sun-java-jdk6. Ubuntu/Kubuntu users may also need to add the Multiverse repository to install sun-java6-jdk. The Multiverse repository is enabled by default in version Ubuntu 7.10 onwards.
- Install the package:
sudo apt-get install sun-java6-jdk
- Set the Sun Java JDK as the default JDK:
sudo update-java-alternatives -s java-6-sun
- Create the JAVA_HOME variable:
echo 'JAVA_HOME="/usr/lib/jvm/java-6-sun"' | sudo tee -a /etc/environment
- To make this variable available in your current terminal run:
source /etc/environment
- To make these variables available system wide, restart the user session.
在Gentoo上安装Java SDK
- To install the package:
emerge -av sun-jdk
- Set the default JDK:
java-config -S sun-jdk-1.6
Portage自动设置JAVA_HOME环境变量。
Apache Tomcat
Openbravo ERP 建议使用 Apache Tomcat 6.0作为Servlet容器。 Use the tar and not the Installer.
在视窗环境下安装Apache Tomcat
- Download and install Apache Tomcat 6.0.
- Add CATALINA_HOME, CATALINA_BASE and CATALINA_OPTS environment variables:
- Right-click on My Computer.
- Select Properties. The system properties window appears.
- Select the Advanced tab.
- Click Environment Variables.
- Click New. The New User Variable box appears.
- In the Variable name field, type CATALINA_HOME.
- In the Variable value field, type the path of the Apache Tomcat installation directory. This is usually C:\Apache Software Foundation\Tomcat 5.5.
- Click OK.
- Click New. The New User Variable box appears.
- In the Variable name field, type CATALINA_BASE..
- In the Variable value field type the path of the Apache Tomcat installation directory.
- Click OK
- Click New. The New User Variable box appears.
- In the Variable name field, type CATALINA_OPTS.
- In the Variable value type -Xms384M -Xmx512M -XX:MaxPermSize=256M.
- Select the PATH environment variable.
- In the Variable value field, type the path of the Apache Tomcat installation's bin folder. This is usually C:\Apache Software Foundation\Tomcat 6.0\bin.
![]() | More information about managing environment variables in Microsoft's Help & Support site |
- Copy the C:\Java\jdk1.6.0_<version>\bin\lib\tools.jar file from your Sun JDK installation to C:\Apache Software Foundation\Tomcat 6.0\lib\
- In order to avoid Tomcat from auto-reloading itself, comment the WatchedResource line in C:\Apache Software Foundation\Tomcat 6.0\conf\context.xml:
<!-- <WatchedResource>WEB-INF/web.xml</WatchedResource> -->
- Configure a username and password for the Tomcat Manager, by replacing the C:\Apache Software Foundation\Tomcat 6.0\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>
在浏览器打开http://localhost:8080,可以看看Tomcat是否运行。
在Debian (Ubuntu/Kubuntu/Linux Mint)上安装Apache Tomcat
- Install the package:
sudo apt-get install tomcat6 tomcat6-admin
- sudo rm /var/log/tomcat6/catalina.out
- sudo /etc/init.d/tomcat6 start
- Note: On Ubuntu the 'sudo rm /var/log/tomcat6/catalina.out' command may not find the file, resulting in an error message. This will not affect the installation.
- Check that Tomcat is running by opening http://localhost:8180 in a web browser. Alternatively use the following nmap command to check that port 8180 is open:
nmap localhost -p 8180
- Set the CATALINA_HOME, CATALINA_BASE and CATALINA_OPTS variables:
echo 'CATALINA_HOME="/usr/share/tomcat6"' | sudo tee -a /etc/environment
- echo 'CATALINA_BASE="/var/lib/tomcat6"' | sudo tee -a /etc/environment
- Edit the /etc/default/tomcat6 file, and set the following line:-
JAVA_OPTS="-Djava.awt.headless=true -Xms384M -Xmx512M -XX:MaxPermSize=256M"
- To make this variable available in your current terminal run:
source /etc/environment
- To make these variables available system wide, restart the user session.
- Add the tools.jar library to Tomcat's classpath:
cp $JAVA_HOME/lib/tools.jar /var/lib/tomcat6/lib/
cp $JAVA_HOME/lib/tools.jar /usr/share/tomcat6/lib/
- In order to avoid Tomcat from auto-reloading itself, comment the WatchedResource line in conf/context.xml:
<!-- <WatchedResource>WEB-INF/web.xml</WatchedResource> -->
- Configure a username and password for the Tomcat Manager, by replacing the /etc/tomcat6/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>
- 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/tomcat6 file, search for umask 022 and replace it with umask 002. Then restart Tomcat.
重要提示:
|
在Gentoo上安装Apache Tomcat
- 安装包:
emerge -av tomcat
- 启动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
- 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
- Update the environment and make the newly created environment variables available system-wide:
env-update && source /etc/profile
- Set the CATALINA_OPTS variable by editing the /etc/conf.d/tomcat-6 file:
CATALINA_OPTS="-server -Xms384M -Xmx512M -XX:MaxPermSize=256M"
- 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 /etc/tomcat-6/context.xml:
<!-- <WatchedResource>WEB-INF/web.xml</WatchedResource> -->
- 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>
- 从2.50开始,模块化的特性要求tomcat用户用在Openbravo ERP目录写的权限。要达到这样的效果,得编辑/etc/init.d/tomcat-6 文件, 搜索下列内容:
start-stop-daemon ${arguments} --exec ${executor} -- ${OPTS_CP} "$@" \
- 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
在FreeBSD安装Apache Tomcat
You may use tomcat5.5 (/usr/ports/www/tomcat55), tomcat6 (/usr/ports/www/tomcat6), or possibly other verisons. Substitute the version in the commands as necessary.
- Install tomcat
cd /usr/ports/www/tomcat6
- make && make install
- Set necessary memory options for tomcat
echo 'tomcat6_java_opts="-server -Xms384M -Xmx512M -XX:MaxPermSize=256M"' \
- >> /etc/rc.conf
- Set the CATALINA_HOME variable
echo 'tomcat6_catalina_home="/usr/local/tomcat6"' >> /etc/rc.conf
- Start tomcat
/usr/local/etc/rc.d/tomcat6 start
为Tomcat配置代理
If your network have a proxy, you need to append this to the tomcat configuration:
CATALINA_OPTS='-Dhttp.proxySet=true -Dhttp.proxyHost=[PROXY SERVER] -Dhttp.proxyPort=[PORT]'
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.
在视窗环境下安装Apache Ant
- Download and extract Apache Ant onto your system (for instance, C:\Apache-Ant).
- Add ANT_HOME environment variable:
- Right-click on My Computer.
- Select Properties. The System Properties window appears.
- Select the Advanced tab.
- Click on the Environment Variables button.
- Click the New button.
- In the Variable name field, type ANT_HOME.
- In the Variable value field, type the path of the Ant directory. This is usually C:\Apache-Ant.
- Click OK.
- Select the PATH environment variable.
- In the Variable value field, type the path of the Ant directory's bin folder. This is usually C:\Apache-Ant\bin.
- Equally add the ANT_OPTS environment variable:
- Click the New button.
- In the Variable name field, type ANT_OPTS.
- In the Variable value field, type -Xmx1024M. If you're running a 64bit Windows, type this instead: -Xmx1024M -XX:MaxPermSize=128M.
在Debian (Ubuntu/Kubuntu/Linux Mint)安装Apache Ant
- 安装包:
sudo apt-get install ant ant-optional
- 设置ANT_HOME变量:
echo 'ANT_HOME="/usr/share/ant"' | sudo tee -a /etc/environment
- 设置ANT_OPTS变量:
echo 'ANT_OPTS="-Xmx1024M"' | sudo tee -a /etc/environment
- 如果你运行在64位操作系统,这样设置ANT_OPTS:
echo 'ANT_OPTS="-Xmx1024M -XX:MaxPermSize=128M"' | sudo tee -a /etc/environment
- 确保ANT_HOME和ANT_OPTS变量在系统中都可用,可以这么做:
source /etc/environment
- 重启用户会话让变更都起作用。
在Gentoo上安装Apache Ant
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:MaxPermSize=128M"' > /etc/env.d/99ant env-update && source /etc/profile
To make the variables available system wide, restart the user session.
Tomcat的操作系统权限
UNIX based operating systems use different system users to run their processes and services. Tomcat usually has its own tomcat user, and a command line and task is run by a normal user, e.g. openbravo. Since the introduction of the modularity feature in version 2.50, it is necessary to allow tomcat to write in the root directory of the Openbravo ERP installation. Conversely, the openbravo user requires write permissions in the Tomcat webapps directory.
- Change 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
- Add openbravo to the tomcat group:
gpasswd -a openbravo tomcat
- Add tomcat to the openbravo group:
gpasswd -a tomcat openbravo
Windows systems do not use system users in the same way, so these changes are not required.
性能和安全提示
在生产环境, 建议做些修正以 提升Openbravo ERP性能和安全性。
已知问题
Here is a list of known issues during Openbravo environment installation. You could also find your problem at Openbravo ERP installation issues.
在Debian、Ubuntu上的JDK和X服务问题
When installing a module from within Openbravo 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报表
In some configurations to make JasperReports work, you need to add -Djava.awt.headless=true parameter to the CATALINA_OPTS environment variable. The CATALINA_OPTS should look something similar to CATALINA_OPTS ="-server -Xms384M -Xmx512M -Djava.awt.headless=true".
Tomcat在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常见问题
支持
如果你对安装还有问题,可以提到Openbravo帮助论坛或加入在Freenode上的 #openbravo IRC通道。