【发布时间】:2018-12-14 14:13:21
【问题描述】:
我正在尝试在 AWS EC2 实例上使用 apache 设置 Django。
这是 /etc/apache2/sites-available 下的 000-default.conf 看起来像这样
<VirtualHost *:80>
ServerName mysite
ServerAlias mysite.com
ServerAdmin mysite@gmail.com
DocumentRoot /var/www/mysite
WSGIScriptAlias /mysite /var/www/mysite/mysite/wsgi.py
ErrorLog /home/ubuntu/apache/errors/error.log
CustomLog /home/ubuntu/apache/errors/custom.log combined
</VirtualHost>
我的 Django 项目在/var/www/ 下
我的python位置/home/ubuntu/anaconda3/bin/python
当我访问该网站时,这就是我得到的。
【问题讨论】:
-
我建议你切换到 Nginx。你可以查看this 使用 Nginx、Gunicorn 和 Supervisor 部署 Django 应用程序的指南。
标签: python django apache amazon-ec2