3

I have Grails 1.3.6 installed on my up to date Ubuntu box. I'd like to use the run-app command with the port set to port 80 (firewall, etc), however whenever I do I get the following exception:

Server failed to start: LifecycleException: Protocol handler initialization failed: java.net.BindException: Permission denied:80

How do I change my configuration so I can bind to port 80?

C. Ross
  • 2,957
  • 2
    I don't have any knowledge about grails, but is it running with root ? A process can not bind to privileged ports (<1024) unless it runs with root or you set the bind capability to the binary. – João Pinto Feb 01 '11 at 18:57
  • Definitely not running as root. How can I do the later? – C. Ross Feb 01 '11 at 19:33
  • @João Pinto Since this is effectively java, if I set the bind capability, won't I set it for all java? – C. Ross Feb 02 '11 at 18:04
  • 2
    Yes, it will set it to all java apps. There is no other way to do it. check how to do it at http://serverfault.com/questions/133415/how-to-allow-non-root-user-to-listen-on-privileged-port . – João Pinto Feb 03 '11 at 14:48

1 Answers1

2

As João Pinto notes, ordinarily only root can bind to privileged ports (1-1023). It's probably more common in cases like this to set up some kind of reverse proxy server (apache, nginx, lighttpd, etc.) to listen on port 80 and send requests back to the grails app running on a higher port.

A B
  • 1,337