I want to point multiple Domains (each with and whitout ssl) to a single Django App, using mod_wsgi with Apache 2.
I already know how to set up Django to support multiple Domains, but I do not know how to set up Apache properly. If the s开发者_JS百科ites didn't have to use SSL, I would use "ServerAlias"-directives for all relevant domains. But since the domains have to be accessed with and without using SSL, I don't know how to forward both ports for all domains to one single Django App. Google only shows results for redirecting all domains to one single domain.
If they are using exact same code base, and same Django settings module etc, then set them up as if they are different applications, but at global scope in Apache configuration add:
WSGIDaemonProcess all-django-sites
and then in each VirtualHost add:
WSGIProcessGroup all-django-sites
WSGIApplicationGroup %{GLOBAL}
This will cause mod_wsgi to create a daemon process group with all requests handled by single Django instance running in that.
If you code base and settings are different then you can't do this as you can't run more than one Django instance in same interpreter.
精彩评论