Solution to the 503 error in deploying python programs in apache, python503

Source: Internet
Author: User

Solution to the 503 error in deploying python programs in apache, python503

Preface

This article describes how to solve the 503 error in python program deployment by apahce. I will not talk about it much below. Let's take a look at the details.

Problems Found

After the server is updated today, it is found that a python program deployed using apache cannot be accessed. The error 503 is returned and the error log is 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.

Solution Process

First, the permission problem occurs. Therefore, the permission of the corresponding sock file is modified to 777, and the error 503 is found. This is also true after the httpd service is restarted. At this time, I found a problem. Why is this sock file stored in the logs directory? Generally, it should be in the/var/run directory?

Open the corresponding configuration file and find that the WSGISocketPrefix option is not configured. Then add WSGISocketPrefix/var/run/wsgi to the conf file and restart the service.

The strange thing is, how can I not report an error if I haven't configured it before? Is it because of version updates? You can leave a message to discuss it.

Summary

The above is all the content of this article. I hope the content of this article will help you in your study or work. If you have any questions, please leave a message, thank you for your support.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.