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

Installation/Custom/Apache Tomcat

Tomcat

Contents

Apache Tomcat

Bulbgraph.png   Tomcat 7.0.x is not supported yet.

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

  1. Download and install Apache Tomcat 6.0.
  2. Add CATALINA_HOME, CATALINA_BASE and CATALINA_OPTS environment variables:
    1. Right-click on My Computer.
    2. Select Properties. The system properties window appears.
    3. Select the Advanced tab.
    4. Click Environment Variables.
    5. Click New. The New System Variable box appears.
    6. In the Variable name field, type CATALINA_HOME.
    7. In the Variable value field, type the path of the Apache Tomcat installation directory. This is usually C:\Apache Software Foundation\Tomcat 6.0.
    8. Click OK.
    9. Click New. The New System Variable box appears.
    10. In the Variable name field, type CATALINA_BASE.
    11. In the Variable value field type the path of the Apache Tomcat installation directory.
    12. Click OK
    13. Click New. The New System Variable box appears.
    14. In the Variable name field, type CATALINA_OPTS.
    15. In the Variable value type -server -Djava.awt.headless=true -Xms384M -Xmx1536M -XX:MaxPermSize=256M.
    16. Select the PATH environment variable.
    17. 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.
Bulbgraph.png   More information about managing environment variables in Microsoft's Help & Support site
Bulbgraph.png   Known issues:

16452: On Windows Openbravo won't start if the installation path contains a space

  1. 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\
  2. 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> -->
  3. 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" />
  4. 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

  1. Download the apache-tomcat-6.0.XY.tar.gz file from Apache Tomcat 6.0 and place it in /tmp/.
  2. Uncompress it:
    su -
    cd /usr/local
    tar zxvf /tmp/apache-tomcat-6.0.XY.tar.gz
    mv apache-tomcat-6.0.XY/ tomcat
  3. 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
  4. Download this init script and place it into /etc/init.d/tomcat. Then make it executable:
    chmod +x /etc/init.d/tomcat
  5. Copy the tools.jar library
    cp $JAVA_HOME/lib/tools.jar /usr/local/tomcat/lib/
  6. 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> -->
  7. 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]'

Retrieved from "http://wiki.openbravo.com/wiki/Installation/Custom/Apache_Tomcat"

This page has been accessed 21,627 times. This page was last modified on 6 February 2013, at 12:59. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.