I tried and tried all day to no avail. I have gotten to the point where I have a test.py that runs saying "hello world". I have installed mod_fcgid into apache and it loads ok.

My .htaccess looks like this

AddHandler cgi-script .py AddHandler fcgid-script .fcgi RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ osqa.fcgi/$1 [QSA,L]

My osqa.fcgi looks like this:


import os, sys

_PROJECT_DIR = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(file))), 'answers') sys.path.insert(0, _PROJECT_DIR) sys.path.insert(0, os.path.dirname(_PROJECT_DIR))

_PROJECT_NAME = _PROJECT_DIR.split('/')[-1] os.environ['DJANGO_SETTINGS_MODULE'] = "%s.settings" % _PROJECT_NAME

from django.core.servers.fastcgi import runfastcgi runfastcgi(method="threaded", daemonize="false")

I have no idea how to actually run this thing. I usually get an Unhandled Exception error.

I read the "Installing on Apache" section in the wiki and it is so so unclear. There are a bunch of settings I have no idea where to set. So I thought I will emulate the installation on site5 and other installation instructions because they seem to employ fcgi to get it going without making modifications to the httpd.conf file. To me any app that requires mods to the httpd.conf file and cannot get what it needs to be done in the .htaccess is seriously flawed. Anyway my personal views aside I need to get osqa running and I am willing to pay $.

I need someone to get it working AND write down the steps they used to do it. (commands from the ssh prompt). If you are willing to help me please contact me with your price asap. Thanks, Doug

asked 14 Jul '10, 15:24

doug99's gravatar image

accept rate: 20%

edited 14 Jul '10, 15:31

rickross's gravatar image

rickross ♦♦

I've got OSQA working on CentOS 5 today, using mod_wsgi.

I've contributed a guide to the dev list here, which you might find helpful.


answered 14 Jul '10, 23:17

timw's gravatar image

accept rate: 100%


Ok I am going to post my experience installing from these instructions here.

1) easyinstall should be easy_install 2) "Expand the archive and install it over the top of your new Python install" is unclear. Exactly how do the two directory trees overlap. An example command would go a long way here. From the activepython bin dir I did a wget and tar xvfz on the archive. Now how do I merge them to be able to run /opt/ActivePython-2.6/bin/python install

(15 Jul '10, 09:17) doug99

Also you should mention that installing this activepython 2.6 following these directions will NOT break yum and all the other centos dependencies on python 2.4.

(15 Jul '10, 09:40) doug99

Ok this is what I did. Hope its right.

svn co http://code.djangoproject.com/svn/django/trunk  
cd trunk  
/opt/ActivePython-2.6/bin/python setup.py install
(15 Jul '10, 09:53) doug99

In the mod_wsgi section when I run ./configure --with-python=/opt/ActivePython-2.6/bin/python I get the error checking Apache version... ./configure: line 1704: apxs: command not found

I guess instructions to get apxs should be added.

(15 Jul '10, 10:01) doug99

yum install httpd-devel<enter>

installs apxs

(15 Jul '10, 10:17) doug99

This might be obvious to many but you should add

service httpd restart

after adding LoadModule wsgi_module modules/mod_wsgi.so to httpd.conf

(15 Jul '10, 10:20) doug99

[root@server OSQA]# chmod u+w db

fails as there is no db folder. Should I create it?

(15 Jul '10, 10:24) doug99

httpd server fails to restart unless your create OSQA folders:

    CustomLog /var/log/httpd/OSQA/access_log common
    ErrorLog /var/log/httpd/OSQA/error_log

I decided to just to name the access logs with osqa prefix rather than create the folders cause I am in a hurry.

(15 Jul '10, 11:33) doug99

Thanks for the feedback - I've updated the guide with clarifications based on your feedback.

It's now attached to a Jira issue:


(15 Jul '10, 17:10) Tim Whittington

Now I am finding the easy_install is failing for me because the module eggs are being used from the Python 2.4 install. I have no idea how to make them install for the activestate 2.6 instead. HELP!!!! somebody

(15 Jul '10, 19:08) doug99

Are you running easy_install specifying the location specifically to avoid picking up the one on the path?

e.g. /opt/ActivePython-2.6/bin/easy_install or ./easy_install in the bin directory.

(15 Jul '10, 19:32) Tim Whittington

Ok found and fixed another problem.

easyinstall ElementTree easyinstall Markdown easyinstall html5lib easyinstall python-openid

should be

./easy_install ElementTree ./easy_install Markdown ./easy_install html5lib ./easy_install python-openid

otherwise it picks up the easy_install in the 2.4 distro. (at least for me it did). That messed me up for a an hour or two....

ALSO since I am using mysql not mysql lite, I had to install:

./easy_install mysql-python

(15 Jul '10, 20:16) doug99

Well after all that when I go to mydomain.com:8082 it just sits there forever. Doesn't even timeout... so there are no errors in the apache log file to tell me whats wrong. How can see where its failing? Anybody with some experience please help.

(15 Jul '10, 20:28) doug99

I've seen the sitting there forever thing on the odd occasion, but an Apache restart fixed it.

(15 Jul '10, 21:19) Tim Whittington

Yes that was the problem. I think I am close now. I am now getting the error:

DatabaseError: (1146, "Table 'zinfosqa.forum_badge' doesn't exist")

and I verified the table does not exist. I have removed all the tables and re-run:

/opt/ActivePython-2.6/bin/python manage.py syncdb then tried /opt/ActivePython-2.6/bin/python manage.py syncdb -ALL and even /opt/ActivePython-2.6/bin/python manage.py migrate forum --fake

(15 Jul '10, 23:15) doug99

Here are all the tables it created:

auth_group 0 2 auth_group_permissions 0 3 auth_message 0 3 auth_permission 99 4 auth_user 0 11 auth_user_groups 0 3 auth_user_user_permissions 0 3 django_admin_log 0 8 django_content_type 29 4 django_session 0 3 django_site 1 3 south_migrationhistory 43 4 name Index 1 group_id Index 2

    Table name      Rows        Fields   
auth_group_permissions_bda51c3c     Index   1
auth_group_permissions_1e014c8f     Index   1
auth_message_fbfc09f1   Index   1
content_type_id     Index   2
auth_permission_e4470c6e    Index   1
username    Index   1
user_id     Index   4
auth_user_groups_fbfc09f1   Index   1
auth_user_groups_bda51c3c   Index   1
auth_user_user_permissions_fbfc09f1     Index   1
auth_user_user_permissions_1e014c8f     Index   1
django_admin_log_fbfc09f1   Index   1
django_admin_log_e4470c6e   Index   1
app_label   Index   2
(15 Jul '10, 23:15) doug99

It looks like none of the forum tables got created, which I haven't encountered.

I'd start with a new blank DB, make sure you created the DB with the user OSQA will access it with specified as the owner, double check you've got the database connection and engine settings correct in settings_local.py, and re-run the syncdb (I didn't need to do the -ALL or migrate etc.).

(16 Jul '10, 04:43) Tim Whittington

Thanks Tim, Thanks so much for helping! I did start with a new blank db twice before posting. I tried several times serveral ways before posting (but I try to keep my posts simplified). The settings on the db connection MUST be correct or how did these tables get created? I certainly didn't create them :) Just to let you know, my previous installation attempt on Python 2.4 did create all the tables using the same config file. Of course it was fatally flawed in that Python 2.4 isn't supported, but I just wanted to let you know that. Nevertheless I am giong to delete the db, create the db and rerun syncdb one more time.... hold on... database deleted completely (not just tables dropped)... recreated db... verified new blank db is in fact blank with NO tables .... Now running script and ... same result.. Only creates half the tables...

(16 Jul '10, 06:43) doug99

[root@a687 OSQA]# /opt/ActivePython-2.6/bin/python manage.py syncdb Syncing... Creating table auth_permission Creating table auth_group_permissions Creating table auth_group Creating table auth_user_user_permissions Creating table auth_user_groups Creating table auth_user Creating table auth_message Creating table django_content_type Creating table django_session Creating table django_site Creating table django_admin_log Creating table south_migrationhistory

You just installed Django's auth system, which means you don't have any superusers defined. Would you like to create one now? (yes/no): no

<removed install="" index="" stuff="" cause="" of="" character="" limit="" in="" posts="">

No fixtures found.


django.contrib.auth django.contrib.contenttypes django.contrib.sessions django.contrib.sites django.contrib.admin django.contrib.markup south

Not synced (use migrations): - forum (use ./manage.py migrate to migrate these) [root@a687 OSQA]#

(16 Jul '10, 06:46) doug99

It seems to think I need to use migrate to do the forum tables ????

(16 Jul '10, 06:48) doug99

So I ran this and got:

/opt/ActivePython-2.6/bin/python manage.py migrate forum Running migrations for forum: - Migrating forwards to 0043_autoadd_field_subscriptionsettings_send_digestadd_field_action_rea.

forum:0001_initial forum:0002_autoadd_likedcommentdel_field_repute_positivedel_field_repute_ne forum:0003_repute_changes - Migration 'forum:0003_repute_changes' is marked for no-dry-run. forum:0004_autodel_field_repute_negativedel_field_repute_positivedel_field_ forum:0005_fill_accepted_by_field - Migration 'forum:0005_fill_accepted_by_field' is marked for no-dry-run. forum:0006_autoadd_nodeadd_field_vote_nodeadd_field_comment_nodeadd_field forum:0007_q_and_a_to_node - Migration 'forum:0007_q_and_a_to_node' is marked for no-dry-run.

(16 Jul '10, 06:53) doug99

Converting 0 questions: [ ] 0% ...done

Converting 0 answers: [ ] 0% ...done

Converting 0 vote references: [ ] 0% ...done

Converting 0 flag references: [ ] 0% ...done

Converting 0 comment references: [ ] 0% ...done

! Error found during real run of migration! Aborting.

! Since you have a database that does not support running ! schema-altering statements in transactions, we have had ! to leave it in an interim state between migrations.

(16 Jul '10, 06:54) doug99

! You might be able to recover with: (migration cannot be dry-run; cannot discover commands) ! The South developers regret this has happened, and would ! like to gently persuade you to consider a slightly ! easier-to-deal-with DBMS. ! NOTE: The error which caused the migration to fail is further up. Traceback (most recent call last): File "manage.py", line 13, in <module> execute_manager(settings) File "/opt/ActivePython-2.6/lib/python2.6/site-packages/django/core/management/init.py", line 438, in execute_manager utility.execute() File "/opt/ActivePython-2.6/lib/python2.6/site-packages/django/core/management/init.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/ActivePython-2.6/lib/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv self.execute(args, *options.dict)

(16 Jul '10, 06:55) doug99

File "/opt/ActivePython-2.6/lib/python2.6/site-packages/django/core/management/base.py", line 220, in execute output = self.handle(args, *options) File "/opt/ActivePython-2.6/lib/python2.6/site-packages/South-0.7.1-py2.6.egg/south/management/commands/migrate.py", line 109, in handle ignore_ghosts = ignore_ghosts, File "/opt/ActivePython-2.6/lib/python2.6/site-packages/South-0.7.1-py2.6.egg/south/migration/init.py", line 202, in migrate_app success = migrator.migrate_many(target, workplan, database) File "/opt/ActivePython-2.6/lib/python2.6/site-packages/South-0.7.1-py2.6.egg/south/migration/migrators.py", line 220, in migrate_many result = migrator.class.migrate_many(migrator, target, migrations, database) File "/opt/ActivePython-2.6/lib/python2.6/site-packages/South-0.7.1-py2.6.egg/south/migration/migrators.py", line 291, in migrate_many

(16 Jul '10, 06:55) doug99

result = migrator.class.migrate_many(migrator, target, migrations, database) File "/opt/ActivePython-2.6/lib/python2.6/site-packages/South-0.7.1-py2.6.egg/south/migration/migrators.py", line 291, in migrate_many result = self.migrate(migration, database) File "/opt/ActivePython-2.6/lib/python2.6/site-packages/South-0.7.1-py2.6.egg/south/migration/migrators.py", line 125, in migrate result = self.run(migration) File "/opt/ActivePython-2.6/lib/python2.6/site-packages/South-0.7.1-py2.6.egg/south/migration/migrators.py", line 99, in run return self.run_migration(migration) File "/opt/ActivePython-2.6/lib/python2.6/site-packages/South-0.7.1-py2.6.egg/south/migration/migrators.py", line 81, in run_migration migration_function()

(16 Jul '10, 06:56) doug99

File "/opt/ActivePython-2.6/lib/python2.6/site-packages/South-0.7.1-py2.6.egg/south/migration/migrators.py", line 57, in <lambda> return (lambda: direction(orm)) File "/opt/OSQA/forum/migrations/0007_q_and_a_to_node.py", line 158, in forwards awards = orm.Award.objects.filter(content_typeidin=(ctypes['question'], ctypes['answer'])) KeyError: 'question'

(16 Jul '10, 06:56) doug99

So it seems that south (whatever that is) is causing the problem .. at least for a migrate (whatever that is since I don't have any idea where it migrating from). Going to try to remove the south egg since its not required and try again.

(16 Jul '10, 06:58) doug99

YES! IT WORKED! I removed the south egg and deleted db and resynced and all the tables went in. I had included "south" because it was in other instructions and I wanted all the optional modules installed. I had no idea including that could break it. So Tim, now you know (or probably you already did) that south breaks this install (centos via the instructions above). PS. You probably know about this bug already but when you type in this comment box and you hit the end of the 5th row (max sized) it DOES NOT show the text you are typing unless you hit the down arrow button. Thats fine for me but non-tech users will be baffled where there text went to. (I am using firefox in case its browser related) AHHH now I can scroll up to see the first part of my post. Ummm just a simply textarea would beat a broken fancy input box IMHO.

(16 Jul '10, 07:10) doug99

Great news. I have to admit I have no clue about south as well. Will add a note to the guide.

(16 Jul '10, 15:36) Tim Whittington
showing 5 of 29 show 24 more comments

We just released a (completely free of charge) BitNami Stack for OSQA: http://bitnami.org/stack/osqa It includes everything that you need to install OSQA and is available as a native installer for Linux, Windows and OS X, as well as in the form of a virtual appliance / virtual machine (with Ubuntu or OpenSUSE) or as an AMI (Amazon Machine Image) for Amazon.

We built this package because we're using OSQA ourselves and wanted to make it easier for others to deploy.


answered 28 Jul '11, 13:48

bitnami's gravatar image

accept rate: 0%

Unless you don't want to waste 3 work days following Installation guide on OSQA wiki site http://wiki.osqa.net/display/docs/RHEL%2C+CentOS+5+Installation+Guide (as we did unfortunately), download and install BitNami distro! You'll have your OSQA instance up and running in few minutes! Thank you BitNami

(30 Jan '12, 11:34) bosch

You DO NOT want to mess with centOS/RedHat if possible use ubuntu. I can help with mod_wsgi. The people who make these operating systems made the terrible design decision to make important parts depend on the python interpreter (I hope the die a horrible death for that.) So you are stuck with the old python 2.4. IF YOU UPGRADE PYTHON YOU WILL BREAK YUM (and other important parts of the OS) you can't upgrade python from yum so you will have to do everything from source from now on.

  • you need to compile python 2.6 from source using ./configure --enable-shared (so apache modules can access your python libraries.) when you do a ./make will notice that you have several libraries missing use yum to install them (Note: libraries in redhat end in devel, not dev like ubuntu so it would be whatever-devel) ./make altinstall (this adds python to /usr/local/bin unless otherwise specified with the prefix option) To make your life easier add a link called python2.6 to /usr/bin/
  • before going about even thinking about easy_install you need to install zlib or else you will not be able to extract the eggs
  • now you need to install setup-tools from source just run the egg like a shell script (sh setuptools-0.6c11-py2.6.egg) you download and these instructions to make sure you you are using the correct python version with it
  • There is still a lot of work to do after this but it relates mainly with mod_wsgi(their documentation is fantastic by the way) I don't know how mod_fcgid works (but you'll probally have to recompile to and give the path to so the new pyhton)

Nota Bene: when compiling anything related to python make sure you specify the path to the new python (2.6) or else it will go to the default (2.4)

Trust me you DO NOT want to use RedHat/CentOS you will probably lose days configuring it.


answered 14 Jul '10, 16:02

segfault's gravatar image

accept rate: 50%

edited 14 Jul '10, 21:38

I have lost 1 day so far already. Problem is I need this to run on a few websites and they are all on their own servers. I cannot start changing the OS. .... but I cannot lose yum either ... been there done that.... painful. I thought I read somewhere that version 2.4 of python was the requirement. Is there a list of requirements somewhere? Thanks so much for the help.

(14 Jul '10, 16:21) doug99

Requirement for what osqa? I belive you need at least 2.5 but 2.6 would be the best. For centOS yes you cannot change the default python thats why you have to make an alternate install using make altinstall

(14 Jul '10, 16:38) segfault

After its all said and done I have an install but a regular user can't post (the admin user can). It gives error 500. I was wondering if the person who posted the centos instructions also has the same problem or anyone else who follows these instructions.


answered 16 Jul '10, 16:38

doug99's gravatar image

accept rate: 20%

(16 Jul '10, 16:39) doug99

OK GOT IT WORKING. I followed the instructions here: http://meta.osqa.net/questions/2424/500-error-with-users and it works now! Yea

(16 Jul '10, 17:39) doug99

OSQA works fine on Centos, but it is true that it requires some extra steps to get an up-to-date python environment ready to run. What version of Centos are you running, and do you have root access?


answered 14 Jul '10, 15:32

rickross's gravatar image

rickross ♦♦
accept rate: 47%

Python 2.4.3 (#1, Sep 3 2009, 15:37:37) [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2

and yes I have root

(14 Jul '10, 15:33) doug99

Send login details to admin@osqa.net, and we will try to use this as an opportunity to develop a reasonable Centos recipe that others can follow. You can IM me in the OSQA channel.

(14 Jul '10, 15:42) rickross ♦♦

Ok. Sent you login and details. Thanks so so much, Doug

(14 Jul '10, 15:54) doug99

Hello, I was wondering if a CentOS recipe was successfully developed from this attempt, as for the last month I've been trying to install OSQA in a dedicated virtual server from MediaTemple following these instructions (http://wiki.osqa.net/display/docs/RHEL%2C+CentOS+5+Installation+Guide) without success.

It's been a great learning experience, but I seem not to be understanding something basic because after all this time I can only see the Apache 2 Test Page.

I've also considered paying someone for an installation, if it wasn't because I feel it's within my grasp.

My configuration is similar to @doug99 above:

CentOS release 5.7 (Final) Apache/2.2.19 (Unix) Python 2.4.3

Should I open a new question asking for clarification on the Wiki instructions above or is there a better recipe available somewhere?

Thank you!

(22 Feb '12, 22:02) netk
Your answer
toggle preview

Follow this question

By Email:

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



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



Asked: 14 Jul '10, 15:24

Seen: 4,858 times

Last updated: 25 Feb '12, 09:03

powered by OSQA