Re: pyblosxom1.2 + mod_python/2.7.10 on apache 1.3.33

Steven Armstrong <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
On 03/27/05 21:32, Pasi Savolainen wrote:
> Hi,
> I've been trying to get pyblosxom run under mod_python on apache 1.3
> server.
> It's been mostly OK, apart from some initial problems with mt_table not
> having .get() methods.
> I almost had a step-by-step guide ready when I noticed that this
> installation doesn't send HTTP headers. At all.
> Ethereal shows only html body after GET request, no headers whatsoever.
> 
> If you have a clue about this or just a guess, please do tell :)
> 
> I'm using following .htaccess:
> - -
> PythonDebug On
> SetHandler python-program
> PythonPath "['/var/www/pybl/pbmp','/var/www/pybl/pbmp/wsgiref']+sys.path"
> PythonHandler mp_wsgi_handler::wsgi_handler
> PythonOption ApplicationPath /pybl
> PythonOption application wsgi_app::application
> PythonOption multithread Off
> PythonOption multiprocess On
> - -
> 
> Where '/var/www/pybl/pbmp' has config.py, mp_wsgi_handler.py,
> wsgi_app.py, Pyblosxom -directory and wsgiref -installation.
> 
> Thanks.
> 

Hi Pasi

I'm running apache2 with mod_python 3.1.3 so I don't know if I can be of
much help.

Do you have other mod_python scripts that work in your setup?
Maybe write a simple handler that sets some headers and writes a Hello
World or something to check if your installation basically works?

One guess would be that something goes wrong in the method
'ModPythonHandler send_headers' in mp_wsgi_handler.py. Maybe for some
reason it doesn't get called?

You could try changing it to read like:

def send_headers(self):
    apache.log_error("send_headers")
    self.cleanup_headers()
    self.headers_sent = True
    self.request.status = int(self.status[:3])
    for key, val in self.headers.items():
        if key.lower() == "content-type":
            self.request.content_type = str(val)
        else:
            self.request.headers_out[key] = val
    apache.log_error(str(self.request.headers_out))

Then check your apache logfile. Mine has entries like:
[Mon Mar 28 00:37:49 2005] [error] send_headers
[Mon Mar 28 00:37:49 2005] [error] {'Content-Length': '5726',
'Set-Cookie': 'pysid=e0b2b483e6b8db4e43298684aa673d9b; path=/weblog',
'Cache-Control': 'no-cache="set-cookie"'}

hth
cheers
Steven


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.