Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have apache2 installed in ubuntu lucid ,and have enabled ssl .Now I am running a django app (lets say myapp1 )on it using mod_wsgi. I have configured the /etc/apache2/sites_enabled/ssl file and /etc/apache2/sites-available/ssl as below.

Now I can run my app using the url

https://127.0.0.1/myapp1

I need to run another django app (say myapp2 )in the same server,and that also uses SSL.So,how should I configure it?Can somebody please help me?

<VirtualHost *:443>
    ServerAdmin webmaster@localhost

    DocumentRoot /home/me/dev/python/django/myapp1

        SSLEngine on
        SSLOptions +StrictRequire
        SSLCertificateFile /etc/ssl/certs/server.crt
        SSLCertificateKeyFile /etc/ssl/private/server.key
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog /var/log/apache2/error.log
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/access.log combined
    WSGIScriptAlias /myapp1 /home/me/dev/python/django/myapp1/myapp1.wsgi
    Alias /site_media/ /home/me/dev/python/django/myapp1/media/
    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>
share|improve this question

1 Answer 1

up vote 0 down vote accepted

By adding:

WSGIScriptAlias /myapp2 /home/me/dev/python/django/myapp2/myapp2.wsgi

You will need to resolve any conflict though if they can't share the same static media files. That is, have each have media in different locations and configure settings for each Django project appropriately.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.