mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-12 17:21:55 -06:00
61e2016ee3
Script wsgi.py checks if Apache is compiled with MPM=Prefork and if not, it refuses to run. https://fedorahosted.org/freeipa/ticket/252
30 lines
968 B
Python
30 lines
968 B
Python
"""
|
|
WSGI appliction for IPA server.
|
|
"""
|
|
from ipalib import api
|
|
from ipalib.config import Env
|
|
from ipalib.constants import DEFAULT_CONFIG
|
|
|
|
# Determine what debug level is configured. We can only do this
|
|
# by reading in the configuration file(s). The server always reads
|
|
# default.conf and will also read in `context'.conf.
|
|
env = Env()
|
|
env._bootstrap(context='server', log=None)
|
|
env._finalize_core(**dict(DEFAULT_CONFIG))
|
|
|
|
# Initialize the API with the proper debug level
|
|
api.bootstrap(context='server', debug=env.debug, log=None)
|
|
try:
|
|
api.finalize()
|
|
except StandardError, e:
|
|
api.log.error('Failed to start IPA: %s' % e)
|
|
else:
|
|
api.log.info('*** PROCESS START ***')
|
|
|
|
# This is the WSGI callable:
|
|
def application(environ, start_response):
|
|
if not environ['wsgi.multithread']:
|
|
return api.Backend.session(environ, start_response)
|
|
else:
|
|
api.log.error("IPA does not work with the threaded MPM, use the pre-fork MPM")
|