You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Robert Drescher <ro...@gmail.com> on 2008/08/03 12:27:19 UTC

Creating a new Service

Hello everyone in this list!

This is my first post in the users-help, after successfully installing
Tomcat5.5

The default applications are running (in the /usr/share/tomcat5.5-webapps
folder), but for testing my application, I'd like to move mine to a
different location in the filesystem.
Am I right in my assumption that for this, I will need to create a new
service in the server.xml, apart from Catalina?

My structure would look like this:

/usr/share/myapp/              <-- my applications root, the equivalent to
/usr/share/tomcat5.5-webapps
/usr/share/myapp/webapp   <-- my applications webapp, the equivalent to
/usr/share/tomcat5.5-webapps/ROOT

in the end, i'd like requests going to http://localhost:1234 being mapped to
/usr/share/myapp/webapp, the same as requests going to
http://localhost:8180being now mapped to
/usr/share/tomcat5.5-webapps/ROOT

Which configurations do I have to change? I've ben messing around with the
server.xml and the configurations of my webapp for some time, with the
result of getting return code 400
Also, as soon as this is working, can I just remove the definition of
catalina from the server.xml to deactivate all the standard applications?

I'd be very happy to recieve some advice on this and maybe even example
configuration files *wink*

Robert

Re: Creating a new Service

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
----- Original Message ----- 
From: "Robert Drescher" <ro...@gmail.com>
To: <us...@tomcat.apache.org>
Sent: Sunday, August 03, 2008 12:27 PM
Subject: Creating a new Service


> Hello everyone in this list!
>
> This is my first post in the users-help, after successfully installing
> Tomcat5.5
>
> The default applications are running (in the /usr/share/tomcat5.5-webapps
> folder), but for testing my application, I'd like to move mine to a
> different location in the filesystem.
> Am I right in my assumption that for this, I will need to create a new
> service in the server.xml, apart from Catalina?
>
> My structure would look like this:
>
> /usr/share/myapp/              <-- my applications root, the equivalent to
> /usr/share/tomcat5.5-webapps
> /usr/share/myapp/webapp   <-- my applications webapp, the equivalent to
> /usr/share/tomcat5.5-webapps/ROOT
>
> in the end, i'd like requests going to http://localhost:1234 being mapped 
> to
> /usr/share/myapp/webapp, the same as requests going to
> http://localhost:8180being now mapped to
> /usr/share/tomcat5.5-webapps/ROOT
>
> Which configurations do I have to change? I've ben messing around with the
> server.xml and the configurations of my webapp for some time, with the
> result of getting return code 400
> Also, as soon as this is working, can I just remove the definition of
> catalina from the server.xml to deactivate all the standard applications?
>
> I'd be very happy to recieve some advice on this and maybe even example
> configuration files *wink*
>
> Robert

Hi Robert... you getting good advice in the other posts... and your question 
actually lands in the middle of many ways to approach this...
It hints at virtual hosting, it can be done with a docbase in a context... 
it can be done by messing with Catalina Home and Catalina Base in the 
scripts... its a no mans land kinda question ;)

Heres a suggestion...
TC installs easily from a ZIP... its drop and play...

So rather go for a strategy of

    /usr/share/MyProduction/TomcatXXX
    /usr/share/MyTest/TomcatXXX1
    /usr/share/MyTest/TomcatXXX2

Because this way your test stuff is away from your production stuff... if 
you nuke TC with a bad app... no problem
And as TC changes... new versions... you are going to want to play with all 
the new stuff..

The only thing it that TC's must operate on diff ports... you set this in 
server.XML... ie

    <Connector port="8080"
    <Server port="8005" shutdown="SHUTDOWN">

Each TC must not be the same... but after that setting..... you'll be 
whizing along...

http://localhost:8080/manager/html

will let you UNDEPLOY applications that you dont want

if your production server is set at

    <Connector port="80"
    <Server port="8006" shutdown="SHUTDOWN">

http://localhost/manager/html

will do the same thing....

So every port is a diff test system... otherwise an application in one is 
absolutely identical to another...

The only reason to start messing with Catalina BASE and Catalina Home in the 
scripts with the idea of having many WEBAPP locations and one bin (I feel) 
is when you have serious disk space problems... but TC is very small and its 
not worth the pain...

Then to get to your last question.... if you have to have a webapp operate 
outside of the default Tomcat/webapps... you can tell just that web app to 
operate outside using something called the context file... and setting the 
DocBase....

I think this setup will get you going and its easy.... later you can mess 
with docbase and virtual hosting and all the rest...
TC is very flexible... so I think try keep it simple... drop and play idea, 
which works on any OS and your customer will also understand it...
You dont want to get to the stage where you have so much script all over the 
machine, that you too afraid to install another TC...

TC is going to be the best thing you ever did.... its worth the learning 
curve.

Have fun...

---------------------------------------------------------------------------
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---------------------------------------------------------------------------


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Creating a new Service

Posted by Martin Gainty <mg...@hotmail.com>.
hello Robert-

first looking at your present folder layout

Not under tomcats control.. /usr/share/myapp/            
Not under tomcats control.. /usr/share/myapp/webapp   

I would suggest reading how to configure your tomcat engine at /conf/server.xml
http://tomcat.apache.org/tomcat-5.5-doc/virtual-hosting-howto.html
<Host name="localhost" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="true" xmlNamespaceAware="true">

wgere the structure for your ROOT folder would look like
$CATALINA_HOME/appBase/ROOT

and the root.war would deploy to
$CATALINA_HOME/appBase/ROOT.war

the mapping would be 
path - The context path (including the leading slash)
    of the web application you are dealing with.  To select the ROOT web
    application, specify "/".  

I agree with Andre that a fresh install would solve most of these misconfiguration errors you are now seeing
HTH
Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 


> Date: Sun, 3 Aug 2008 12:53:15 +0200
> From: aw@ice-sa.com
> To: users@tomcat.apache.org
> Subject: Re: Creating a new Service
> 
> Hi and Welcome to the list.
> I can't answer your questions below, but since you are new to the list, 
> allow me to make a couple of predictions :
> 
> The first thing you are going to be asked is under which OS you are 
> running this, and from where you downloaded and installed Tomcat 5.5. 
> So you might as well add that information right away.
> 
> The second thing likely to happen, is that someone will tell you to get 
> rid of that Tomcat, and re-install one from the original Tomcat 
> distribution.  That sounds hard, but it is to some extent 
> understandable, since each distribution seems to put stuff in different 
> places, and that makes it harder for people here to provide useful 
> answers (and particularly for your type of configuration question).
> 
> Now, don't get discouraged and hang on there.  Usually, after this 
> initial stage, the answers are good and people here know their stuff and 
> are genuinely helpful.
> 
> And also, because you say that you have already been playing around with 
> the configuration and are getting all kinds of errors as a result, you 
> might anyway want to de-install your now messed-up tomcat-webapps and 
> tomcat packages, re-install a clean tomcat package (without the 
> webapps), and start from there.
> 
> André
> ;-)
> 
> Robert Drescher wrote:
> > Hello everyone in this list!
> > 
> > This is my first post in the users-help, after successfully installing
> > Tomcat5.5
> > 
> > The default applications are running (in the /usr/share/tomcat5.5-webapps
> > folder), but for testing my application, I'd like to move mine to a
> > different location in the filesystem.
> > Am I right in my assumption that for this, I will need to create a new
> > service in the server.xml, apart from Catalina?
> > 
> > My structure would look like this:
> > 
> > /usr/share/myapp/              <-- my applications root, the equivalent to
> > /usr/share/tomcat5.5-webapps
> > /usr/share/myapp/webapp   <-- my applications webapp, the equivalent to
> > /usr/share/tomcat5.5-webapps/ROOT
> > 
> > in the end, i'd like requests going to http://localhost:1234 being mapped to
> > /usr/share/myapp/webapp, the same as requests going to
> > http://localhost:8180being now mapped to
> > /usr/share/tomcat5.5-webapps/ROOT
> > 
> > Which configurations do I have to change? I've ben messing around with the
> > server.xml and the configurations of my webapp for some time, with the
> > result of getting return code 400
> > Also, as soon as this is working, can I just remove the definition of
> > catalina from the server.xml to deactivate all the standard applications?
> > 
> > I'd be very happy to recieve some advice on this and maybe even example
> > configuration files *wink*
> > 
> > Robert
> > 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

_________________________________________________________________
Reveal your inner athlete and share it with friends on Windows Live.
http://revealyourinnerathlete.windowslive.com?locale=en-us&ocid=TXT_TAGLM_WLYIA_whichathlete_us

Re: Creating a new Service

Posted by André Warnier <aw...@ice-sa.com>.
Hi and Welcome to the list.
I can't answer your questions below, but since you are new to the list, 
allow me to make a couple of predictions :

The first thing you are going to be asked is under which OS you are 
running this, and from where you downloaded and installed Tomcat 5.5. 
So you might as well add that information right away.

The second thing likely to happen, is that someone will tell you to get 
rid of that Tomcat, and re-install one from the original Tomcat 
distribution.  That sounds hard, but it is to some extent 
understandable, since each distribution seems to put stuff in different 
places, and that makes it harder for people here to provide useful 
answers (and particularly for your type of configuration question).

Now, don't get discouraged and hang on there.  Usually, after this 
initial stage, the answers are good and people here know their stuff and 
are genuinely helpful.

And also, because you say that you have already been playing around with 
the configuration and are getting all kinds of errors as a result, you 
might anyway want to de-install your now messed-up tomcat-webapps and 
tomcat packages, re-install a clean tomcat package (without the 
webapps), and start from there.

André
;-)

Robert Drescher wrote:
> Hello everyone in this list!
> 
> This is my first post in the users-help, after successfully installing
> Tomcat5.5
> 
> The default applications are running (in the /usr/share/tomcat5.5-webapps
> folder), but for testing my application, I'd like to move mine to a
> different location in the filesystem.
> Am I right in my assumption that for this, I will need to create a new
> service in the server.xml, apart from Catalina?
> 
> My structure would look like this:
> 
> /usr/share/myapp/              <-- my applications root, the equivalent to
> /usr/share/tomcat5.5-webapps
> /usr/share/myapp/webapp   <-- my applications webapp, the equivalent to
> /usr/share/tomcat5.5-webapps/ROOT
> 
> in the end, i'd like requests going to http://localhost:1234 being mapped to
> /usr/share/myapp/webapp, the same as requests going to
> http://localhost:8180being now mapped to
> /usr/share/tomcat5.5-webapps/ROOT
> 
> Which configurations do I have to change? I've ben messing around with the
> server.xml and the configurations of my webapp for some time, with the
> result of getting return code 400
> Also, as soon as this is working, can I just remove the definition of
> catalina from the server.xml to deactivate all the standard applications?
> 
> I'd be very happy to recieve some advice on this and maybe even example
> configuration files *wink*
> 
> Robert
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org