I'm trying to install OSQA using Python 2.7.1 built with pythonbrew, and mod_wsgi compiled from source. I put this in /opt/example/stack/pythonbrew/. I have successfully gotten a 'hello world' app working using mod_wsgi on this server to ensure that it's working.
I put osqa in /opt/example/application/osqa_7934/htdocs/osqa-server/
osqa.error.log
After getting this all working, I'm running into a configuration error when trying to access the site:
[Mon Jun 20 19:12:58 2011] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Jun 20 19:12:58 2011] [warn] RSA server certificate CommonName (CN) `balance.secure.example.net' does NOT match server name!?
[Mon Jun 20 19:12:58 2011] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Jun 20 19:12:58 2011] [warn] RSA server certificate CommonName (CN) `balance.secure.example.net' does NOT match server name!?
[Mon Jun 20 19:12:58 2011] [notice] Apache/2.2.8 (Ubuntu) DAV/2 SVN/1.4.6 mod_ssl/2.2.8 OpenSSL/0.9.8g mod_wsgi/3.3 Python/2.7.1 configured -- resuming normal operations
[Mon Jun 20 19:13:03 2011] [error] [client 173.14.5.86] mod_wsgi (pid=11562): Exception occurred processing WSGI script '/opt/example/application/osqa_7934/htdocs/osqa-server/osqa.wsgi'., referer: http://appsapi.example.com/console/configurator/applicationInstances/7935/executeAnalyticsHosted
[Mon Jun 20 19:13:03 2011] [error] [client 173.14.5.86] Traceback (most recent call last):, referer: http://appsapi.example.com/console/configurator/applicationInstances/7935/executeAnalyticsHosted
[Mon Jun 20 19:13:03 2011] [error] [client 173.14.5.86] File "/opt/example/stack/pythonbrew/pythons/Python-2.7.1/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 250, in __call__, referer: http://appsapi.example.com/console/configurator/applicationInstances/7935/executeAnalyticsHosted
[Mon Jun 20 19:13:03 2011] [error] [client 173.14.5.86] self.load_middleware(), referer: http://appsapi.example.com/console/configurator/applicationInstances/7935/executeAnalyticsHosted
[Mon Jun 20 19:13:03 2011] [error] [client 173.14.5.86] File "/opt/example/stack/pythonbrew/pythons/Python-2.7.1/lib/python2.7/site-packages/django/core/handlers/base.py", line 47, in load_middleware, referer: http://appsapi.example.com/console/configurator/applicationInstances/7935/executeAnalyticsHosted
[Mon Jun 20 19:13:03 2011] [error] [client 173.14.5.86] raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e)), referer: http://appsapi.example.com/console/configurator/applicationInstances/7935/executeAnalyticsHosted
[Mon Jun 20 19:13:03 2011] [error] [client 173.14.5.86] ImproperlyConfigured: Error importing middleware forum.middleware.extended_user: "cannot import name mark_safe", referer: http://appsapi.example.com/console/configurator/applicationInstances/7935/executeAnalyticsHosted
[Mon Jun 20 19:13:03 2011] [error] [client 173.14.5.86] mod_wsgi (pid=11561): Exception occurred processing WSGI script '/opt/example/application/osqa_7934/htdocs/osqa-server/osqa.wsgi'.
[Mon Jun 20 19:13:03 2011] [error] [client 173.14.5.86] Traceback (most recent call last):
[Mon Jun 20 19:13:03 2011] [error] [client 173.14.5.86] File "/opt/example/stack/pythonbrew/pythons/Python-2.7.1/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 250, in __call__
[Mon Jun 20 19:13:03 2011] [error] [client 173.14.5.86] self.load_middleware()
[Mon Jun 20 19:13:03 2011] [error] [client 173.14.5.86] File "/opt/example/stack/pythonbrew/pythons/Python-2.7.1/lib/python2.7/site-packages/django/core/handlers/base.py", line 47, in load_middleware
[Mon Jun 20 19:13:03 2011] [error] [client 173.14.5.86] raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e))
[Mon Jun 20 19:13:03 2011] [error] [client 173.14.5.86] ImproperlyConfigured: Error importing middleware forum.middleware.extended_user: "cannot import name mark_safe"
Apache config file
Here are my apache directives:
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
WSGIPythonHome /opt/example/stack/pythonbrew/pythons/Python-2.7.1
<VirtualHost _default_:80>
ServerName osqa-1234.testapp.example.com
ServerAlias www.osqa-1234.testapp.example.com
DocumentRoot /opt/example/application/osqa_7934/htdocs
ErrorLog /opt/example/application/osqa_7934/log/error.log
<Directory /opt/example/application/osqa_7934/htdocs>
AllowOverride All
</Directory>
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /opt/example/application/osqa_7934/log/access.log combined
# Monitor Bandwidth
CustomLog /opt/example/application/osqa_7934/log/logio.log "%h %t \\"%r\\" %I %O"
#run mod_wsgi process for django in daemon mode
#this allows avoiding confused timezone settings when
#another application runs in the same virtual host
#WSGIDaemonProcess OSQA
#WSGIProcessGroup OSQA
#force all content to be served as static files
#otherwise django will be crunching images through itself wasting time
Alias /m/ "/opt/example/application/osqa_7934/htdocs/osqa-server/forum/skins/"
<Directory "/home/osqa/osqa-server/forum/skins">
Order allow,deny
Allow from all
</Directory>
Alias /upfiles/ "/opt/example/application/osqa_7934/htdocs/osqa-server/forum/upfiles/"
<Directory "/opt/example/application/osqa_7934/htdocs/osqa-server/forum/upfiles">
Order deny,allow
Allow from all
</Directory>
#this is your wsgi script described in the prev section
WSGIScriptAlias / /opt/example/application/osqa_7934/htdocs/osqa-server/osqa.wsgi
CustomLog /opt/example/application/osqa_7934/log/osqa.access.log common
ErrorLog /opt/example/application/osqa_7934/log/osqa.error.log
</VirtualHost>
osqa.wsgi
My osqa.wsgi contains:
import os
import sys
sys.path.append('/opt/example/application/osqa_7934/htdocs')
sys.path.append('/opt/example/application/osqa_7934/htdocs/osqa-server')
# 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-server.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
asked
20 Jun '11, 19:37
TrinitronX
31●1●1●5
accept rate:
0%
There did used to be an error importing mark_safe - http://wiki.osqa.net/display/docs/Ubuntu+with+Apache+and+MySQL?focusedCommentId=3047880#comment-3047880 - but I thought that had been fixed by now. And your error looks to be happening in a slightly different place to the previous one.