Slashdot Mirror


Mod_Python for Apache 2.0 is released

semanticgap writes "The beauty of Python at Apache speeds! A couple of months after donation to ASF, a new mod_python is out under the Apache license. Main feature of this release is Apache 2.0 compatibility, including support for filters and connection handlers and many more enhancements. More info at www.modpython.org. Note that this release is not compatible with Apache 1.3."

19 comments

  1. Does it risk taking down the server? by jeorgen · · Score: 2, Interesting
    Is it more like mod_php (installed at most web hosting companies) which is reasonably safe when it comes to protecting sub hosts from taking down the server and each other, or is it more like mod_perl (not installed at most hosting companies) where you'd better run it in a jail on a shared server?

    /jeorgen

    1. Re:Does it risk taking down the server? by Anonymous Coward · · Score: 0

      I think it's more like my ass and your face - a perfect match!!

    2. Re:Does it risk taking down the server? by DrSkwid · · Score: 3, Interesting

      we run our php under suExec
      it makes php a cgi app rather than a mod but that's a trade we're making for the other cgi anyway.

      We decided that it's okay to trade speed for protection.
      We can buy CPU cycles.

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    3. Re:Does it risk taking down the server? by j7953 · · Score: 2

      As far as I know, it doesn't have a "safe mode" like PHP does, so scripted pages run under the server's user id with all of the server's access permissions. However, Apache 2 provides the new perchild MPM, which allows you to assign different user ids to each virtual host. Unfortunately, according to the documentation "this MPM does not currently work on most platforms. Work is ongoing to make it functional."

      Architecturally, assigning user IDs to virtual hosts is a far better solution (even the PHP developers admit that "safe mode" solves the problem at the wrong level) -- once it works, it will obviously solve the problem for all modules, including mod_python and mod_perl, without requiring the module developers to each develop their own, seperate safe mode equivalent.

      --
      Sig (appended to the end of comments I post, 54 chars)
    4. Re:Does it risk taking down the server? by davegaramond · · Score: 1
      ...However, Apache 2 provides the new perchild MPM...

      except that, sadly, the perchild MPM development seems to be dormant.

  2. mod_python works great - when it works by DrSkwid · · Score: 5, Informative

    mod_python for 1.3 had an annoying threading conflict. Which meant that the python version you needed for mod_python was generally different from the default install.
    It caught me out during a server replacement. I couldn't get it working on the fresh install.

    Luckily the mod_python code I'd used had been for internal administration that I could do manually. I spent the week re-writing the python in php.

    I've just read through the 3.0 manual and it looks like this restriction is lifted :

    2.1 Prerequisites

    * Python 2.2.1 or later. Earlier versions of Python will not work.
    * Apache 2.0.40 or later (For Apache 1.3.x, use mod_python version 2.7.x).

    In order to compile mod_python you will need to have the include files for both Apache and Python, as well as the Python library installed on your system. If you installed Python and Apache from source, then you already have everything needed. However, if you are using prepackaged software (e.g. Linux Red Hat RPM, Debian, or Solaris packages from sunsite, etc) then chances are, you have just the binaries and not the sources on your system. Often, the Apache and Python include files and libraries necessary to compile mod_python are part of separate "development" package. If you are not sure whether you have all the necessary files, either compile and install Python and Apache from source, or refer to the documentation for your system on how to get the development packages.

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    1. Re:mod_python works great - when it works by semanticgap · · Score: 1

      Since both Python and Apache default to using threads (except for FreeBSD, where Apache defaults to not using threads), this is no longer an issue.

  3. Obligatory Monty Python Reference by Anonymous Coward · · Score: 0

    Note that this release is not compatible with Apache 1.3.

    So is that like saying "I fart in your general direction" ?

  4. In Red Hat 8... by Micah · · Score: 2

    [root@eclipse root]# rpm -q mod_python
    mod_python-3.0.0-10
    [root@eclipse root]# rpm -q httpd
    httpd-2.0.40-8

    Is that just a beta? The version number doesn't seem to indicate that, unlike with mod_perl:

    [root@eclipse root]# rpm -q mod_perl
    mod_perl-1.99_05-3

    1. Re:In Red Hat 8... by Anonymous Coward · · Score: 1, Informative

      It's got to be a beta. The release version is 3.0.1. If there is no RPM - compile it from scratch, it compiles on RH without a hinch.

  5. Mod Python by Kizzle · · Score: 3, Funny

    and the search for the.... ah nevermind

    1. Re:Mod Python by fiesty · · Score: 2, Funny

      shut up, you tool. Haha, I called kyle a tool. Kizzle ma Nizzle, as the annoying people say. Go to where people like you, in the dumpster. Stop posting.

  6. uh-oh by DrSkwid · · Score: 2

    I'm a FreeBSD user. Is this a "heads up, trouble is coming" situation?

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    1. Re:uh-oh by semanticgap · · Score: 1

      No, there is a workaround. Read the mod_python README, "OS Hints" section.

  7. Re:mod_python and threading by khanyisa · · Score: 1

    According to the mailing lists, it seems like threading will work with apache 1.3 as well, you just need to use Python 2.2.1. See this message. Since one of the requirements for mod_python 3.0 is Python 2.2.1, it seems reasonable to assume that this is the reason it works with Apache 2.0 as well...

  8. The Win32 mod_python requires msvcr70.dll by Anonymous Coward · · Score: 0

    Without the MS Visual Studio 7 run-time file, you will get a "module not found" even when the mod_python.so is in the right spot...

    You can get the MS VS run-time file at:
    http://www.dll-files.com/dllindex/dll-files.shtml? msvcr70

    copy msvcr70.dll %windir%\System32

    And everything should work after that...

    -Ironstorm

  9. To stop error "could not import mod_python.apache" by Anonymous Coward · · Score: 0

    If you download the .so from apache.org you'll
    need to also get
    http://www.apache.org/dist/httpd/modpython/dev/mod _python-3.0.0-BETA4.tgz

    Uncompress it and copy lib/python/mod_python/*.py
    to %PYTHON_HOME%/Lib/site-packages/mod_python

    Otherwise you will get,
    [Wed Dec 11 03:45:17 2002] [error] make_obcallback: could not import mod_python.apache.
    when you are trying to do the tests & tutorials...