WebFaction
Community site: login faq

Im trying to install mingus on webfaction, but no luck. I keep getting a 5oo error. Ive read the blog posts that are there, but i think they are a bit outdated. any help will be much appreciated.

asked 04 Nov '10, 11:35

aziz
1167
accept rate: 0%

Check your Django application's error log in ~/logs/user - it will contain the Python traceback that should reveal the exact cause of the error.

(04 Nov '10, 11:55) seanf

The error log says: [Thu Nov 04 12:17:50 2010] [error] [client 127.0.0.1] ImportError: No module named django.core.handlers.wsgi

What i cant figure out is what the directory structure should be like and how i can configure virtualenv with webfaction

(04 Nov '10, 12:28) aziz

I just created a working Mingus site on a WebFaction test account - here are the steps I took.

First, log in to the control panel and create a new mod_wsgi/python2.6 app, a new database, and a new site. I'm using "my_app" for the name of my application in this example.

Next, log into your server via SSH and run the following commands to install mingus and its prerequisites:

cd ~
mkdir -p bin lib/python2.6 src
easy_install-2.6 pip virtualenv Mercurial
cd src
wget http://kernel.org/pub/software/scm/git/git-1.7.3.2.tar.bz2
tar xjf git-1.7.3.2.tar.bz2 
cd git-1.7.3.2
./configure --prefix=$HOME
make
make install
cd ~/webapps
rm -rf my_app/bin my_app/lib my_app/myproject*
virtualenv --no-site-packages my_app
cd my_app
source bin/activate
git clone git://github.com/montylounge/django-mingus.git
cd django-mingus/mingus/
pip install -r stable-requirements.txt
cp local_settings.py.template local_settings.py

Edit local_settings.py to set your email address, database info, and other settings, then run the following commands:

./manage.py syncdb
./manage.py loaddata test_data.json

Create ~/webapps/my_app/mingus.wsgi with the following contents:

import os
import sys

from django.core.handlers.wsgi import WSGIHandler

os.environ['DJANGO_SETTINGS_MODULE'] = 'mingus.settings'
application = WSGIHandler()

Edit WSGIDaemonProcess, WSGIPythonPath, and WSGIScriptAlias in ~/webapps/my_app/apache2/conf/httpd.conf as follows:

WSGIDaemonProcess django processes=5 python-path=/home/my_username/webapps/my_app/django-mingus:/home/my_username/webapps/my_app:/home/my_username/webapps/my_app/lib/python2.6 threads=1
WSGIPythonPath /home/my_username/webapps/my_app/django-mingus:/home/my_username/webapps/my_app:/home/my_username/webapps/my_app/lib/python2.6
WSGIScriptAlias / /home/my_username/webapps/my_app/mingus.wsgi

Edit ~/webapps/my_app/apache2/bin/start to add a command to activate your virtualenv:

#!/bin/bash

source /home/my_username/webapps/my_app/bin/activate
LD_LIBRARY_PATH=/home/my_username/webapps/my_app/apache2/lib /home/my_username/webapps/my_app/apache2/bin/httpd.worker -f /home/my_username/webapps/my_app/apache2/conf/httpd.conf -k start

Finally, restart your Apache:

~/webapps/my_app/apache2/bin/restart

That's it - when your done, the site that you created in the first step should be serving a default mingus site.

Hope that helps!

permanent link

answered 04 Nov '10, 13:13

seanf
12.2k41836
accept rate: 37%

edited 05 Nov '10, 04:23

David L ♦♦
1.4k13

When i try to activate the virtualenv, i get this:"-bash: src: command not found"

(05 Nov '10, 04:09) aziz

D'oh! That line should have read 'source bin/activate'.

I've edited the post to reflect this.

(05 Nov '10, 04:23) David L ♦♦

ok, sorry for being a pain, but the virtualenv is for some reason not setup properly. everytime i try to do syncdb, i get an error. django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb Ive tried using postgre also, same error.

Really appreciate the help. Love the service you guys provide. we recommend it to everyone who asks. Already got 3 of our clients to use webfaction.

(05 Nov '10, 09:41) aziz

You can install MySQL support with the following command (run in your virtualenv):

easy_install mysql-python

You can install PostgreSQL support with the following command (run in your virtualenv):

PATH=/usr/local/pgsql/bin:$PATH easy_install psycopg2
(05 Nov '10, 09:51) seanf

Got it working. Thanks a lot, you guys are awesome!

(05 Nov '10, 10:50) aziz
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×908

question asked: 04 Nov '10, 11:35

question was seen: 3,006 times

last updated: 05 Nov '10, 10:50

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM