Search This Blog

Sunday, July 8, 2012

Host jsp application from Eclipse on Tomcat 7 server

We want to host an application developed in Eclipse with the use of jsp under tomcat7 server in Ubuntu.
Let's suppose you have already installed tomcat7 on Ubuntu 12.04. Then you'll have tomcat root directory under:


Create you own application directory:


We'll assuse this directory path to be $APP_ROOT. You need to have the following directory structure:

$APP_ROOT/WEB-INF/classes    -  this is where your *.class files need to be stored.
$APP_ROOT/WEB-INF/lib -  this is where you *.jar need to be stored.
(class files need to be stored in folders which correspond to their package names)

Create a Web application (Servlet context)
edit the file /etc/tomcat7/server.xml
and create a line:

<Engine [...]>
  <Host [...]>
    <Valve [...] />
    <Context path="/YourApplication" docBase="YourApplication" debug="0" reloadable="true" />

and restart the tomcat server.
Your application should be server under:

You can redirect to your application from the root domain by editing the index.html under:


<title>Your Page Title</title>
<meta http-equiv="REFRESH" content="0;url="></HEAD>
<BODY> Optional page text here.</BODY>

Edit your /var/www/index.html  page as well.

No comments:

Post a Comment

If you like this post, please leave a comment :)