[prev in list] [next in list] [prev in thread] [next in thread]
List: ruby-talk
Subject: Re: Starting XMLRPC server on virtual host returns EADDRNOTAVAIL
From: Eric Hodel <drbrain () segment7 ! net>
Date: 2006-12-05 19:59:03
Message-ID: C2D67D03-30C3-4143-813C-25BB22E0AFB7 () segment7 ! net
[Download RAW message or body]
On Dec 5, 2006, at 03:50 , Rene Tschirley wrote:
> I tried to start a Ruby XMLRPC server on a linux-based virtual host
> (using OpenVZ).
>
> Here is the code:
>
> $server = {
> "host" => "my.host.name",
> "port" => 73726
> }
>
> XMLRPC::Server.new(port=$server['port'],host=$server['host'])
>
> While the code works on a non-virtual host, bind returns EADDRNOTAVAIL
> when the server is started on the virtual host:
>
> [2006-12-05 11:35:24] INFO WEBrick 1.3.1
> [2006-12-05 11:35:24] INFO ruby 1.8.5 (2006-08-25) [i486-linux]
> [2006-12-05 11:35:24] WARN TCPServer Error: Cannot assign requested
> address - bind(2)
> /usr/lib/ruby/1.8/webrick/utils.rb:73:in `initialize': Cannot assign
> requested address - bind(2) (Errno::EADDRNOTAVAIL)
>
> I tried to define the host by giving the numeric address. I checked
> that
> the host can resolve the hostname. The server can ping the server
> address. The above code is started as superuser. Linux kernel
> version is
> 2.6.16, OpenVZ patch is version 026test015.
For a WEBrick virtual host you need to pass :DoNotListen => true in
the configuration options for the vhost WEBrick::HTTPServer:
httpd = WEBrick::HTTPServer.new :DocumentRoot => nil
vhost = WEBrick::HTTPServer.new :DoNotListen => true,
:ServerName => 'vhost.example.com',
:DocumentRoot => nil
httpd.virtual_host vhost
I'm not sure how to do this with XMLRPC::Server, though.
--
Eric Hodel - drbrain@segment7.net - http://blog.segment7.net
I LIT YOUR GEM ON FIRE!
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic