quote

giovedì, gennaio 03, 2008

Deploy webapp on tomcat 6

Here, the steeps I have followed in order to deploy and starting my web application on tomcat 6.
I wanted deploy my webapp (hereafter I'll call it pippo), without moving the pippo.war on <tomcat-home>/webapps
Environment: Windows XP, JDK 1.6, tomcat 6.0

  • Create the folder <tomcat-home>/conf/Catalina/localhost (Note the capital letter C in Catalina)
  • Rename the contex.xml of your webapp as pippo.xml e copy it under the localhost folder just created.
  • Copy all the jdbc drivers that your webapp needs under the folder <tomcat-home>/lib
  • Exec $ catalina start from <tomcat-home>/bin
  • Open the browser and type http://localhost:8080/pippo

Here the context.xml of pippo webapp, renamed pippo.xml


<Context path="/pippo" reloadable="true"
docBase="C:/temp/pippo">
<Resource auth="Container"
driverClassName="org.hsqldb.jdbcDriver"
maxActive="5"
name="jdbc/pippoDS"
password=""
type="javax.sql.DataSource"
url="jdbc:hsqldb:hsql://localhost/pippo"
username="sa"/>
</Context>


Remember also to modify the tomcat-users.xml file in the <tomcat-home>/conf/ folder.
Here the file I use.

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="manager"/>
<role rolename="tomcat"/>
<role rolename="admin"/>
<user username="tomcat" password="tomcat" roles="manager,tomcat,admin"/>
</tomcat-users>


Deployment descriptor for the basicwebappevolution




<Context path="/basicWebAppEvolution" reloadable="true"
docBase="/dev/parancoe/parancoe/examples/basicWebAppEvolution/target/basicWebAppEvolution">
<Resource auth="Container"
driverClassName="org.postgresql.Driver"
maxActive="5"
name="jdbc/dataSource"
password="mypassword"
type="javax.sql.DataSource"
url="jdbc:postgresql://localhost:5432/basicwebappevolution"
username="postgres"/>
</Context>



Nessun commento: