Rails/lighttpd on os x


#1

I’m trying to set up my Rails development app for public access on OS
X. I’m using the bundled lighttpd server. The first thing i tried to
do is simply start lighttpd on port 80. When i set “server.port = 80”
in lighttpd.conf i get the following error message after running ruby
script/server:

(network.c.265) can’t bind to port 80 Permission denied

i have turned off the apache server (via sharing preferences) and
also made sure no httpd service is running. Anybody has encountered
this?

the second thing i tried is simply to start lighttpd on port 8080 and
do a port mapping from 80 to 8080 (airport). This works fine when
accessed thru localhost:8080. However, when i try to access this from
the outside (i’m using a dynamic dns service mapped to my external
IP), it still points to the the default apache WebServer document
root (library/webserver/documents). so i created an alias to /public/
dispatch.fcgi, named it index.html and dropped it into /library/
webserver/documents. This now brings up an empty page (activity
window indicates load errors) but the lighttpd trail indicates no
errors. what am i doing wrong?

if anybody could help me out making either of the two approaches
work, that would be greatly appreciated. Thanks

Sebastian


#2

As a regular user you cannot start a server on a port <1024
You should start lighttpd as root and specify the user name and group in
lighttpd.conf
server.username = “john”
server.groupname = “users”

This way your lighttpd will start on port 80, and the service will
belong to
you.

Bogdan