You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mark Pelillo <pe...@earthlink.net> on 2002/07/18 02:38:43 UTC

UID for Tomcat and startup script

Who do most people run Tomcat as?  Because I am working on a development
system, I can run Tomcat as root, but when I go to production I am sure
that will cause problems.  I am running under Solaris.

I also wonder how you make sure Tomcat is completed started before
starting apache.  I know on my development box ( Dual 360Mhz with 1 gig
of memory) Tomcat takes 15 minutes to start.  If tomcat has to be
started first, then just putting a startup script in rc2.d for tomcat
and rc3.d for Apache doesn't work.  

Right now I have a startup script to start tomcat automatically, then
start apache manually.  Obviously in a production environment that isn't
going to work.




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: UID for Tomcat and startup script

Posted by Will Hartung <wi...@msoft.com>.
From: "Mark Pelillo" <pe...@earthlink.net>
Sent: Wednesday, July 17, 2002 5:38 PM
Subject: UID for Tomcat and startup script


> Who do most people run Tomcat as?  Because I am working on a development
> system, I can run Tomcat as root, but when I go to production I am sure
> that will cause problems.  I am running under Solaris.

If Tomcat isn't using any of the <1024 ports (i.e. listening to 80), then
there's no reason for it to run as root. And if there's no reason for it to
be root, don't let it be root.

> I also wonder how you make sure Tomcat is completed started before
> starting apache.  I know on my development box ( Dual 360Mhz with 1 gig
> of memory) Tomcat takes 15 minutes to start.  If tomcat has to be
> started first, then just putting a startup script in rc2.d for tomcat
> and rc3.d for Apache doesn't work.

15 MINUTES! Holy apples! You know, you don't have to suck in that entire
database on boot! :-)

> Right now I have a startup script to start tomcat automatically, then
> start apache manually.  Obviously in a production environment that isn't
> going to work.

Technically, Apache can be running with Tomcat still starting up. The
problem, of course, is that your application and URLs won't work (and you'll
get ugly errors). But, Apache will start fine and the connector will still
work.

You can try writing a small script that pings Tomcat on one of its
"internal" ports and wait until a URL request comes back positive, and then
have it fire off Apache. Or you can have your Tomcat create a "i'm alive"
file using a method in a load-on-startup servlet, and your script can
listen/watch for that file. Just make sure to remove it after you "see" it,
so that you'll wait next time.

It would be nice if there were some documentation on the Tomcat "admin"
ports that are use to start and stop Tomcat (may in the source code, I
haven't looked). Then you can use those to monitor the status of Tomcat.

All sorts of contrived ways you can go here.

Regards,

Will Hartung
(willh@msoft.com)




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: UID for Tomcat and startup script

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On 17 Jul 2002, Mark Pelillo wrote:

> Date: 17 Jul 2002 19:38:43 -0500
> From: Mark Pelillo <pe...@earthlink.net>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: UID for Tomcat and startup script
>
> Who do most people run Tomcat as?  Because I am working on a development
> system, I can run Tomcat as root, but when I go to production I am sure
> that will cause problems.  I am running under Solaris.
>

I typically create a user named "Tomcat" for this purpose.

> I also wonder how you make sure Tomcat is completed started before
> starting apache.  I know on my development box ( Dual 360Mhz with 1 gig
> of memory) Tomcat takes 15 minutes to start.

On my ancient history 266mHz laptop, Tomcat used to take less than 30
seconds to start.  On my current development box (Linux, 512mb, yadda
yadda) it takes about 5 seconds.

I would look at your application initialization code before pointing too
many fingers ...

>  If tomcat has to be
> started first, then just putting a startup script in rc2.d for tomcat
> and rc3.d for Apache doesn't work.
>

Unless you make your Apache startup script check that Tomcat is already
listening on the relevant port.

> Right now I have a startup script to start tomcat automatically, then
> start apache manually.  Obviously in a production environment that isn't
> going to work.
>

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>