Resolution of 503 error in apache deployment python program

  • 2020-06-12 09:52:29
  • OfStack

preface

This article mainly introduces how to solve the problem of 503 error in apahce deployment python program, but I will not say much more about it. Let's take a look at the details in the next one.

Found the problem

After updating the server today, it was found that an python program deployed with apache could not be accessed. 503 error was returned and the error log was as follows:


[Thu Apr 13 10:54:40 2017] [error] [client 127.0.0.1] (13)Permission denied: mod_wsgi (pid=1814): Unable to connect to WSGI daemon process 'trac' on '/etc/httpd/logs/wsgi.1798.0.2.sock' after multiple attempts.

To solve the process

1. It seems that there is a permission problem, so I modified the permission of the corresponding sock file to 777, and found the error was still 503, which is the same after restarting the httpd service. Why is the sock file in the logs directory? Generally speaking, it should be under /var/run.

So I opened the corresponding configuration file and found that there was no option to configure WSGISocketPrefix, so I added WSGISocketPrefix /var/run/wsgi to the conf file and then restarted the service and it returned to normal.

Strangely enough, if I hadn't configured this before, why wouldn't I get an error? Is this a version update problem? Know friends can leave a message to discuss.

conclusion


Related articles: