简体   繁体   English

"使用 FastCGI 在 IIS 中部署 Python Web 应用程序(Flask)得到 500 内部服务器错误"

[英]Deploying Python web app (Flask) in IIS using FastCGI get 500 Internal Server Error

I am trying to deploy Flask app in IIS.我正在尝试在 IIS 中部署 Flask 应用程序。

But I get the 500 FastCGI error.但我收到 500 FastCGI 错误。

error code:"0x8007010b"错误代码:“0x8007010b”

Here are the steps I've taken:以下是我采取的步骤:

OS:windows10操作系统:windows10

Python version:3.6.5 Python版本:3.6.5

1.install url rewrite2.0 1.安装url rewrite2.0

2.pip install wfastcgi 2.pip安装wfastcgi

3.Enable wfastcgi 3.启用wfastcgi

4.create HelloAPI.py 4.创建HelloAPI.py

5.create web.config 5.创建web.config

HelloAPI.py你好API.py

from flask import Flask
app=Flask(__name__)

@app.route('/',methods=['GET'])
def index():
    return "Hello Flask!"

if __name__=='__main__':
    app.run(debug=True)

Problem solved.问题解决了。 I grant the r/w right to python.exe folder and it works fine now.我授予 python.exe 文件夹的 r/w 权限,现在它工作正常。

您需要对包含“IIS AppPool\\DefaultAppPool”的 python.exe 的整个 python 文件夹具有读取和执行权限

I solved the problem granting r\/w right to both folders:我解决了授予两个文件夹读写权限的问题:

  • python.exe folder python.exe 文件夹<\/li>
  • project folder项目文件夹<\/li><\/ul>

    The two users I gave access to were the following:我授予访问权限的两个用户如下:

    • IIS_IUSRS IIS_IUSRS<\/li>
    • IUSR IUSR<\/li><\/ul>"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM