plone / plone.recipe.zope2instance

zc.buildout recipe to setup and configure a Zope 2 instance.
https://pypi.org/project/plone.recipe.zope2instance
6 stars 23 forks source link

make parameter ip-address work for wsgi #131

Closed pabo3000 closed 4 years ago

pabo3000 commented 4 years ago

At my plone hosting service provider it is mandatory to bind the plone process to an ip-address for any reasons. This was done until now by setting ip-address in buildout.cfg. With Plone 52 and plone.recipe.zope2instance 6.5.0 that way does not work anymore. If you set ip-address to something like localhost, 123.123123.123 or www.mydomain.org this has no influence to wsgi.ini. This behavior is correctly described in the README:

ip-address The default IP address on which Zope's various server protocol implementations will listen for requests. If this is unset, Zope will listen on all IP addresses supported by the machine. This directive can be overridden on a per-server basis in the servers section. Defaults to not setting an ip-address. Used for ZServer only, not WSGI.

So I manually edited the wsgi.ini

[server:main]
paste.server_factory = plone.recipe.zope2instance:main
use = egg:plone.recipe.zope2instance#main
#listen = 0.0.0.0:9999
listen = www.mydomain.org:9999
threads = 4

it works.

me@mops:~$  netstat -tlp
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 www.mydomain.org:9999 0.0.0.0:*               LISTEN      31294/python3.7 

I propose that the configuration parameter ip-address is written to wsgi.ini > server:main > listen

dataflake commented 4 years ago

You can use http-address to pass one or more host:port pairs.

pabo3000 commented 4 years ago

Yes, that is true. :-)