diff --git a/docs/evennia.vhost.apache b/docs/evennia_modpy_apache.conf similarity index 100% rename from docs/evennia.vhost.apache rename to docs/evennia_modpy_apache.conf diff --git a/docs/evennia_wsgi_apache.conf b/docs/evennia_wsgi_apache.conf new file mode 100644 index 0000000000..bf466b607e --- /dev/null +++ b/docs/evennia_wsgi_apache.conf @@ -0,0 +1,45 @@ + + # This is an example mod_wsgi apache2 vhost. There are a number of + # things you'll need to change. They are commented below. Make sure + # you read and understand the stuff below. + + # You'll want to replace the following with your domain info. + ServerName dev.evennia.com + ServerAlias www.dev.evennia.com + # + ## BEGIN EVENNIA WEB CONFIG + # + # evennia_web is just an internal name for mod_wsgi and may be left + # The user and group options are the user and the group that the + # python code will be executed under. This user must have permissions + # to the evennia source. + WSGIDaemonProcess evennia_web user=evennia group=evennia threads=25 + WSGIProcessGroup evennia_web + + # This needs to be changed to the appropriate path on your django + # install. It serves admin site media. + Alias /media/amedia/ "/usr/lib/python2.5/site-packages/django/contrib/admin/media/" + + Order allow,deny + Options Indexes + Allow from all + IndexOptions FancyIndexing + + + # Media Directory. This needs to be set to your equivalent path. + Alias /media/ "/home/evennia/evennia/game/web/media/" + + Order allow,deny + Options Indexes + Allow from all + IndexOptions FancyIndexing + + + + # WSGI Config File. You'll need to update this path as well. + WSGIScriptAlias / /home/evennia/evennia/game/web/apache_wsgi.conf + + # + ## END EVENNIA WEB CONFIG + # + diff --git a/game/web/apache_wsgi.conf b/game/web/apache_wsgi.conf new file mode 100644 index 0000000000..19307143db --- /dev/null +++ b/game/web/apache_wsgi.conf @@ -0,0 +1,17 @@ +import os, sys + +# Calculate the path based on the location of the WSGI script. +apache_configuration= os.path.dirname(__file__) +web_dir = os.path.dirname(apache_configuration) +workspace = os.path.dirname(os.path.dirname(web_dir)) + +sys.path.insert(0, workspace) + +os.environ['DJANGO_SETTINGS_MODULE'] = 'game.settings' +import django.core.handlers.wsgi + +_application = django.core.handlers.wsgi.WSGIHandler() +# This handles apps mounted in places other than the root mount point +def application(environ, start_response): + environ['PATH_INFO'] = environ['SCRIPT_NAME'] + environ['PATH_INFO'] + return _application(environ, start_response)