Installation/Custom/Apache Tomcat
|
| Tomcat |
|
Contents |
Apache Tomcat
You must use Apache Tomcat version 6.0.x as the servlet container. Use the tar and not the Installer.
Installing Apache Tomcat on Microsoft Windows
- 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 System 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 6.0.
- Click OK.
- Click New. The New System 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 System Variable box appears.
- In the Variable name field, type CATALINA_OPTS.
- In the Variable value type -server -Djava.awt.headless=true -Xms384M -Xmx1536M -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 |
| Known issues:
16452: On Windows Openbravo won't start if the installation path contains a space |
- 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> -->
- Openbravo does a hot-deploy a of openbravo.war file to Tomcat but on Windows it often encounters file locking issues, to avoiding locking edit %CATALINA_BASE%\conf\context.xml. Find the root <context> and add these two attributes:
<context antiJARLocking="true" antiResourceLocking="true" />
- 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>
You can check that Tomcat is running by opening http://localhost:8080 in a web browser.
Installing Apache Tomcat on RedHat
yum install tomcat6 tomcat6-webapps tomcat6-servlet-2.5-api tomcat6-admin-webapps
Uncomment and edit in /etc/tomcat6/tomcat-users.xml to set passwords to your likings, then run it with 'service tomcat6 start'. If all is well you should now find the tomcat default page at http://yourhostname:8080/ .
OR
- Download the apache-tomcat-6.0.XY.tar.gz file from Apache Tomcat 6.0 and place it in /tmp/.
- Uncompress it:
su -
cd /usr/local
tar zxvf /tmp/apache-tomcat-6.0.XY.tar.gz
mv apache-tomcat-6.0.XY/ tomcat
- Add CATALINA_HOME, CATALINA_BASE and CATALINA_OPTS environment variables:
echo 'export CATALINA_HOME=/usr/local/tomcat' > /etc/profile.d/tomcat.sh
echo 'export CATALINA_BASE=/usr/local/tomcat' >> /etc/profile.d/tomcat.sh
echo 'export CATALINA_OPTS="-server -Djava.awt.headless=true -Xms384M -Xmx1536M -XX:MaxPermSize=256M"' >> /etc/profile.d/tomcat.sh
chmod +x /etc/profile.d/tomcat.sh
chown -R openbravo:openbravo /usr/local/tomcat
- Download this init script and place it into /etc/init.d/tomcat. Then make it executable:
chmod +x /etc/init.d/tomcat
- Copy the tools.jar library
cp $JAVA_HOME/lib/tools.jar /usr/local/tomcat/lib/
- In order to avoid Tomcat from auto-reloading itself, comment the WatchedResource line in /usr/local/tomcat/conf/context.xml:
<!-- <WatchedResource>WEB-INF/web.xml</WatchedResource> -->
- Configure a username and password for the Tomcat Manager, by replacing the /usr/local/tomcat/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>
Tomcat through a proxy
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]'
