0

In a highly-upvoted comment to this answer two statements are made:

mod_wsgi is for running web apps.

mod_python is for extending httpd.

I suppose that the first statement refers to interactive websites as web-apps. But what does the second statement mean? httpd is very commonly the Apache daemon which serves the website. How is Apache extended? How is this different than "serving a web app"?

Community
  • 1
  • 1
dotancohen
  • 30,064
  • 36
  • 138
  • 197

2 Answers2

2

mod_python can be used to write Apache extensions in general.

Extensions like mod_rewrite (albeit with clunkier configuration) could be written with mod_python; it's not specific to serving web services written in Python, but can be used to modify Apache behaviors even in conjunction with other app servers or content sources.

The original paper introducing mod_python goes into this in some detail: A handler written in mod_python can take some action on a request, and then decline to act as a terminal handler, letting other Apache modules (including, eventually, the static handler) decide what to return.

Charles Duffy
  • 280,126
  • 43
  • 390
  • 441
  • Thank you! With the example given, the statement becomes clear. – dotancohen Mar 15 '15 at 14:39
  • One can use mod_wsgi to extend some parts of Apache as well. In fact the main reason people previously used mod_python was to implement custom authentication mechanisms. One can do that with mod_wsgi as well and it actually does it in a better way, properly hooking into Apache's authentication provider hooks. There isn't really much beyond that that saw a lot of use as far as extending Apache with Python. Everything else was simply Python web applications. – Graham Dumpleton Mar 16 '15 at 03:12
-2

It just means Apache is then able to interpret Python scripts and replace the python with HTML/js to serve to the client. Allows it to serve "web apps" written in Python

Josh Allemon
  • 842
  • 7
  • 8
  • This answer is flatly wrong; mod_python is far more flexible than this, and can intercept and interact with requests that it isn't providing body content for itself. (Indeed, otherwise the distinction would make no sense -- mod_wsgi can provide body content serving webapps in Python as well). – Charles Duffy Mar 15 '15 at 14:27