我有一个网站 https://example.org (HTTPS) 与 php, Apache2 。我需要在同一台服务器 (Centos 6) 上运行 Django 应用程序。
可以在 https://example.org/my_django_app/ 中执行 django 应用程序?
我可以在子域(http://my_django_app.example.org/)中执行,这里的问题是我需要为子域购买另一个证书。
回答
在虚拟主机配置(Apache 2.2)中,更改正常配置
WSGIScriptAlias / /my/route/wsgi.py
指定目录名称。
WSGIScriptAlias /directory /my/route/wsgi.py
您的 Django 项目在 https://example.org/directory 中运行和你的 https://example.org执行php
请您参考如下方法:
编辑虚拟主机配置,添加python配置
WSGIDaemonProcess inti python-path=/path/to/myproject:/path/to/env/lib/python2.7/site-packages
WSGIProcessGroup inti
WSGIScriptAlias /directory /path/to/wsgi.py
