调试“分割故障(核心倾倒)”对于使用Mod-Wsgi-Py3(Ubuntu)部署在Apache上的烧瓶应用程序

发布于 2025-01-23 18:45:46 字数 1870 浏览 4 评论 0 原文

我创建了一个烧瓶应用程序,该应用使用美丽的汤和硒来刮擦和跟踪亚马逊产品价格。数据是使用CS50版本的Sqlalchemy存储的。

然后,我创建了一个帐户,以使用Ubuntu使用Oracle始终免费VM。我遵循了这一精美的指南 https://asdkazmi.medium.com/deploying-flask-app-app-with-with-wsg-wsgi-and-apache-server-on-on-ubuntu-20-04-3966607e0e0e40e40f 文件和WSGI文件。我还将网络规则添加到Oracle的虚拟云网络和Iptables上,我相信这很好。

此后,该网站仍然无法启动。 Apache的错误日志显示了“ cendriseError:[errno 13]拒绝的权限:'/flask_session'”。基于这篇文章在Weberver上编写文件时(烧瓶,apache& wsgi)我将OS Env更改为我的env os.chdir('/home/home/ubuntu/flaskapp') sudo chown -r ubuntu:www -data flaskapp sudo chmod -r g+s flaskapp

现在,我的头版可以在 rows = userdb.execute(“从userame =?”中select * select * select * select *? 。

我认为这不是我的代码错误,因为它在本地运行良好,并且当我使用本指南在Oracle VM上进行设置时,生产服务器也可以工作-us/iaas/developer-Tutorials/tutorials/flask-on-ubuntu/01oci-ubuntu-flask-summary.htm“ rel =” nofollow noreferrer“开发人员教程/教程/flask-on-ubuntu/01oci-ubuntu-flask-summary.htm 。

我已经找到了有关调试的指南使用GDB。但是使用 source/etc/apache2/envvars sudo -e gdb/usr/sbin/apache ,它只是告诉我“未指定的可执行文件”。

关于错误的想法?

I created a Flask app that uses Beautiful Soup and Selenium to scrape and track Amazon product prices. The data was stored using CS50's version of SQLalchemy.

I then created an account to use Oracle's always free VM, with Ubuntu. I followed this excellent guide to the dot https://asdkazmi.medium.com/deploying-flask-app-with-wsgi-and-apache-server-on-ubuntu-20-04-396607e0e40f and set up Apache's conf file and the Wsgi file. I also added the network rules on Oracle's Virtual Cloud Network and to iptables, which I believe works fine.

Following this, the website still couldn't launch. Apache's error log showed a "PermissionError: [Errno 13] Permission denied: '/flask_session'". Based on this post Permission issue when writing file on webserver (flask, apache & wsgi) I changed the OS env to my env os.chdir('/home/ubuntu/flaskapp') and used chown to give rights
sudo chown -R ubuntu:www-data flaskapp
sudo chmod -R g+s flaskapp.

Now, my front page is accessible on http://129.150.38.171/ . However, upon any request to the server, Chrome displays "This page isn’t working 129.150.38.171 didn’t send any data." Apache's log shows a "segmentation fault (core dumped) python flask". Based on the sequence of my code, the error begins when I try to execute SQL, e.g. rows = usersdb.execute("SELECT * FROM users WHERE username = ?", request.form.get("username")).

I do not think that it is not my codes' error as it runs fine locally and the production server also worked when I set it up on Oracle VM using this guide https://docs.oracle.com/en-us/iaas/developer-tutorials/tutorials/flask-on-ubuntu/01oci-ubuntu-flask-summary.htm .

I've found this guide on debugging https://www.bustawin.com/debug-segmentation-faults-in-apache-from-mod_wsgi/ using gdb. But with source /etc/apache2/envvars
sudo -E gdb /usr/sbin/apache, it just tells me "No executable file specified".

Any ideas on what could be the error?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文