PDA

Просмотр полной версии : lighttpd+fastcgi+ruby


lukmus
04.04.2010, 01:36
вроде бы настройки верные, ошибки не выдаються, но сервер не запускаеться. iptables отрублен.
etc/lighttpd:
server.modules = ("mod_fastcgi", "mod_rewrite")
server.document-root = "/var/www/lighttpd/"
server.errorlog = "/var/log/lighttpd/error.log"
index-file.names = ( "index.rb", "index.html",

mimetype.assign = (
".rpm" => "application/x-rpm",
...
".tar.bz2" => "application/x-bzip-compressed-tar",
# default mime type
"" => "application/octet-stream",
)

#### accesslog module
accesslog.filename = "/var/log/lighttpd/access.log"

url.access-deny = ( "~", ".inc" )

$HTTP["url"] =~ "\.pdf$" {
server.range-requests = "disable"
}

static-file.exclude-extensions = ( ".rb" )
server.pid-file = "/var/run/lighttpd.pid"
server.username = "lighttpd"

server.groupname = "lighttpd"

#### fastcgi module
## read fastcgi.txt for more info
## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini

fastcgi.server = (
".rb" =>
( "localhost" =>
(
"socket" => "/var/run/lighttpd/ruby-fastcgi.socket",
"bin-path" => "/usr/bin/ruby-cgi"
)


)
)
include_shell "find /etc/lighttpd/conf.d -maxdepth 1 -name '*.conf' -exec cat {} \;"

[root@localhost lighttpd]# service iptables stop
iptables: Сбрасываются правила межсетевого экрана: [ OK ]
iptables: Цепочкам назначается политика ACCEPT: filter [ OK ]
iptables: Выгружаются модули: [ OK ]
[root@localhost lighttpd]# service lighttpd start
Запускается lighttpd: [ OK ]
[root@localhost lighttpd]# service lighttpd restart
Останавливается lighttpd: [СБОЙ ]
Запускается lighttpd: [ OK ]


этот сервер поднимаю в первый раз, так что сильно не пинайте

lukmus
04.04.2010, 02:04
забыл посматреть в лог и вот ошибки:
2010-02-20 23:16:41: (log.c.172) server started
2010-02-20 23:16:41: (mod_fastcgi.c.1087) the fastcgi-backend /usr/bin/ruby-cgi failed to start:
2010-02-20 23:16:41: (mod_fastcgi.c.1091) child exited with status 13 /usr/bin/ruby-cgi
2010-02-20 23:16:41: (mod_fastcgi.c.1094) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2010-02-20 23:16:41: (mod_fastcgi.c.1398) [ERROR]: spawning fcgi failed.
2010-02-20 23:16:41: (server.c.928) Configuration of plugins failed. Going down.

/usr/bin/ruby-cgi/test.rb:
#!/usr/bin/ruby -w
require 'cgi'
require 'fcgi'
FCGI.each_cgi{|cgi| cgi.out{'<HTML>hello, world.</HTML>'}}