ipaserver: Put WSGI config to ipa-wsgi.conf

This commit is contained in:
zpericic authored and Zoran Peričić committed 2022-08-17 08:43:12 +02:00
1 parent a7369944d8
commit e2d7602c1d
10 files changed
+39 -10

No files matched your search

+1
View File
@@ -98,6 +98,7 @@ dist_app_DATA = \
kdcproxy.wsgi \
ipakrb5.aug \
ipa.conf.template \
ipa-wsgi.conf.template \
ipa-kdc-proxy.conf.template \
ipa-pki-proxy.conf.template \
ipa-rewrite.conf.template \
+15
View File
@@ -0,0 +1,15 @@
#
# VERSION 32 - DO NOT REMOVE THIS LINE
#
# This file may be overwritten on upgrades.
#
# FIXME: WSGISocketPrefix is a server-scope directive. The mod_wsgi package
# should really be fixed by adding this its /etc/httpd/conf.d/wsgi.conf:
WSGISocketPrefix $WSGI_PREFIX_DIR
# Configure mod_wsgi handler for /ipa
WSGIDaemonProcess ipa processes=$WSGI_PROCESSES threads=1 maximum-requests=500 \
user=ipaapi group=ipaapi display-name=%{GROUP} socket-timeout=2147483647 \
lang=C.UTF-8 locale=C.UTF-8
-7
View File
@@ -35,14 +35,7 @@ AddOutputFilterByType DEFLATE text/html text/plain text/xml \
application/javascript application/json text/css \
application/x-font-ttf
# FIXME: WSGISocketPrefix is a server-scope directive. The mod_wsgi package
# should really be fixed by adding this its /etc/httpd/conf.d/wsgi.conf:
WSGISocketPrefix $WSGI_PREFIX_DIR
# Configure mod_wsgi handler for /ipa
WSGIDaemonProcess ipa processes=$WSGI_PROCESSES threads=1 maximum-requests=500 \
user=ipaapi group=ipaapi display-name=%{GROUP} socket-timeout=2147483647 \
lang=C.UTF-8 locale=C.UTF-8
WSGIScriptAlias /ipa /usr/share/ipa/wsgi.py process-group=ipa \
application-group=%{GLOBAL}
WSGIScriptReloading Off
+1
View File
@@ -50,6 +50,7 @@ class BasePathNamespace:
HTTPD_IPA_PKI_PROXY_CONF = "/etc/httpd/conf.d/ipa-pki-proxy.conf"
HTTPD_IPA_REWRITE_CONF = "/etc/httpd/conf.d/ipa-rewrite.conf"
HTTPD_IPA_CONF = "/etc/httpd/conf.d/ipa.conf"
HTTPD_IPA_WSGI_CONF = "/etc/httpd/conf.d/ipa-wsgi.conf"
HTTPD_NSS_CONF = "/etc/httpd/conf.d/nss.conf"
HTTPD_SSL_CONF = "/etc/httpd/conf.d/ssl.conf"
HTTPD_SSL_SITE_CONF = "/etc/httpd/conf.d/ssl.conf"
+1
View File
@@ -24,6 +24,7 @@ class DebianPathNamespace(BasePathNamespace):
HTTPD_IPA_PKI_PROXY_CONF = "/etc/apache2/conf-enabled/ipa-pki-proxy.conf"
HTTPD_IPA_REWRITE_CONF = "/etc/apache2/conf-available/ipa-rewrite.conf"
HTTPD_IPA_CONF = "/etc/apache2/conf-enabled/ipa.conf"
HTTPD_IPA_WSGI_CONF = "/etc/apache2/conf-enabled/ipa-wsgi.conf"
HTTPD_NSS_CONF = "/etc/apache2/mods-available/nss.conf"
HTTPD_SSL_CONF = "/etc/apache2/mods-available/ssl.conf"
HTTPD_SSL_SITE_CONF = "/etc/apache2/sites-available/default-ssl.conf"
+1
View File
@@ -21,6 +21,7 @@ class SusePathNamespace(BasePathNamespace):
HTTPD_IPA_PKI_PROXY_CONF = "/etc/apache2/conf.d/ipa-pki-proxy.conf"
HTTPD_IPA_REWRITE_CONF = "/etc/apache2/conf.d/ipa-rewrite.conf"
HTTPD_IPA_CONF = "/etc/apache2/conf.d/ipa.conf"
HTTPD_IPA_WSGI_CONF = "/etc/apache2/conf.d/ipa-wsgi.conf"
HTTPD_NSS_CONF = "/etc/apache2/conf.d/nss.conf"
HTTPD_SSL_CONF = "/etc/apache2/conf.d/ssl.conf"
HTTPD_SSL_SITE_CONF = "/etc/apache2/conf.d/ssl.conf"
+15 -2
View File
@@ -209,6 +209,17 @@ class HTTPInstance(service.Service):
http_fd.close()
os.chmod(target_fname, 0o644)
target_fname = paths.HTTPD_IPA_WSGI_CONF
http_txt = ipautil.template_file(
os.path.join(paths.USR_SHARE_IPA_DIR,
"ipa-wsgi.conf.template"),
self.sub_dict)
self.fstore.backup_file(paths.HTTPD_IPA_CONF)
http_fd = open(target_fname, "w")
http_fd.write(http_txt)
http_fd.close()
os.chmod(target_fname, 0o644)
target_fname = paths.HTTPD_IPA_REWRITE_CONF
http_txt = ipautil.template_file(
os.path.join(paths.USR_SHARE_IPA_DIR,
@@ -539,8 +550,9 @@ class HTTPInstance(service.Service):
ca_iface.Set('org.fedorahosted.certmonger.ca',
'external-helper', helper)
for f in [paths.HTTPD_IPA_CONF, paths.HTTPD_SSL_CONF,
paths.HTTPD_SSL_SITE_CONF, paths.HTTPD_NSS_CONF]:
for f in [paths.HTTPD_IPA_CONF, paths.HTTPD_IPA_WSGI_CONF,
paths.HTTPD_SSL_CONF, paths.HTTPD_SSL_SITE_CONF,
paths.HTTPD_NSS_CONF]:
try:
self.fstore.restore_file(f)
except ValueError as error:
@@ -554,6 +566,7 @@ class HTTPInstance(service.Service):
paths.HTTPD_PASSWD_FILE_FMT.format(host=api.env.host),
paths.HTTPD_IPA_REWRITE_CONF,
paths.HTTPD_IPA_CONF,
paths.HTTPD_IPA_WSGI_CONF,
paths.HTTPD_IPA_PKI_PROXY_CONF,
paths.HTTPD_IPA_KDCPROXY_CONF_SYMLINK,
paths.HTTPD_IPA_KDCPROXY_CONF,
+1
View File
@@ -154,6 +154,7 @@ class Backup(admintool.AdminTool):
paths.HTTPD_CERT_FILE,
paths.HTTPD_KEY_FILE,
paths.HTTPD_IPA_CONF,
paths.HTTPD_WSGI_CONF,
paths.SSHD_CONFIG,
paths.SSHD_IPA_CONFIG,
paths.SSH_CONFIG,
+3
View File
@@ -1730,6 +1730,9 @@ def upgrade_configuration():
upgrade_file(sub_dict, paths.HTTPD_IPA_CONF,
os.path.join(paths.USR_SHARE_IPA_DIR,
"ipa.conf.template"))
upgrade_file(sub_dict, paths.HTTPD_IPA_WSGI_CONF,
os.path.join(paths.USR_SHARE_IPA_DIR,
"ipa-wsgi.conf.template"))
upgrade_file(sub_dict, paths.HTTPD_IPA_REWRITE_CONF,
os.path.join(paths.USR_SHARE_IPA_DIR,
"ipa-rewrite.conf.template"))
@@ -881,7 +881,7 @@ class TestInstallMaster(IntegrationTest):
"""
# check process count in httpd conf file i.e expected string
exp = b'WSGIDaemonProcess ipa processes=%d' % constants.WSGI_PROCESSES
httpd_conf = self.master.get_file_contents(paths.HTTPD_IPA_CONF)
httpd_conf = self.master.get_file_contents(paths.HTTPD_IPA_WSGI_CONF)
assert exp in httpd_conf
# check the process count