Впоследствии я просмотрел онлайн-руководство, но с тем же результатом:
https:// medium.com/@thishantha17/build-a-simple-python-rest-api-with-apache2-gunicorn-and-flask-on-ubuntu-18-04-c9d47639139b
приложение успешно запускается из файла systemd .service:
Код: Выделить всё
[Unit]
Description=Gunicorn instance to serve flask application
After=network.target
[Service]
User=root
Group=www-data
WorkingDirectory=/home/simon/flask_rest/
Environment="PATH=/home/simon/flask_rest/flaskvenv/bin"
ExecStart=/home/simon/flask_rest/flaskvenv/bin/gunicorn --config gunicorn_config.py wsgi:app
[Install]
WantedBy=multi-user.target
прокси: ошибка (13) разрешение отклонено – не удалось установить соединение с веб-сокетом Unix /home/simon/flask_rest/flaskrest.sock
proxy_http:error HTTP: не удалось установить соединение с серверной частью: httpd-UDS
Моя конфигурация Apache2 заключается в следующем:
Код: Выделить всё
# ServerAdmin root@ubuntu
ErrorLog ${APACHE_LOG_DIR}/flaskrest-error.log
CustomLog ${APACHE_LOG_DIR}/flaskrest-access.log combined
ProxyPasss unix:/home/simon/flask_rest/flaskrest.sock|http://127.0.0.1/
ProxyPassReverse unix:/simon/root/flask_rest/flaskrest.sock|http://127.0.0.1/
Кроме того, я разрешил Apache и Apache (v6) в utw.< /p>
Большое спасибо за любую помощь.
Подробнее здесь: https://stackoverflow.com/questions/788 ... untu-22-04