From: "Mark Pelillo" <[EMAIL PROTECTED]>
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
([EMAIL PROTECTED])




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to