Deploying Apps to Tomcat
Contents
See Also
Overview
- Grant permissions by editing $HOME/build.properties...
username=username
password=password...where username and password match a username and password set in...
$TOMCAT_HOME/conf/tomcat-users.xmlFor example:
<?xml version='1.0'?> <tomcat-users> <role rolename="admin"/> <role rolename="manager"/> <role rolename="provider"/> <user username="username" password="password" roles="admin,manager,provider"/> </tomcat-users>- Set $HOME/build.properties unreadable to anyone but username:
chown username $HOME/build.properties
chmod 600 $HOME/build.properties- Set CLASSPATH to include catalina-ant.jar and j2ee.jar.
- Build the app
ant build- Deploy the app:
ant install- To run, pull up a browser and go to
http://domain/contextpathWhere contextpath is defined in build.xml
Common Problems
If you get:
java.io.IOException: Server returned HTTP response code: 401Verify your username password have been assigned the manager role tomcat-users.xml file.
If you get...
[install] FAIL - Application already exists at path /path...the app has already been installed. To redeploy:
ant reloadIf your app does not load: If you get: HTTP 500: No Context Error
Tomcat does not know about your application. Try running through the deploy cycle again:
- ant remove
- ant build
- ant install
- ant reload