views:

48

answers:

1

I don't know what's wrong with Jetty. My apache2 (run as a service) works fine on my Ubuntu, but Jetty always raise Permission Denied.

I have come through some search result but ---I'm confused---

Would any one please provide an easy follow through that can allow me to invoke mvn jetty:run where jetty was set up to run on port 80?

A: 

Any port under 1024 is a privileged port and can only be opened by the root user. But it us generally a really bad idea to run your web server as root - in the unlikely event that it gets compromised, the attacker has control over everything.

The trick is to start your web server (or jetty in this case) with the root user and switch to another user once port 80 is opened. For more information about Jetty on port 80 see: http://docs.codehaus.org/display/JETTY/port80

leonm
Nice. Is there any ready-made stuff with Maven?
Phương Nguyễn
Why do you want to do this from maven? If it is a production environment you're probably better of building a .war file and deploying to a separate app server. In local test/build environments you should happily be able to live on another port.
leonm