RE: [Zope] Listening on specific interfaces
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
On Mon, 6 Mar 2000, Pearson, Brian Edward (GEA, 056278) wrote: [snip]
$ ./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.
Out of curiosity, are you running (lauching) Zope as root? The lower ports (below 1024?) are privelaged on UNIX, and require root permission to bind. Higher ports, such as 1234, are not; anyone has access to port 1234. We have a Solaris 2.6 box here running Zope 2.1.4. We launch ZServer with the -a parameter specifying our interface, and it works like a charm. I suspect this is not interface related.
Thanks, -Brian
--Jeff --- Jeff K. Hoffman 704.849.0731 x108 Chief Technology Officer mailto:jeff@goingv.com Going Virtual, L.L.C. http://www.goingv.com/
From: "Pearson, Brian Edward (GEA, 056278)" <BRIAN.PEARSON@APPL.GE.COM>
$ ./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')
Hmm.. are you sure you are starting Zope as a priviliged user, like root? Zope can only bind to port 80 if started as a priviliged user (it will not run as a priviliged user, rather, it will, by default, switch to 'nobody'). The permission denied error is clear pointer in this direction. Martijn Pieters | Software Engineer mailto:mj@digicool.com | Digital Creations http://www.digicool.com/ | Creators of Zope http://www.zope.org/ | The Open Source Web Application Server ---------------------------------------------
participants (3)
-
Jeff K. Hoffman -
Martijn Pieters -
Pearson, Brian Edward (GEA, 056278)