Arc Forumnew | comments | leaders | submitlogin
Can't start (nsv) on port 80 (tcp-listen error under Linux)
2 points by ctx 5741 days ago | 5 comments
I've been playing with Arc and forum software that runs this site and HN and I've been trying to run it on port 80 so I don't have to type :8080 all the time. When I run (nsv 80), I get this error:

Error: "tcp-listen: listen on 80 failed (Permission denied; errno=13)"

It's a Scheme error, from what I've managed to find out, and the solution seems to be to pass it the real IP as the fourth argument. Is there an easy way to fix this or should I hack that in ac.scm?

This seems to be the line: (xdef 'open-socket (lambda (num) (tcp-listen num 50 #t)))

I've also tried proxying it behind Nginx but Arc doesn't seem to understand "X-Real-IP" or "X-Forwarded-For" so all of the users seem to be coming from the same IP.

Anyone have some advice?



4 points by drcode 5740 days ago | link

Could be you don't have unix permissions on port 80. I think it's common on Unices for non root users to have limited access to low numbered ports. Maybe try running mzscheme with sudo?

-----

1 point by rincewind 5740 days ago | link

I think this is the problem.

But running your webserver as root is a huge security risk. If your app is ever exploited, your whole system will be compromised.

try this instead and run your server on port 8080 http://en.wikipedia.org/wiki/Iptables#Redirection_example

-----

1 point by drcode 5740 days ago | link

I agree it's a security risk- Trying "sudo" would be a way to diagnose the problem but not a permanent solution.

-----

2 points by lojic 5740 days ago | link

I'd suggest using Apache as a proxy in front of the Arc server. Apache is great at serving static content, handling ssl, etc.

http://arclanguage.com/item?id=3498

-----

1 point by drcode 5739 days ago | link

thanks for posting that

-----