Fedora Core 9上的Django + FCGID - 我错过了什么?

时间:2022-10-06 08:08:24

Fedora Core 9 seems to have FCGID instead of FastCGI as a pre-built, YUM-managed module. [I'd rather not have to maintain a module outside of YUM; so no manual builds for me or my sysadmins.]

Fedora Core 9似乎有FCGID而不是FastCGI作为预构建的YUM管理模块。 [我宁愿不必在YUM之外维护一个模块;所以没有手动构建我或我的系统管理员。]

I'm trying to launch Django through the runfastcgi interface (per the FastCGI deployment docs).

我正在尝试通过runfastcgi接口启动Django(根据FastCGI部署文档)。

What I'm seeing is the resulting page written to error_log. It does not come back through Apache to my browser. Further, there are a bunch of messages -- apparently from flup and WSGIServer -- that indicate that the WSGI environment isn't defined properly.

我看到的是生成的页面写入error_log。它不会通过Apache回到我的浏览器。此外,还有一堆消息 - 显然来自flup和WSGIServer - 表明WSGI环境没有正确定义。

  1. Is FastCGI available for FC9, and I just overlooked it?

    FastCGI可用于FC9,我只是忽略了它?

  2. Does FCGID and flup actually create the necessary WSGI environment for Django? If so, can you share the .fcgi interface script you're using? Mine is copied from mysite.fcgi in the Django docs. The FCGID Documentations page drops hints that PHP and Ruby are supported -- PHP directly, and Ruby through dispatch.fcgi -- and Python is not supported.

    FCGID和flup实际上是否为Django创建了必要的WSGI环境?如果是这样,你可以共享你正在使用的.fcgi界面脚本吗?我是从Django文档中的mysite.fcgi复制的。 FCGID Documentations页面提供了支持PHP和Ruby的提示 - 直接使用PHP,通过dispatch.fcgi支持Ruby - 并且不支持Python。

Update. The error messages are...

更新。错误消息是......

WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI! 
WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!

Should I abandon ship and switch to mod_python and give up on this approach?

我应该放弃发货并切换到mod_python并放弃这种方法吗?

1 个解决方案

#1


1  

Why don't you try modwsgi? It sounds as the preffered way these days for WSGI applications such as Django.

你为什么不试试modwsgi?这听起来像是Django等WSGI应用程序的最佳方式。

If you don't wan't to compile stuff for Fedora Core, that might be trickier.

如果你不想为Fedora Core编译东西,那可能会更棘手。

Regarding 1) this seems to solve the fcgid configuration problem.

关于1)这似乎解决了fcgid配置问题。

Note that you don't want to run the django application manually like this: python manage.py runfcgi, the fcgi is run by apache automatically if the setup is correct and restarted by touch your.fcgi.

请注意,您不希望手动运行django应用程序:python manage.py runfcgi,如果设置正确并通过触摸your.fcgi重新启动,则fcgi会自动由apache运行。

#1


1  

Why don't you try modwsgi? It sounds as the preffered way these days for WSGI applications such as Django.

你为什么不试试modwsgi?这听起来像是Django等WSGI应用程序的最佳方式。

If you don't wan't to compile stuff for Fedora Core, that might be trickier.

如果你不想为Fedora Core编译东西,那可能会更棘手。

Regarding 1) this seems to solve the fcgid configuration problem.

关于1)这似乎解决了fcgid配置问题。

Note that you don't want to run the django application manually like this: python manage.py runfcgi, the fcgi is run by apache automatically if the setup is correct and restarted by touch your.fcgi.

请注意,您不希望手动运行django应用程序:python manage.py runfcgi,如果设置正确并通过触摸your.fcgi重新启动,则fcgi会自动由apache运行。