这个问题似乎不是关于特定的编程问题、软件算法或主要由程序员使用的软件工具。如果您认为该问题在另一个Stack Exchange站点,您可以留下评论,解释在哪里可以回答问题。
Closed 9 years ago.
我正试图在我维护的Django网站上设置SSL,但在使用SSL设置VirtualHost时遇到了一些问题。我遵循了说明这里但每次我尝试重新启动apache时,它都会告诉它无法重新启动,因为有多个虚拟主机使用相同的wsgi配置:
/etc/init.d/apache2 reload
Syntax error on line 33 of /etc/apache2/sites-enabled/www.mydomain.com:
Name duplicates previous WSGI daemon definition.
...fail!
我理解正在发生的事情,只是不知道如何解决。任何建议都将不胜感激,谢谢!以下是我的VirutalHosts文件的样子:
<VirtualHost *:80>
ServerAdmin my@email.com
ServerName mydomain.com
ServerAlias www.mydomain.com
DocumentRoot /sites/mydomain
# WSGI Settings
WSGIScriptAlias / /sites/mydomain/wsgi_handler.py
WSGIDaemonProcess mydomain user=myuser group=mygroup processes=1 threads=1
WSGIProcessGroup mydomain
# Static Directories
Alias /static /sites/mydomain/static/
<Location "/static">
SetHandler None
</Location>
Alias /img /sites/mydomain/img/
<Location "/img">
SetHandler None
</Location>
</VirtualHost>
<VirtualHost *:443>
ServerAdmin my@email.com
ServerName mydomain.com
ServerAlias www.mydomain.com
DocumentRoot /sites/mydomain
# WSGI Settings
WSGIScriptAlias / /sites/mydomain/wsgi_handler.py
WSGIDaemonProcess mydomain user=myuser group=mygroup processes=1 threads=1
WSGIProcessGroup mydomain
# Static Directories
Alias /static /sites/mydomain/static/
<Location "/static">
SetHandler None
</Location>
Alias /img /sites/mydomain/img/
<Location "/img">
SetHandler None
</Location>
# SSL Stuff
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/crt/vhost1.crt
SSLCertificateKeyFile /etc/apache2/ssl/key/vhost1.key
<Location />
SSLRequireSSL On
SSLVerifyClient optional
SSLVerifyDepth 1
SSLOptions +StdEnvVars +StrictRequire
</Location>
</VirtualHost>