apache mod-wsgi授予浏览器拒绝权限

时间:2020-05-31 01:29:01

标签: python python-3.x apache flask mod-wsgi

我正在尝试使用wsgi在apache2.4中部署flask应用程序,并且当我尝试在浏览器中访问url时,它抛出了我被禁止的错误,并且仅在添加虚拟主机文件后才会发生,否则默认的apache页面为显示。

我的烧瓶文件

[root@ech-10-168-130-41 Taskr]# ls -ltr
total 16
-rwxrwxrwx 1 dc-user dc-user 4096 May 30 08:48 test.db
drwxrwxrwx 2 dc-user dc-user   57 May 30 08:48 Templates
-rwxrwxrwx 1 dc-user dc-user 2794 May 30 08:48 taskr.py
drwxrwxrwx 2 dc-user dc-user   39 May 30 08:48 static
drwxrwxrwx 2 dc-user dc-user   33 May 30 08:48 __pycache__
-rwxrwxrwx 1 dc-user dc-user  108 May 30 08:48 debug.log
-rwxrwxrwx 1 dc-user dc-user  183 May 30 09:56 taskr.wsgi```

**taskr.wsgi file**
[root@ech-10-168-130-41 ~]# cat /home/dc-user/Taskr/taskr.wsgi
import logging
import sys
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0, '/home/dc-user/Taskr')
from taskr import app as application
application.secret_key = 'asbo rocks'

**virtual host file**

[root@ech-10-168-130-41 ~]# cat /etc/httpd/sites-enabled/taskr.conf
<VirtualHost *:8080>
    ServerName 10.168.130.41:8080
    WSGIDaemonProcess taskr user=dc-user
    WSGIScriptAlias / /home/dc-user/Taskr/taskr.wsgi

    <Directory /home/dc-user/Taskr>
        WSGIProcessGroup taskr
        WSGIApplicationGroup %{GLOBAL}
        Order allow,deny
        Require all granted
        AllowOverride All
    </Directory>
</VirtualHost>

error in the browser is 

0 个答案:

没有答案