• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Define new tomcat webapp location?

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm setting up the tomcat web container, with the apache-connector on debian.

The default tomcat webapp folder is /var/lib/tomcat5.5.

I wonder how to change the default folder into another location where I usually save my personal project data, like $HOME/webproject.

Is it enough to change the CATALINA_BASE="/var/lib/tomcat5.5" to CATALINA_BASE="$HOME/webproject"?

I read some articles on Internet, there is another step to install apache-connector, I also installed, and created a new virtual host for tomcat, and set the directory of my webproject as the documentroot for apache to recognize. But it turns out no effect. When I start apache, and enters the url "http://localhost:9029" (9029 is the port I set for tomcat virtual host use in apache), it lists all files under the folder. It doesn't look to me that it is interpreting any pages.

Any one can help with this, to customize the default webapp directory?

Thanks very much.
Naveen.

 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Naveen Akshaye wrote:Hi,
The default tomcat webapp folder is /var/lib/tomcat5.5.



I believe the default webapp folder is /var/lib/tomcat5.5/webapps, at least it is on my Ubuntu server.
As for changing CATALINA_BASE, it is defined in catalina.sh as: "Base directory for resolving dynamic portions of a Catalina installation. If not present, resolves to the same directory that CATALINA_HOME points to", so that is not what you are looking for either.
What you probably want to do is change the appBase attribute of the Host tag in server.xml. You could also configure the docBase in a web application context. This would let you control the directory on a per-application basis.
 
Naveen Akshaye
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joe Ess wrote:

Naveen Akshaye wrote:Hi,
The default tomcat webapp folder is /var/lib/tomcat5.5.



I believe the default webapp folder is /var/lib/tomcat5.5/webapps, at least it is on my Ubuntu server.
As for changing CATALINA_BASE, it is defined in catalina.sh as: "Base directory for resolving dynamic portions of a Catalina installation. If not present, resolves to the same directory that CATALINA_HOME points to", so that is not what you are looking for either.
What you probably want to do is change the appBase attribute of the Host tag in server.xml. You could also configure the docBase in a web application context. This would let you control the directory on a per-application basis.



Yes, you are right. The default webapps folder is /var/lib/tomcat5.5/webapps associated to virtualhost of "localhost:8180".

I want to put all my web projects under another location. Although I can create a link of it under "/var/lib/tomcat5.5/webapps", I want to separate my data from system's apps on "localhost:8180". So I want to create a different virtual host listening to the port 9029 and with the docBase being another location like "/home/naveen/mywebproject/webapps".

Here is what I have done, but didn't work it out.
1. I installed apache connector package: libapache2-mod-jk, and configured it with worker properties. (Prerequisites of package installation are finished, apache, tomcat, apache connector)

2. I created a virtual host under /etc/apache2/sites-enabled/tomcat-host with following content:

When I go to "localhost:9029", it lists out all files under this folder. It's not what I expected.

3. I edited the file of /etc/tomcat5.5/server.xml


4. I checked the folder under /etc/tomcat5.5/Catalina, there is only one folder of "localhost". I know that's for use of default tomcat application which is under "/var/lib/tomcat5.5/webapps". There are xml files in which I can specify the docBase element. But even though I can change the "ROOT.xml" to point the root path to my project folder, the application deployed in this way is actually still on virtual host of "localhost:8180", which is not what I expected, "localhost:9029". Do I need to create another folder with different host name?

Really appreciate of any helps.

Thanks.
Naveen.
 
Do the next thing next. That’s a pretty good rule. Read the tiny ad, that’s a pretty good rule, too.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic