First time here? Check out the FAQ!

How to serve mutliple instances of Askbot in different directories using Apache?


is it possible to have mutliple instance of askbot in differents directories on the same virtual host ?

ex: and

They will not share the database, nor the users.

And if it's possible, what is the best way to do it : follow the install procedure from de begining to the end two times in the separates directories, or we can share some parts of the code or something ?

Thank you in advance for your help.


Vincent_de_Belgique's avatar
asked 2013-03-06 05:36:08 -0500
Evgeny's avatar
updated 2017-01-27 09:10:14 -0500
edit flag offensive 0 remove flag close merge delete


add a comment see more comments

2 Answers


It's very simple. Each instance of Askbot has its folder in /var/www. Apache config is:

# path and name used for sockets
WSGISocketPrefix /var/run/socket
# make sure it's running as a daemon
WSGIRestrictEmbedded            On
# initialize wsgi script on server start
WSGILazyInitialization          On

<VirtualHost *:80>

DocumentRoot /var/www

# No permission to list directories
<Directory /var/www>
    Options -Indexes

# Alias for "media"
AliasMatch                  ^/m_([^/]+)/(.*)        /var/www/$1/static/$2

# Alias for "upfiles"
AliasMatch                  ^/upfiles_([^/]+)/(.*)$ /var/www/$1/askbot/upfiles/$2

# Alias for *.wsgi script
WSGIScriptAliasMatch        ^/(?!/admin)([^/]+)     /var/www/$1/django.wsgi

# Use separate .conf file for each askbot instance
# the main config doesnt have to be modified
IncludeOptional             askbot-enabled/*.conf

# get names for application-group from askbot instance name
RewriteEngine               On
RewriteCond                 %{REQUEST_URI}          ^/([^/]+)
RewriteRule                 . - [E=ABGROUP:%1]

WSGIApplicationGroup        %{GLOBAL}
WSGIProcessGroup            %{ENV:ABGROUP}

<FilesMatch "\.(html|js|png|jpg|css|gif|ttf)$">
    ExpiresDefault "access plus 2 months"
    ExpiresActive On

CustomLog /var/log/apache2/askbot_access.log common
ErrorLog /var/log/apache2/askbot_error.log
LogLevel notice


Make sure you have config for each instance in IncludeOptional path. Sample.conf

WSGIDaemonProcess       instanceName     display-name=%{GROUP}

and make sure to edit in each instance and make following changes:

MEDIA_URL = '/upfiles_instanceName/'
STATIC_URL = '/m_instanceName/'#this must be different from MEDIA_URL
SESSION_COOKIE_NAME = 'instanceName'

That's all i remember. Might be something else to do to make it working

answered 2017-01-09 10:53:08 -0500
This post is a wiki. Anyone with karma >100 is welcome to improve it.
edit flag offensive 0 remove flag delete link


add a comment see more comments

Try this: in your webserver config set up alias to your script for each site (example for apache)

WSGIScriptAlias /sub-url /path/to/wsgi_script

And in the add:


I have not tested this - please check that slashes are set correctly.

Evgeny's avatar
answered 2013-03-06 20:09:45 -0500
edit flag offensive 0 remove flag delete link


add a comment see more comments