Don’t use mod_python

前天配置 mod_python 正恼火呢,没想到今天看到这篇文章,看来有同感的人真是很多阿。

#python.web 里面就建议大家不要使用 mod_python,列举了一些缺点:

  1. It complicates your upgrade process, as versions of Python, Apache, and mod_python must be coordinated. The appropriate versions are not always available for some combinations.
  2. It makes user separation or chrooting of webapps impossible.
  3. If you’re using PHP and mod_python, and you’re using MySQL in both languages, you generally must coordinate versions of MySQL as well, or suffer lots of configuration headaches. The same applies for many other popular C libraries.
  4. Apache’s processes will be heavier because you’re embedding a python interpreter in it.
    Debugging a wsgi app is a lot easier.
  5. mod_python is a module for Apache, which is tested less than other well known Apache modules such as mod_proxy. Because of this reason the server administrator (which might not be you) might not want to install this module for security reasons.
  6. You wont find a lot of hosting companies offering mod_python, which makes wsgi applications (which can be deployed through several ways) very flexible in your quest for a hosting company.

总的来说,mod_python 配置有麻烦,用起来又占系统资源,真不是什么好的选择。用 FastCGI 和 SCGI 似乎是更好的选择。

2 comments so far

  1. ShiningRay March 27, 2008 3:24 pm

    python不是有自己的标准么,wsgi

  2. Nicholas March 27, 2008 3:34 pm

    有人开发了一个 mod_wsgi,听说不错,不过我没试过。

Leave a comment

Please be polite and on topic. Your e-mail will never be published.