How can I install OSQA with the openCSW software stack?

asked 25 Feb '14, 12:47

cgrzemba's gravatar image

cgrzemba ♦♦
6091318
accept rate: 9%

edited 21 Mar '15, 15:24


Packages witch needed:

CSWapache2
CSWap2modwsgi
CSWpy-html5lib
CSWpy-markdown
CSWpy-django
CSWpy-openid
CSWmysql5
CSWpython27
CSWpy-south

clone OSQA from github: git clone [email protected]:dzone/osqa.git

config Apache2 with WSGI: in httpd.conf:

LoadModule wsgi_module  libexec/mod_wsgi-2.7.so

in httpd-vhosts.conf:

# Must not be inside a VirtualHost directive.
WSGIPythonHome /opt/csw
WSGIPythonOptimize 2

and there in the VirtualHost section

Alias /upfiles /var/www/www.opencsw.org/osqa/osqa/forum/upfiles
<Directory /var/www/www.opencsw.org/osqa/osqa/forum/upfiles>
 Order allow,deny
 Allow from all
 Options +Indexes
</Directory>

# collides with the /m redirect
Alias /m /var/www/www.opencsw.org/osqa/osqa/forum/skins/
<Directory /var/www/www.opencsw.org/osqa/osqa/forum/skins>
 Order allow,deny
 Allow from all
 Options +Indexes
</Directory>

Alias /admin_media /opt/csw/lib/python2.7/site-packages/django/contrib/admin/media
<Directory /opt/csw/lib/python2.7/site-packages/django/contrib/admin/media>
 Order allow,deny
 Allow from all
 Options +Indexes
</Directory>

Redirect permanent /community/community /community
<Location /community>
 Order allow,deny
 Allow from all

 # Trying to work around broken canonical links in OSQA.

 # Order deny,allow
 # Deny from all

 # <IfModule python_module>
 #   # CSWpy-django is already in sys.path
 #   PythonPath "sys.path + ['/var/www/www.opencsw.org/osqa/osqa']"
 #   SetHandler python-program
 #   PythonHandler django.core.handlers.modpython
 #   SetEnv DJANGO_SETTINGS_MODULE settings
 #   PythonOption django.root /community
 #   PythonDebug Off
 #   PythonAutoReload Off
 # </IfModule>

</Location>
<IfModule wsgi_module>
 # See also the definition of WSGIPythonHome above!
 WSGIDaemonProcess www.opencsw.org threads=15 maximum-requests=10000
 WSGIProcessGroup www.opencsw.org
 WSGIScriptAlias /community /var/www/www.opencsw.org/osqa/osqa/osqa.wsgi
</IfModule>

config wsgi.py (use wsgi.py.dist):

import os
import sys
sys.path.append('/var/www/www.example.org/osqa')
sys.path.append('/var/www/www.example.org/osqa/osqa')   
# The first part of this module name should be identical to the directory name
# of the OSQA source.  For instance, if the full path to OSQA is
# /home/osqa/osqa-server, then the DJANGO_SETTINGS_MODULE should have a value
# of 'osqa-server.settings'.
os.environ['DJANGO_SETTINGS_MODULE'] = 'osqa.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

config settings_local.py:

$ cp settings_local.py.dist settings_local.py

edit:

LOG_FILENAME = '/var/log/apache/www.example.org/osqa/django.osqa.log'
INTERNAL_IPS = ('127.0.0.1','172.16.1.123')
ALLOWED_HOSTS = ('www.example.org',)
DATABASES = {
 'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'dbname',
    'USER': 'osqa',
    'PASSWORD': 'secret',
    'HOST': 'localhost',
    'PORT': '',
    'CONN_MAX_AGE': 600,
  }
}
TIME_ZONE = 'Europe/Berlin'
OSQA_DEFAULT_SKIN = 'yourskin'
permanent link

answered 25 Feb '14, 13:13

cgrzemba's gravatar image

cgrzemba ♦♦
6091318
accept rate: 9%

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:

×3
×2
×1

question asked: 25 Feb '14, 12:47

question was seen: 36,671 times

last updated: 21 Mar '15, 15:24

powered by OSQA