First time here? Check out the FAQ!
1

Deploying askbot to passenger
 

Does anyone have a code snippet to install Askbot into Passenger? I'm on Dreamhost and can't really edit httpd.conf, like manual suggests.

OSQA has a passenger_wsgi.py, for instance - I'd like to have one like that. And I don't even know Python, not saying Django.

edit: maybe it's just my configuration broken. I have:

  • Dreamhost account with web directory set to ~/mysite.com/public
  • local Python 2.5 in ~local
  • askbot directory set to ~/mysite.com/askbot and forum directory to ~/mysite.com/askbot/forum
  • the following passenger_wsgi.py in ~/mysite.com/ directory:

.

import sys,os
INTERP = "/home/mysite/local/bin/python"
if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv)
sys.path.append("/home/mysite/mysite.com/")
sys.path.append("/home/mysite/mysite.com/askbot/forum")
os.environ['DJANGO_SETTINGS_MODULE'] = 'askbot.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

The site just dies. In httpd's error.log I get things like:

[Fri Jun 24 14:24:53 2011] [error] [client xx.xx.xx.xx] Premature end of script headers:

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Victor's avatar
11
Victor
updated 13 years ago, asked 13 years ago

Comments

sorry, the server is slow as I am abusing it right now. I'll try mod_passenger.
Evgeny's avatar Evgeny (13 years ago)
see more comments

1 Answer

0

I think that simply renaming django.wsgi (or copying) to passenger_wsgi.py should do the trick.

Looking at the manuals for passenger and wsgi - I do not see anything passenger-specific in those files.

edit: there is no askbot/forum in askbot. If your settings.py is in mysite.com, then instead of your sys.path.append() have

sys.path.append('/home/mysite')
sys.path.append('/home/mysite/mysite.com')

Askbot actually has it's own slightly different version of django.wsgi in askbot/setup_templates that should just work regardless of your specific paths (well in your case you need a custom line to replace the python interpreter).

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
updated 13 years ago, answered 13 years ago
link

Comments

I copied `passenger_wsgi.py` from OSQA (replacting respective parts) and my test site just stopped responding. I see that it's mostly generated from `django.wsgi`. I think I'll add more details about my specific case.
Victor's avatar Victor (13 years ago)
So my main concern is - what's the problem with my configuration?
Victor's avatar Victor (13 years ago)
A question - which directory contains your settings.py?
Evgeny's avatar Evgeny (13 years ago)

Gave it another try. Did no "startforum", just used the current manual. Still, result is the same - site just plain doesn't respond. Can it be a problem with no 500 error logging? (http://wiki.dreamhost.com/PassengerWSGI#500ErrorswithPassengerWSGIWorkaround) What can I do to diagnose this?

Victor's avatar Victor (13 years ago)

But does it work in simple django runserver? If it does, then issues are due to your deployment, otherwise - with the application. Are you deploying askbot with some other apps on the same site?

Evgeny's avatar Evgeny (13 years ago)
see more comments