Flask应用不使用Apache2 WSGI文件

问题描述 投票:0回答:1
我的

/home/ubuntu/dev/test

文件夹上有一个Python烧瓶应用程序,如果我运行
python test.py
,我可以接收一个
* Running on http://127.0.0.1:5000
并在本地成功进行测试。
但是,当我尝试使用WSGI中的Apache 2服务器中使用此应用程序时,它不起作用。

test.wsgi

文件在我的

/home/ubuntu/dev/test
文件夹中,带有.py文件:
import sys
sys.path.insert(0, '/home/ubuntu/dev/test')
from test import app as application

文件权限为
-rwxr-xr-x 1 ubuntu ubuntu

在我的000-default.conf中,我有:

<VirtualHost *:80> # RewriteEngine On # RewriteCond %{HTTPS} !=on # RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L] # ServerName MY-SERVER # Redirect permanent / https://MY-ADDRESS ServerAdmin webmaster@localhost DocumentRoot /var/www/html WSGIDaemonProcess test threads=5 WSGIScriptAlias / /home/ubuntu/dev/test/test.wsgi <Directory /home/ubuntu/dev/test> WSGIProcessGroup test WSGIApplicationGroup %{GLOBAL} Order deny,allow Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </virtualhost>

关于我做错了什么的想法?

我刚将.wsgi文件移回/var/www/html/现在正在工作。
python flask apache2 wsgi
1个回答
0
投票

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.