On Tue, 4 May 1999, Tom Roche wrote:

> I'm working on a Java-based website, running on Apache on a Linux
> box. It has a backend that connects users (applets) to the
> database. For testing, I've been logging in and running a script that
> runs my backend classes. Now I want the backend to run as a service,
> i.e. without a user logged in (like FTP, etc).

> Is "service" the proper term to use here? ("daemon"?)

"service" is the application, like mail, or web.  The program providing
the service is called the "daemon".  

> What is "the best way" to do this?
> I believe the best way to do this is via inetd: is this correct?

None.  Like everything else, it depends.  Does your backend listen for
network connections and stay up 24/7 and is multithreaded to allow for
multiple clients?  Then the best way is to create a cron job that
runs periodically, checking to see if the server is up, and if not,
starting the server.  You then let the server run all the time.  This is
called "standalone" mode (following Apache's convention).

If your backend just listens for one client and terminates abruptly, then
you could consider inetd.conf.

However, since Java start-up time is significant, it might be better if
the JVM is running standalone.  Also multiple clients would result in
multiple copies of your backend app.

> If so, what would be the proper settings for inetd.conf?

try "man inetd".  If it's too obtuse, let me know.

Another option is to use servlets, the converse of "applets" but embedded
on the server side.  Apache supports JServ (see java.apache.org) which
runs standalone alongside the web server.  Servlets let you do fancy
things which you may want in the future.  In particular you could pool
your database connections and reuse them from servlet to servlet.

. . . Sean.



----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to