[erlang-questions] [Erlang-Q]How to configure Nitrogen webserver with http port 80

Jesse Gumm sigmastar@REDACTED
Sat May 7 18:05:48 CEST 2011


There is a third option that will allow you to bind a privileged port
(this is not specific to Erlang): setcap

sudo setcap cap_net_bind_service+ep ./erts-X.Y.Z/bin/beam
sudo setcap cap_net_bind_service+ep ./erts-X.Y.Z/bin/beam.smp

This command will give the target binary the ability to bind
privileged ports regardless of the user, so it's a bit dangerous in a
multi-user environment, but if you're the only user on the machine, go
for it.

That said, I recommend using nginx anyway.

-Jesse

On Sat, May 7, 2011 at 3:38 AM, Loïc Hoguin <essen@REDACTED> wrote:
> Hello,
>
> On 05/07/2011 04:51 AM, Barco You wrote:
>> After installing Nitrogen webserver and when startup it with "$nitrogen
>> console", I can visit the localhost successfully with
>> "http://localhost:8000", but I hope to use the default http port 80.
>> When I edit the file /etc/inets_httpd.erleven as following, I got a
>> crash error as below. Could you please instruct me how to change the
>> port correctly? thanks!
>
> Only root can open ports <= 1024. Problem is, it's not safe to run
> Erlang as root. There's two solutions to solve this:
>
> * Setup a reverse proxy in cherokee or nginx to your port 8000.
> * Use procket: https://github.com/msantos/procket
>
> Considering you are using Nitrogen you should take the first option,
> unless you're willing to patch Nitrogen.
>
> --
> Loïc Hoguin
> Dev:Extend
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>



-- 
Jesse Gumm
Sigma Star Systems
414.940.4866
gumm@REDACTED
http://www.sigma-star.com



More information about the erlang-questions mailing list