{"id":24059,"library":"mod-wsgi","title":"mod_wsgi","description":"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.","status":"active","version":"5.0.2","language":"python","source_language":"en","source_url":"https://github.com/GrahamDumpleton/mod_wsgi","tags":["apache","wsgi","web-server","deployment"],"install":[{"cmd":"pip install mod-wsgi","lang":"bash","label":"Install mod_wsgi (source build)"}],"dependencies":[{"reason":"Required to compile mod_wsgi from source (system package).","package":"apache2-dev","optional":true},{"reason":"Alternative pre-packaged binary for Debian/Ubuntu instead of pip install.","package":"libapache2-mod-wsgi-py3","optional":true}],"imports":[{"note":"WSGI application callable must be named 'application' (default) or specified via WSGIApplicationGroup directive.","symbol":"application","correct":"def application(environ, start_response): ...  # then assign to module-level 'application'"}],"quickstart":{"code":"# Save as myapp.wsgi\ndef application(environ, start_response):\n    status = '200 OK'\n    output = b'Hello, World!'\n    response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))]\n    start_response(status, response_headers)\n    return [output]","lang":"python","description":"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'."},"warnings":[{"fix":"Use 'WSGIDaemonProcess' to isolate application in daemon mode with controlled thread count.","message":"Thread limit issues when using embedded mode with threaded MPM (worker/event). Default threads per process may cause crashes if exceeded.","severity":"breaking","affected_versions":"all"},{"fix":"Set 'WSGIApplicationGroup %{GLOBAL}' if using single-threaded frameworks; use 'maximum-requests' to recycle processes.","message":"Memory leak when using Python threads or blocking I/O inside mod_wsgi daemon mode with multiple processes.","severity":"gotcha","affected_versions":"all"},{"fix":"Migrate to Python 3 and upgrade mod_wsgi to >=5.0.0.","message":"Python 2 support removed in 5.0.0; mod_wsgi 4.x still available for Python 2.","severity":"deprecated","affected_versions":">=5.0.0"},{"fix":"Use Apache with mod_wsgi in production; mod_wsgi-express is for testing only.","message":"The 'mod_wsgi-express' command is the recommended development server but is not production-ready.","severity":"deprecated","affected_versions":">=4.6.0"},{"fix":"Set 'WSGIPythonHome /path/to/venv' in Apache config.","message":"Virtual environments: must be activated before Apache start or specify Python home via WSGIPythonHome.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'-02':46 '-19':47 '2024':45 '3.8':50 '5.0.2':44 'abil':33 'apach':7,23,61 'applic':21 'cadenc':52 'compliant':15 'current':42 'daemon':29 'deploy':66 'embed':27 'environ':41 'everi':58 'host':18 'http':8 'interfac':16 'irregular':54 'minor':56 'mod':1,3 'mode':30 'modul':10 'multipl':36 'provid':12 'python':19,37,49 'releas':51 'requir':48 'run':35 'server':9,65 'support':25 'typic':55 'updat':57 'version':38,43 'virtual':40 'web':20,64 'web-serv':63 'wsgi':2,4,14,62 'year':60","created_at":"2026-05-01T08:11:04.186964+00:00","updated_at":"2026-05-01T08:11:04.186964+00:00","problems":{"verify_error":"no import statement found"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"6.0.4","cli_name":"","cli_version":null,"type":"library","homepage":"https://www.modwsgi.org/","github":"https://github.com/GrahamDumpleton/mod_wsgi","docs":"https://modwsgi.readthedocs.io/","changelog":null,"pypi":"https://pypi.org/project/mod-wsgi/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"skip","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-06","install_tag":null}}