JD Yang
JD Yang

Reputation: 371

apache2+mod_wsgi with multiple django process in each host name

I want to run multiple django project with multiple host name.

If use come from www.momsy.org, it goes to /var/web/momsy.git.org other if come from www.momsy.net, it goes to /var/web/momsy.git.net

This is to log and analyze where he/she came from.

So, following does not work because [WSGIPythonPath cannot occur within section].

But I can't use http.conf because i need 'servername' variable.

How Can I solve this problem?


ServerAdmin webmaster@localhost
ServerName www.momsy.org

    WSGIScriptAlias / /home/web/momsy.git.kr/momsy/wsgi.py                             
    WSGIPythonPath /home/web/momsy.git.kr                                              

    <Directory  /home/web/momsy.git.kr/momsy>                                          
    <Files wsgi.py>                                                                    
            Order deny,allow                                                           
            Allow from all                                                             
    </Files>                                                                           
    </Directory>                                                                       

A

Upvotes: 0

Views: 119

Answers (1)

Graham Dumpleton
Graham Dumpleton

Reputation: 58563

Use daemon mode, delegate each Django instance to a separate set of processes, and set python-path against each daemon process group as required for each. See:

Otherwise set the sys.path in the WSGI script file and not in the Apache configuration.

Upvotes: 1

Related Questions