[Nitro] Setting-up nitro+lighttpd+fcgi at textdrive
zimba
zimba.tm at gmail.com
Sun Sep 25 13:59:12 EDT 2005
Hello,
I'm having hard times installing rdog at TextDrive. I managed to make it
work half the way, but some pages are still not working.
If you want to take a look, the current url is http://rdog.oree.ch:8080/
Here are the different steps I've been trough for the next persons :
1) Use your own ruby gems
TextDrive has not all the gems installed, plus they are not updated.
Here is how you do :
> ssh your_host
> mkdir -p lib/ruby
> gem install your_package -i lib/ruby
Here is the list of packages I have installed :
BlueCloth-1.0.0
RedCloth-3.0.4
coderay-0.4.1.12
glue-0.23.0
mega-0.3.1
nano-0.8.2
nitro-0.23.0
og-0.23.0
rake-0.6.0
ruby-breakpoint-0.5.0
2) Get rdog
Still sshed at your host,
> mkdir apps
> svn co http://rdog.lly.org/rdog-svn apps/rdog
...
3) Setup your mysql database
Create a database the name you want, like username_rdog
Use the example_mysql.sql database file in the apps/rdog folder to fill
your database
4) Configure run.rb
Still sshed at your host,
> nano apps/rdog/run.rb
a) Look for the two "Gem.path.push ..." lines and change it to :
Gem.path.unshift '/home/your_user/lib/ruby'
I found out that you have to use 'unshift' instead of 'push' to avoid
that older textdrive gems gets loaded
b) Look for the Og.setup ( ) section, and put your database config
c) Eventually, you could also change the wiki password by looking at the
"Wiki.password = 'lassmichrein'" line
5) Configure lighttpd
This is the section I'm not sure about it. You should have configured a
prior lighttpd that is used in a vhost mode.
Here is my vhost section :
=== SNIP ===
$HTTP["host"] =~ "rdog.oree.ch" {
fastcgi.server = (
".rb" => (
"localhost" => (
"min-procs" => 1,
"max-procs" => 2,
"socket" => "/home/zimba/var/tmp/rdog.oree.ch.socket",
"bin-path" => "/home/zimba/apps/rdog/public/fcgi.rb",
"bin-environment" => ( "RAILS_ENV" => "production" )
)
)
)
server.error-handler-500 = "/cgi.rb"
server.error-handler-404 = "/cgi.rb"
server.dir-listing = "disable"
server.indexfiles = ( "cgi.rb", "fcgi.rb" )
}
=== SNIP ===
The rest of the file is put as an attachment
Notes : I'm not sure how it works exactly, but I've tried to inspire
myself from the different rails howtos
If my unserstanding is right, fcgi.rb is set, by "bin-path", as an fcgi
handler. It means, all the .rb files will be redirected trough it.
Then, we set the error-handler-404 to fcgi.rb, so that it gets executed
by itself. That way, fcgi can handle the dispatch.
I find it a little confusing to use this method, to use fcgi.rb to call
itself. In the fact, it doesn't work, but if I use cgi.rb as the error
handler it works better.
The problem is, when the url points to an existing file, then the
preceding mechanism is not used anymore. This is why, if you look in the
doc/ section, all the yaml files are shown instead of being nicely
parsed (i think)
6) Restart lighttpd
7) Mail to nitro-general at rubyforge.org ;)
Cheers,
... zimba
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: lighttpd.conf
Url: http://rubyforge.org/pipermail/nitro-general/attachments/20050925/fb9475de/attachment.pl
More information about the Nitro-general
mailing list