On Thu, 16 Aug 2001, Jonathan Eric Miller wrote:

> I'm wondering if in Tomcat 4 there is a "restart" command that you can use
> to restart it rather than having to "stop" and "start" it using startup and
> shutdown scripts?
> 
> The problem that I have is that it takes time for it to startup and
> shutdown, especially when you have SSL enabled. So, a restart command would
> be nice. Or, if it printed out messages like it does in Tomcat 3.x where as
> each listening port becomes active (i.e. first port 8080 for HTTP, then
> later when HTTPS is available and the SecureRandom has been generated), it
> prints out a message to the screen. This way you know when Tomcat is fully
> started or stopped. Otherwise, the scripts just return you back to the UNIX
> prompt before it's actually started up or shutdown and you don't know
> exactly when that process is complete.
> 

You know it's done when you see the second "Starting service xxxxx" line
in $CATALINA_HOME/logs/catalina.out.

> I guess a restart command isn't really that important although it would be
> nice. I like the messages that are displayed in Tomcat 3.x better though. I
> like knowing exactly when the ports are ready for use.
> 
> Jon
> 
> 
> 

There's no restart command for the whole server, but there is a convenient
way to restart a particular webapp (say, because you just updated it).

Prerequisite:  set up a user in your conf/tomcat-users.xml file that has a
role named "manager".  It doesn't matter which user and password it is
(Tomcat will only check for the presence of this role).

Now, assume you want to force the web app at context path "/examples" to
reload.  Simply go to a browser and type:

  http://localhost:8080/manager/reload?path=/examples

The first time you do this, you will be challenged for the username and
password you have entered.  But, after that, you can just hit "reload" to
resubmit the same command again.

This stuff will be covered in a (soon to be written, I promise :-) HOWTO
document about the Manager web app.  In the mean time, consult the source
code of the Manager servelt (org.apache.catalina.servlets.ManagerServlet)
for all the things it can do.

Craig


Reply via email to