Cant auto-start Ruby on lighthttpd

Hi,

I have installed ruby and redmine on my server running lighthttpd. I
wanted to run ruby on a different port (3000). The problem is I cant get
it to auto-start, I have to manually type in: ruby server/script -e
production -p 3000
and after that I do not get the cursor back, I have to press Ctrl+C to
shut down the server and come back to command line. I’ve also noticed
that all the access entries are echoed on the CLI if I start it manually
and leave it running. I’ve tried googling and ended up here. Hopefully
someone will be able to point me in the right direction

Thanks.

When you type ruby script/server you are actually starting a
webserver. The -p puts it on port 3000. This is technically not
starting ruby… Lighttpd is also a web server so if you are trying to
run both commands you are duplicating some effort. What you want to
do is first check that lighttpd is running on your machine (no idea
what platform you are on)

If you need a sample lighttpd configuration, here’s an old one that
might get you started:

http://www.urbanpuddle.com/edgy.lighttpd.conf. You’ll want to
uncomment the ruby rails block and comment out the PHP stuff. You set
the port by changing the value of server.port from 80 to something
else.

Once you have lighttpd setup, you should be able to reboot and have
everything work. The full link to the tutorial is here:
http://www.urbanpuddle.com/articles/2006/12/07/install-ruby-rails-on-ubuntu-edgy-eft
but is quite old.

Good luck,
Vince

On Thu, Jul 17, 2008 at 10:27 AM, Aadi Ebu
[email protected] wrote:

and leave it running. I’ve tried googling and ended up here. Hopefully
someone will be able to point me in the right direction

Thanks.

Posted via http://www.ruby-forum.com/.


support independent business – http://www.buyindie.net/

Thanks for the help Vince. I did try it but it didnt work. Let me
explain a bit more of my situation.

I have Linux with CentOS 4 and running lighttpd. Its works perfect. What
I wanted was to run ruby on port 3000. I need to run a SVN service
called redmine. I did have the ruby rails block in my lighttpd.conf
file:

$HTTP[“url”] =~ “/redmine” {
server.document-root = “/var/www/redmine/public/”
server.port = 3000
alias.url = ( “/redmine/” => “/var/www/redmine/public/” )
server.indexfiles = (“dispatch.fcgi”)
server.error-handler-404 = “/redmine/dispatch.fcgi”
url.rewrite = ( "^/$ => “index.html”, “^([^.]+)$” => “$1.html” )

fastcgi.server = (
("/redmine" =>
(
“socket” => “/tmp/example.socket”,
“bin-path” => “/usr/bin/ruby
/var/www/redmine/public/dispatch.fcgi”,
“bin-environment” => (“RAILS_ENV” => “production”)
“idle-timeout” => 120,
“check-local” => disable,
“min-procs” => 1,
“max-procs” => 4,
)))
}

When I try to access www.example.com:3000/redmine I get Failed to
Connect error.

Hope this is helpful and thanks for helping out.

Vince W. wrote:

When you type ruby script/server you are actually starting a
webserver. The -p puts it on port 3000. This is technically not
starting ruby… Lighttpd is also a web server so if you are trying to
run both commands you are duplicating some effort. What you want to
do is first check that lighttpd is running on your machine (no idea
what platform you are on)

If you need a sample lighttpd configuration, here’s an old one that
might get you started:

http://www.urbanpuddle.com/edgy.lighttpd.conf. You’ll want to
uncomment the ruby rails block and comment out the PHP stuff. You set
the port by changing the value of server.port from 80 to something
else.

Once you have lighttpd setup, you should be able to reboot and have
everything work. The full link to the tutorial is here:
http://www.urbanpuddle.com/articles/2006/12/07/install-ruby-rails-on-ubuntu-edgy-eft
but is quite old.

Good luck,
Vince

Well, I’m not the expert on mapping lighttpd to a domain (e.g.
example.com/redmine vs just example.com) so your issue could be there.

Otherwise I have to suggest the basic stuff:

  1. Make sure permissions are ok on your rails folder (I use
    www-data:www-data)
  2. Make sure the app starts and runs ok using webrick or mongrel only
    from the script/server command.

cheers,
Vince

On Fri, Jul 18, 2008 at 9:35 AM, Aadi Ebu
[email protected] wrote:

server.document-root = “/var/www/redmine/public/”
“bin-path” => "/usr/bin/ruby
Connect error.

run both commands you are duplicating some effort. What you want to


support independent business – http://www.buyindie.net/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs