[ 
https://issues.apache.org/jira/browse/MODPYTHON-120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Graham Dumpleton closed MODPYTHON-120.
--------------------------------------


> Connection handler test fails on virtual hosting system such as OpenVPS.
> ------------------------------------------------------------------------
>
>                 Key: MODPYTHON-120
>                 URL: https://issues.apache.org/jira/browse/MODPYTHON-120
>             Project: mod_python
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.7
>            Reporter: Graham Dumpleton
>         Assigned To: Graham Dumpleton
>            Priority: Minor
>             Fix For: 3.3
>
>
> On a virtual hosting environment such as OpenVPS, "localhost" does not map to 
> the IP address "127.0.0.1" but the actual IP of the host.
>   >>> import socket
>   >>> socket.gethostbyname("localhost")
>   '207.126.122.36'
> This fact causes the connection handler test to fail because it sets up the 
> virtual host listener definition as something like:
>   Listen 59180
>   <VirtualHost 127.0.0.1:59180>
>     SetHandler mod_python
>     PythonPath [r'/home/grahamd/mod_python-3.2.7/test/htdocs']+sys.path
>     PythonConnectionHandler tests::connectionhandler
>   </VirtualHost> 
> In this case it really needs to be:
>   Listen 59180
>   <VirtualHost 207.126.122.36:59180>
>     SetHandler mod_python
>     PythonPath [r'/home/grahamd/mod_python-3.2.7/test/htdocs']+sys.path
>     PythonConnectionHandler tests::connectionhandler
>   </VirtualHost> 
> To accomodate virtual hosting arrangements, the test might be able to be 
> rewritten as:
>     def test_connectionhandler_conf(self):
>         try:
>             ip = socket.gethostbyname("localhost")
>         except:
>             ip = "127.0.0.1"
>         self.conport = findUnusedPort()
>         c = str(Listen("%d" % self.conport)) + \
>             str(VirtualHost("%s:%d" % (ip,self.conport),
>                             SetHandler("mod_python"),
>                             PythonPath("[r'%s']+sys.path" % DOCUMENT_ROOT),
>                             
> PythonConnectionHandler("tests::connectionhandler")))
>         return c
> This should always work on UNIX boxes, but whether it does on Win32 boxes 
> would need to be confirmed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to