I'm curious what techniques you Linux admin gods are using to manage your Jetty deployments. I come from a Windows Server background so I'm still getting used to all of this. I've been looking for a good solution for deploying Jetty instances as port 80 on a Linux installation.
So far I've seen this thread which allows Jetty to run as a daemon:
http://jira.codehaus.org/browse/JETTY-458
And I've seen this thread which talks about alternates for setting up on port 80:
http://wiki.eclipse.org/Jetty/Howto/Port80
These all seemed kind of hacky. Surely there is a relatively standard way of deploying a web server like Jetty on Linux. I'm currently using CentOS 5.5 but open to other distros.
Thanks in advance.
Unfortunately, Java processes tend not to daemonize as well as other languages. For Jetty, you'll want to use something like daemonize to launch and manage the process.
Edit - some additional details:
After building daemonize (as per instructions in above link), the command line parameters are explained in the generated file
daemonize.html
. Test it out from the launch command to ensure it works as expected.Then to launch Jetty at startup, add the daemonize command to an init shell script (e.g., for CentOS/RHEL append
/etc/rc.d/rc.local
). For example:I would put an Apache2 proxy in front of an application server. Apache2 has a specific module designed for this. It adds the appropriate headers to the request for your application to identify the remote user. Apache2 can be used to serve static content, and only pass application requests to the application server.
Windows does not implement privileged ports (ports less than 1024). Other than running Jetty as root, some technique is required bind port 80 as root and pass the data to Jetty. Apache2 uses setuid after binding the port so that the process handling a request does not have root access to your system.
The sites you have found show some of the options: