I've developed a web application using clojure/compojure (JVM based) and while developing I tested it using embedded jetty that runs on I would now like to deploy it to run on port 80 on ubuntu. I do dynamic virtual hosting, so any request for any host that arrives on port 80 should be handled by my application.

The issues that worries me are:

  • I can still run it embedded but I'm worried about running my app as root (needed for binding to port 80). I'm not sure if I can 'give up root' when in the JVM. Do I need to be concerned by this?
  • besides, serving web applications is a known problem and I should be using known solutions for this (jetty or tomcat)
  • but especially tomcat seems very heavy weight. Besides, I only have one application that listens to /* and does routing internally. (with compojure/ring). What I'm trying to say with this is that tomcat by default assigns WARs to subfolders which I don't want.

So basically what I need is some very safe way of binding to port 80 on ubuntu that can with minimal interference send all requests to my app. Any ideas?

  1. it does not need to run as root. I know that when you were developing your application that you use root. But when deploying, just make sure that the user you are giving the application has the same permissions or maybe in the same group for all files being touched by your web application.
  2. Tomcat is pretty good too but you are correct. It does come with alot of other extras.
  3. Tomcat does not require you to have a war file to deploy. You can move your web application under webapp and it should run file also.

Exposing tomcat or your jetty server should work the same. I am not 100% sure about jetty development and how good their security is but I can say that tomcat is pretty good and they are pretty active also.

Forgot about your port issue. exposing port 80 should not be a problem. you can easily change this on the configuration.

  • Actually, while developing the app I was running as a normal user, but on ubuntu a normal user can't bind to port 80, which I need to do when I deploy. – Pieter Breed Nov 5 '10 at 12:56
  • Regardless of what port you use when developing your application, you will be able to change ports since your application server is the one in charge of managing which port it will allow connections to. – mezzie Nov 8 '10 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.