无效命令“WSGIReloadMechanism”在我的 Apache 站点的配置文件中

发布于 2024-10-19 16:35:54 字数 819 浏览 3 评论 0原文

我正在尝试部署 Django 项目,并使用 Apache2 和 mod_wsgi。以下是我的 Apache conf 文件中的相关行:

WSGIScriptReloading On
WSGIDaemonProcess myprojectcom
WSGIReloadMechanism Process
WSGIProcessGroup myprojectcom
WSGIApplicationGroup myprojectcom
WSGIPassAuthorization On

WSGIScriptAlias / /home/myproject/myproject/deploy/deploy.wsgi

我在许多其他部署中使用了非常相似的 conf 文件,但这是我第一次收到以下错误:

/etc/apache2/sites-available$ sudo /etc/init.d/apache2 restart
Syntax error on line 8 of /etc/apache2/sites-enabled/myproject.com:
Invalid command 'WSGIReloadMechanism', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
  ...fail!

尽管我没有看到任何语法错误。我在 Ubuntu 上,使用 libapache2-mod-wsgi 包。可能出什么问题了?

I am trying to deploy a Django project and am using Apache2 with mod_wsgi. Here are the relevant lines in my Apache conf file:

WSGIScriptReloading On
WSGIDaemonProcess myprojectcom
WSGIReloadMechanism Process
WSGIProcessGroup myprojectcom
WSGIApplicationGroup myprojectcom
WSGIPassAuthorization On

WSGIScriptAlias / /home/myproject/myproject/deploy/deploy.wsgi

I've used a very similar conf file for many other deployments, but this is the first time that I'm getting the following error:

/etc/apache2/sites-available$ sudo /etc/init.d/apache2 restart
Syntax error on line 8 of /etc/apache2/sites-enabled/myproject.com:
Invalid command 'WSGIReloadMechanism', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
  ...fail!

I don't see any syntax error, though. I'm on Ubuntu, using the libapache2-mod-wsgi package. What could be wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泪痕残 2024-10-26 16:35:54

删除整行:

WSGIReloadMechanism Process

不再需要它,并且该指令在 mod_wsgi 3.X 中被完全删除。

您最好不要依赖旧的博客文章来了解如何设置 mod_wsgi,而是使用 mod_wsgi 站点上的实际 mod_wsgi 文档。

Remove the whole line:

WSGIReloadMechanism Process

It isn't needed any more and the directive was removed completely in mod_wsgi 3.X.

You should preferable not rely on old blog posts for how to set up mod_wsgi and use the actual mod_wsgi documentation on the mod_wsgi site instead.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文