在共享托管服务器上使用烧瓶的问题

发布于 2025-02-07 02:01:58 字数 1355 浏览 3 评论 0原文

我正在尝试在Bluehost共享的托管服务器上部署烧瓶应用程序。我一直在关注本指南。我做了一个更改,那就是.fcgi文件中。我不使用flup。这是我的.fcgi file(flask.fcgi):

#!/path/to/venv/bin/python
from wsgiref.handlers import CGIHandler
from server import app

CGIHandler().run(app)

我已经使文件可执行,当我运行./ blask.fcgi时从命令行(通过SSH),它返回索引路由的HTML页面,这是我期望的。但是,如果我导航到mydomain.com/flask.fcgi我会收到500个内部服务器错误。检查服务器日志我可以看到此消息:

/path/to/venv/bin/python: error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory

我在安装openssl时遇到此错误,并通过设置ld_library_path环境变量来对其进行整理,以包括到达位置的路径库已安装。这是我的.htaccess文件:

# For Flask
PassEnv LD_LIBRARY_PATH
PassEnv REQUEST_METHOD
Options +ExecCGI
AddHandler fcgid-script .fcgi

RewriteEngine On

# For Flask
RewriteCond %{REQUEST_FILENAME} !=/path/to/public_html/flask.fcgi
RewriteRule ^(.*)$ flask.fcgi/$1 [QSA,L]

RewriteOptions inherit

您可以看到我尝试传递ld_library_path变量,但毫无用处,我继续收到500个内部服务器错误,不管我是直接导航到mydomain.com/page还是直接到mydomain.com/flask.fcgi

我完全不愿从这里去哪里,任何帮助将不胜感激。

I'm trying to deploy a Flask application on a BlueHost shared hosting server. I have been following this guide. I have made one change, and that is in the .fcgi file. I'm not using flup. This is my .fcgi file (flask.fcgi):

#!/path/to/venv/bin/python
from wsgiref.handlers import CGIHandler
from server import app

CGIHandler().run(app)

I've made the file executable, and when I run ./flask.fcgi from the command line (via SSH) it returns the HTML page for the index route, which is what I expect. But if I navigate to mydomain.com/flask.fcgi I receive a 500 Internal Server error. Checking the server logs I can see this message:

/path/to/venv/bin/python: error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory

I encountered this error before while installing openssl and rectified it by setting the LD_LIBRARY_PATH environment variable to include the path to the location where the libraries were installed. This is my .htaccess file:

# For Flask
PassEnv LD_LIBRARY_PATH
PassEnv REQUEST_METHOD
Options +ExecCGI
AddHandler fcgid-script .fcgi

RewriteEngine On

# For Flask
RewriteCond %{REQUEST_FILENAME} !=/path/to/public_html/flask.fcgi
RewriteRule ^(.*)$ flask.fcgi/$1 [QSA,L]

RewriteOptions inherit

You can see that I try to pass in the LD_LIBRARY_PATH variable, but to no avail, I continue to receive the 500 Internal Server errors, regardless of whether I navigate to mydomain.com/page or to mydomain.com/flask.fcgi directly.

I'm entirely at a loss of where to go from here, any help would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

丘比特射中我 2025-02-14 02:01:58

所以我弄清楚了问题是什么。我需要设置ld_library_pathld_run_path在编译opensslpython之前。我设置了路径,然后运行./配置make&&为openssl进行安装,而python则相同。

So I figured out what the problem was. I needed to set LD_LIBRARY_PATH and LD_RUN_PATH before compiling openssl and python. I set the paths and then ran ./Configure and make && make install for openssl, and the same for python.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文