wsgi:警告apache和python

2024-04-20 00:37:39 发布

您现在位置:Python中文网/ 问答频道 /正文

我运行了一个django项目,但是

Internal Server Error

所以我查了一下error.log,得到了:

[wsgi:warn] Target WSGI script '/var/www/shop/shop/wsgi.py'
  cannot be loaded as Python module.

我试着通过三个步骤来解决这个问题:

  1. sudo apt-get remove libapache2-mod-wsgi
  2. pip install mod_wsgi
  3. mod_wsgi-express module-config

但是我不知道如何将config的信息添加到Apache配置中。你知道吗

我使用的是Ubuntu,因此Apache中没有名为httpd.conf的文件,因此我尝试将mod_wsgi config的信息插入文件000-default,但它不起作用,在我重新启动apache时返回错误:

caught sigterm shutting down

我试图删除我添加的代码并重新启动, 但我还有一个错误:

Job for apache2.service failed because the control process
  exited with error code.

我很困惑,有人能把我从混乱中救出来吗?你知道吗


Tags: 文件项目django信息modconfigwsgiserver