From: GOTOU Yuuzou Date: 2003-08-24T03:28:03+09:00 Subject: Re: Integrated Webserver? Hi, In message <3F4719A3.4080903@path.berkeley.edu>, `Joel VanderWerf ' wrote: > GOTOU Yuuzou wrote: > > If you want to run WEBrick only in IPv4 network, > > :BindAddress option may be useful. > > > > s = HTTPServer.new( > > :Port => 2000, > > :DocumentRoot => Dir::pwd + "/htdocs", > > :BindAddress => "0.0.0.0" > > ) > > Well, that's some progress. Now the output is: > > [2003-08-23 00:30:24] INFO WEBrick 1.3.1 > [2003-08-23 00:30:24] INFO ruby 1.8.0 (2003-08-04) [i686-linux] > > But the process does not stay around (according to `ps -Af | grep > ruby`), and my browser can't connect to anything at the ports I tried > (2000, 9000, 9123). Hmm, it seems that your code didn't call HTTPServer#start. Could you try the following code? require 'webrick' s = WEBrick::HTTPServer.new( :Port => 2000, :BindAddress => "0.0.0.0", :DocumentRoot => Dir::pwd, :Logger => WEBrick::Log.new($stderr, WEBrick::Log::DEBUG) ) trap("INT"){ s.shutdown } s.start > $ ruby -r socket -ve 'p > Socket::getaddrinfo(nil,2000,Socket::AF_UNSPEC,Socket::SOCK_STREAM,0,Socket::AI_PASSIVE)' > ruby 1.8.0 (2003-08-04) [i686-linux] > [["AF_INET6", 2000, "::", "::", 10, 1, 6], ["AF_INET", 2000, "0.0.0.0", > "0.0.0.0", 2, 1, 6]] it seems ok. -- gotoyuzo