mod_wsgi is an Apache HTTP Server module that provides a WSGI compliant interface for hosting Python web applications under Apache. It supports both embedded and daemon modes, with the ability to run multiple Python versions and virtual environments. Current version 5.0.2 (2024-02-19) requires Python >=3.8. Release cadence is irregular, typically minor updates every few years.
pip install mod-wsgiVerified import paths — ran on the pinned version, not inferred.
Minimal WSGI application file. Place in your Apache document root or a directory accessible to Apache, then configure Apache with 'WSGIScriptAlias / /path/to/myapp.wsgi'.
Use 'WSGIDaemonProcess' to isolate application in daemon mode with controlled thread count.
Set 'WSGIApplicationGroup %{GLOBAL}' if using single-threaded frameworks; use 'maximum-requests' to recycle processes.Migrate to Python 3 and upgrade mod_wsgi to >=5.0.0.
Use Apache with mod_wsgi in production; mod_wsgi-express is for testing only.
Set 'WSGIPythonHome /path/to/venv' in Apache config.