[Zope] Listening on specific interfaces
Pearson, Brian Edward (GEA, 056278)
BRIAN.PEARSON@APPL.GE.COM
Mon, 6 Mar 2000 15:08:01 -0500
All - After bringing up a logical interface (hme0:4) on physical interface
hme0, Zope will not work if I try to use a value of 80 for the HTTP port.
Netscape Enterprise Server is running on this same box and is already bound
to the physical interface hme0 listening to port 80. My guess is that Zope
is not really binding to the virtual interface, but is trying to bind to the
physical interface and thus it is conflicting with NES. The error follows:
$ ./start -a 3.130.232.27 -w 80 -f 8021 -m 8099
Traceback (innermost last):
File "/opt/devnet-zope/Zope-2.1.4-solaris-2.6-sparc/z2.py", line 493, in ?
logger_object=lg)
File
"/opt/devnet-zope/Zope-2.1.4-solaris-2.6-sparc/ZServer/medusa/http_server
.py", line 552, in __init__
self.bind ((ip, port))
File
"/opt/devnet-zope/Zope-2.1.4-solaris-2.6-sparc/ZServer/medusa/asyncore.py
", line 205, in bind
return self.socket.bind (addr)
socket.error: (13, 'Permission denied')
3.130.232.27 = hme0:4
If I specify an HTTP port that is not currently bound to the physical
interface (hme0), such as 1234, Zope starts up properly.
How can I force Zope to bind to logical address 3.130.232.27:80 so that it
no longer conflicts with NES? Is this even possible? I have a few Zope
apps. that I would like to bind to different logical interfaces on port 80
so that I can use different hostnames. Additionally, I do not want the
user(s) to specify a port in the URI.
Thanks,
-Brian
> -----Original Message-----
> From: Michel Pelletier [SMTP:michel@digicool.com]
> Sent: Wednesday, March 01, 2000 10:29 PM
> To: Pearson, Brian Edward (GEA, 056278)
> Cc: 'zope@zope.org'
> Subject: Re: [Zope] Listening on specific interfaces
>
>
>
> "Pearson, Brian Edward (GEA, 056278)" wrote:
> >
> > All - Have a problem which I am certain many of you have already
> > encountered.
> >
> > With most web servers, you can create specific web server
> instances that
> > listen to virtual network interfaces on the server (virtual IP
> addresses).
> > For example, I can have multiple httpd instances, with httpd1
> listening to
> > 192.168.1.101 and httpd2 listening to 192.168.1.102 on a box where
> the
> > physical IP address is 192.168.1.100. This is configurable within
> the web
> > server.
> >
> > I want to be able to have Zope listen to a specific network
> interface, i.e.
> > - a virtual IP address that has been created on the server. This
> will allow
> > me to have multiple Zope sites running on the same machine. How
> can this be
> > accomplished? Any/all suggestions are greatly appreciated.
>
> You need to hack the z2.py file. Go down near the bottom (look for
> the
> string '# HTTP Server') and you will see that the HTTP server is
> fired
> up on the IP_ADDRESS interface. This variable is defined on line
> 252
> and the default is an empty string '' which means, 'all interfaces'.
>
> You can hack the code here to do anything you want, define a bunch
> of
> interface variables, etc...
>
> Yes, this needs to be done better, but short of comming up with a
> conf
> file like apache and dealing with all that, it's probably no so
> realistic. z2.py is currently config'ed with command line options,
> which gets out of control after a while.
>
> -Michel