我想用Rack,FastCGI和Lighttpd来运行一个简单的应用程序,但是我不能让它工作。
我得到以下错误:
/usr/lib/ruby/1.8/rack/handler/fastcgi.rb:23:in `initialize': Address already in use - bind(2) (Errno::EADDRINUSE)
from /usr/lib/ruby/1.8/rack/handler/fastcgi.rb:23:in `new'
from /usr/lib/ruby/1.8/rack/handler/fastcgi.rb:23:in `run'
from /www/test.rb:7下面是应用程序:
#!/usr/bin/ruby
app = Proc.new do |env|
[200, {'Content-Type' => 'text/plain'}, "Hello World!"]
end
require 'rack'
Rack::Handler::FastCGI.run app, :Port => 4000..。和lighttpd.conf:
server.modules += ( "mod_access", "mod_accesslog", "mod_fastcgi" )
server.port = 80
server.document-root = "/www"
mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
".jpg" => "image/jpeg",
".png" => "image/png"
)
index-file.names = ( "test.rb" )
fastcgi.debug = 1
fastcgi.server = ( ".rb" =>
((
"host" => "127.0.0.1",
"port" => 4000,
"bin-path" => "/www/test.rb",
"check-local" => "disable",
"max-procs" => 1
))
)有人能帮我吗?我做错了什么?
发布于 2010-06-13 23:56:52
某些进程已在端口80或4000上运行,请使用netstat -anp命令进行检查。
或者,如果系统上没有netstat,请尝试将端口更改为81和/或4001。
https://stackoverflow.com/questions/3022937
复制相似问题