Ask Your Question

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

asked 2013-03-06 05:36:08 -0600

Vincent_de_Belgique gravatar image

updated 2016-12-22 09:23:08 -0600

Evgeny gravatar image


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.


edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2017-01-09 10:53:08 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >100 is welcome to improve it.

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

edit flag offensive delete link more

answered 2013-03-06 20:09:45 -0600

Evgeny gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-03-06 05:36:08 -0600

Seen: 304 times

Last updated: Jan 09