我使用Flask开发了一个网站。它适用于localhost(Elementary os Loki)。但是当我将它转移到服务器(Ubuntu 16.04)时,它没有加载。浏览器显示'连接已超时'信息。我在error.log中也看不到任何错误消息。可能的问题是什么?以及如何解决这个问题?
我附上了我的.wsgi文件和.conf文件。
papers.wsgi文件
#!/usr/bin/python
import sys
import logging
import site
import os
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0, "/var/www/html/papers")
site.addsitedir('/home/user/papers/flask/local/lib/python3.5/site-packages')
sys.path.append('/var/www/html/papers')
activate_env = '/home/user/papers/flask/bin/activate_thi.py'
execfile(activate_env, dict(__file__=activate_env))
from run import app as application
papers.conf文件
Listen 16000
<VirtualHost *:16000>
ServerName localhost
DocumentRoot /var/www/html/papers
WSGIDaemonProcess localhost user=www-data group=www-data threads=5
WSGIScriptAlias / /var/www/html/papers/papers.wsgi
<Directory /var/www/html/papers>
Order allow,deny
Allow from all
Require all granted
</Directory>
Alias /static /var/www/html/papers/app/static
<Directory /var/www/html/papers/app/static>
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>