大约 7 个月前,我创建了一个由 Apache 提供的 flask API,一切运行正常,直到上周它开始返回以下错误:"data":[],"pagination":{"cursor":null},"raw":"{\"error\":\"access_denied\",\"hint\":\"Access token is invalid\",\"message\":\"The resource owner or authorization server denied the request.\"}","headers":{"date":"Mon, 12 Sep 2022 22:55:56 GMT","server":"Apache/2.4.43 () mod_wsgi/4.8.0 Python/3.7 OpenSSL/1.0.2k-fips","upgrade":"h2,h2c","connection":"Upgrade, close","content-length":"134","content-type":"application/json"}}
如果我重新启动 Apache 服务器,sudo httpd -k stop/start
它会重新工作几个小时,然后返回相同的错误,这可能是什么原因造成的?我有一个非常基本的 Apache 配置:
<VirtualHost *:1024>
WSGIDaemonProcess flask_api python-path=/var/www/html/flask_api:/var/www/html/flask_api/flask_env/lib/python3.7/site-packages
# Add machine's IP address (use ifconfig command)
ServerName *******
# DocumentRoot /home/ec2-user/flask_api/
# Give an alias to to start your website url with
WSGIScriptAlias /api /var/www/html/flask_api/api.wsgi
<Directory /var/www/html/flask_api>
WSGIProcessGroup flask_api
WSGIApplicationGroup %{GLOBAL}
# set permissions as per apache2.conf file
Options +Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
LogLevel warn
</VirtualHost>