Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tomcat w/ apache dir structure: really confused!!!

Status
Not open for further replies.

gwu

MIS
Dec 18, 2002
239
US
I want to create two web apps (app1 and app2) using apache and tomcat. I am a little confused on where to put certain files.

usually when using php I would put all files in:

/usr/local/apache/htdocs/app1
and
/usr/local/apache/htdocs/app2

each app is its own seperate entity

How does jsp work? Should all files(including the WEB-INF/ directories and servlets) go in:

/usr/local/apache/htdocs/app1
and
/usr/local/apache/htdocs/app2

Or should the WEB-INF/ directories and servlets stay in a seperate directory like:

/usr/local/jakarta/webapps/app1
and
/usr/local/apache/webapps/app2

thanks
 
let me clarify a little more. When I say webapp i really mean website. I would be hosting two websites on one machine. So:

/usr/local/apache/htdocs//usr/local/apache/htdocs/
/usr/local/jakarta/webapps//usr/local/apache/webapps/
is this correct? is each site considered a context or host in server.xml?

thanks again
 
I already read that doc but I still had some issues.

So I should have everything that has to do with each website in its respective directory, like so:

/usr/local/jakarta/webapps//usr/local/jakarta/webapps//usr/local/jakarta/webapps/localhost

When you say "webapp" you mean a seperate website/entity?

Would each weapp be defined as a seperate "host" or a seperate "context" in main server.xml file:

<Engine name="Catalina" defaultHost="localhost">
<Host name="localhost" appBase="webapps/localhost" />
<Host name=" appBase="webapps/shoestore" />
<Host name=" appBase="webapps/bank" />
</Engine>


how is that?

thanks
 
A webapp is a "web application" - ie it is all the code that goes to make up a website.

OK, so take your example websites " and
First, the webapp code should be in :

TOMCAT_HOME/webapps .

So for example :

/usr/local/jakarta/webapps/bank
/usr/local/jakarta/webapps/shoestore

Then in server.xml, you need these entries :

Code:
      <Host name="[URL unfurl="true"]www.bank.com"[/URL] debug="0" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
          <Context path="" docBase="bank" debug="0"
                   reloadable="true" crossContext="true">
         </Context>
      </Host>
      <Host name="[URL unfurl="true"]www.shoestore.com"[/URL] debug="0" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
          <Context path="" docBase="shoestore" debug="0"
                   reloadable="true" crossContext="true">
         </Context>
      </Host>

--------------------------------------------------
Free Database Connection Pooling Software
 
thats exactly what I wanted to know!!!! thank you sedj!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top