I've tried changing port both in wf_core.erl
and sys.config
, but now it can't even initialize webserver.
Checked if something is using 80 port - it is free.
You should install authbind in case you need running 80 port. Create file
/etc/authbind/byport/80
and set rwx access to user you need run under. Then perform
authbind --deep ./start.sh
P.S. you need to specify port only in sys.config. In web_sup you should use
wf:config(port)
Like in https://github.com/synrc/n2o_sample/blob/master/src/web_sup.erl#L17
You shouldn't touch wf_core, it's default port is 8000 and it is use port from config.
The basic reason is that in most unixes only root can bind to ports bellow 1024.
Depending on which OS you are running there are several ways to deal with this,
We run on port 8000 and map it to 80 at the load balancer or firewall.
If you don't want to do that look at this page: http://yaws.hyber.org/privbind.yaws which is for yaws but everything there will still apply to any erlang system.
You can make it work with port-forwarding from port 80 to 8000 via iptables:
sudo iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
sudo iptables -A INPUT -i eth0 -p tcp --dport 8000 -j ACCEPT
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8000
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With