我得到的网站无法到达。我不确定是不是因为我有运行.py而不是应用程序副本例如从那里运行应用程序?在
/var/www/O2中的应用程序结构:O2
app(folder)
----static(folder)
----templates(folder)
----___init___.py
migrations(folder)
venv(virtualenv)
create_db.py
manage.py
config.py
run.py
这是app文件夹中的init.py:
^{pr2}$
这是我的wsgi:import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0, "/var/www/O2")
from app import app as application
这是我的O2.conf:
ServerName 35.163.62.121
ServerAlias ec2-35-163-62-121.us-west-2.compute.amazonaws.com
ServerAdmin admin@35.163.62.121
DocumentRoot /var/www/O2/app/templates
WSGIDaemonProcess O2 python-path=/var/www/O2:/var/www/O2/venv/lib/python2.7/site-packages WSGIProcessGroup O2
WSGIScriptAlias / /var/www/O2/O2.wsgi
Order allow,deny
Allow from all
Alias /static /var/www/O2/app/static
Order allow,deny
Allow from all
Alias /templates /var/www/O2/app/templates
Order allow,deny
Allow from all
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined