【发布时间】:2016-02-23 09:59:11
【问题描述】:
这似乎在今天早些时候起作用,我不知道发生了什么变化。我对部署非常缺乏经验,所以它可能是我所缺少的最简单的东西。
我在 EC2 上使用默认的 Amazon Linux 映像。在新创建的实例中,输入以下命令:
yum search python34 #Amazon Linux doesn't have 3.5 yet
sudo yum install python34-virtualenv
sudo alternatives --set python /usr/bin/python3.4
virtualenv-3.4 env
sudo pip install --upgrade pip
hash -r
sudo ln -s /usr/local/bin/pip /usr/bin/pip
sudo pip install django
django-admin.py startproject MyApp
cd MyApp
python manage.py runserver #This gives me ERR_CONNECTION_REFUSED in Chrome on port 8000, but worked earlier
sudo yum install nginx
sudo service nginx start #This works, I'm able to see the default page on default port
sudo service nginx stop
sudo pip install gunicorn
gunicorn -bind 0.0.0.0:8000 MyApp.wsgi:application #This doesn't even start
这是最后一条命令的结果:
[ec2-user@ip-172-31-48-233 MyApp]$ gunicorn -bind 0.0.0.0:8000 MyApp.wsgi:application
[2015-11-20 19:16:36 +0000] [2547] [INFO] Starting gunicorn 19.3.0
[2015-11-20 19:16:36 +0000] [2547] [ERROR] Retrying in 1 second.
[2015-11-20 19:16:37 +0000] [2547] [ERROR] Retrying in 1 second.
[2015-11-20 19:16:38 +0000] [2547] [ERROR] Retrying in 1 second.
[2015-11-20 19:16:39 +0000] [2547] [ERROR] Retrying in 1 second.
[2015-11-20 19:16:40 +0000] [2547] [ERROR] Retrying in 1 second.
[2015-11-20 19:16:41 +0000] [2547] [ERROR] Can't connect to ('ind', 8000)
[ec2-user@ip-172-31-48-233 MyApp]$
我现在很迷茫,找不到太多最新的资源来指导我完成这个过程的细节。任何帮助将不胜感激,谢谢。
【问题讨论】:
标签: django amazon-web-services nginx amazon-ec2 gunicorn