mod_wsgi不允许外部访问flask应用程序

时间:2014-06-06 02:47:11

标签: python flask wsgi

我在灯泡服务器上使用mod_wsgi,我正在尝试部署Flask应用程序,但是从局域网外部看不到它。我已经设置我的主应用程序使用app.run(host ='0.0.0.0'),它也没有处于调试模式。我有服务器设置的iptables为...

    target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere             ctstate NEW,RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:https
DROP       all  --  anywhere             anywhere            

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination 

我阻止了5000端口,因为从我的局域网可以从这些设置访问服务器。

这是我的wsgi文件。

#!/usr/bin/python
import sys
sys.path.insert(0,"/var/www/SnakeByte/SnakeByte")
from SnakeByte import app as application

这是我在/ etc / apache2 / sites-available / SnakeByte

中的文件
<VirtualHost *:80>
        ServerName snakebyte.us

        WSGIDaemonProcess SnakeByte user=user1 group=group1 threads=5
        WSGIScriptAlias / /var/www/SnakeByte/SnakeByte.wsgi
        <Directory /var/www/SnakeByte/SnakeByte/>
            WSGIProcessGroup SnakeByte
            WSGIApplicationGroup %{GLOBAL}  
            Order allow,deny
            Allow from all
        </Directory>
</VirtualHost>

0 个答案:

没有答案