我目前有一个 Django 网站在cinepass.com,我想在同一台服务器上部署一个额外的 PHP 网站mobile.cinepass.com.ec
我的当前httpd配置文件(从丹戈福):
<Directory "/home/ec2-user/cinepass/media">
Order deny,allow
Allow from all
</Directory>
<Directory "/home/ec2-user/cinepass/cinepass">
AllowOverride All
Order deny,allow
Allow from all
</Directory>
Alias /media/ /home/ec2-user/cinepass/media/
ServerAdmin [email protected]
ErrorLog "logs/cinepass.com-error_log"
CustomLog "logs/cinepass.com-access_log" common
# mod_wsgi configuration is here
# we are running as user/group 'deamon', if you don't have those you need to change or create.
WSGIDaemonProcess cinepass python-path=/home/ec2-user/cinepass:/home/ec2-user/cinepass/venv/lib/python2.6/site-packages user=daemon group=daemon processes=2 threads=25
WSGIProcessGroup cinepass
# this is our WSGI file.
WSGIScriptAlias / /home/ec2-user/cinepass/cinepass/wsgi.py
我的当前wsgi.py:
import os, sys
sys.path.append('/home/')
sys.path.append('/home/ec2-user/cinepass/')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cinepass.settings_production.py")
os.environ['PYTHON_EGG_CACHE'] = '/tmp'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
我该如何编辑我的 Apache 配置,以便我也可以在mobile.cinepass.com.ec?
答案1
安装并激活 PHP 模块。将移动网站的 DocumentRoot 指向包含 PHP 文件的目录即可。
我们运行一个包含多个 php 站点和一个 Django 站点的服务器。使用 Django 运行起来比使用 PHP 要复杂得多。