1

我已经apache2安装ubuntu lucid并启用了。现在ssl我正在使用. 我已经配置了文件,如下所示。djangomyapp1mod_wsgi/etc/apache2/sites_enabled/ssl/etc/apache2/sites-available/ssl

现在我可以使用 url 运行我的应用程序

https://127.0.0.1/myapp1

我需要myapp2在同一台服务器上运行另一个 django 应用程序(比如),它也使用 SSL。那么,我应该如何配置它?有人可以帮我吗?

<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>
4

1 回答 1

0

通过增加:

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

如果他们不能共享相同的静态媒体文件,您将需要解决任何冲突。也就是说,让每个人在不同的位置都有媒体,并为每个 Django 项目适当地配置设置。

于 2012-10-03T01:07:34.130 回答