Graham Dumpleton (JIRA) wrote:

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>


I'd never do it in production, but, for testing purposes, wouldn't it be easier to use localhost directly?

   Listen 59180
   <VirtualHost localhost:59180>
     SetHandler mod_python
     PythonPath [r'/home/grahamd/mod_python-3.2.7/test/htdocs']+sys.path
     PythonConnectionHandler tests::connectionhandler
   </VirtualHost>

This should be portable across platforms.

Reply via email to