mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Remove mod_ssl conflict
Since mod_nss-1.0.8-24, mod_nss and mod_ssl can co-exist on one machine (of course, when listening to different ports). To make sure that mod_ssl is not configured to listen on 443 (default mod_ssl configuration), add a check to the installer checking of either mod_nss or mod_ssl was configured to listen on that port. https://fedorahosted.org/freeipa/ticket/3974
This commit is contained in:
parent
0880d030ae
commit
4bed0de60d
@ -121,7 +121,7 @@ Requires: mod_auth_kerb >= 5.4-16
|
|||||||
%else
|
%else
|
||||||
Requires: mod_auth_kerb >= 5.4-8
|
Requires: mod_auth_kerb >= 5.4-8
|
||||||
%endif
|
%endif
|
||||||
Requires: mod_nss
|
Requires: mod_nss >= 1.0.8-24
|
||||||
Requires: python-ldap
|
Requires: python-ldap
|
||||||
Requires: python-krbV
|
Requires: python-krbV
|
||||||
Requires: acl
|
Requires: acl
|
||||||
@ -166,10 +166,6 @@ Conflicts: bind < 9.8.2-0.4.rc2
|
|||||||
# member.
|
# member.
|
||||||
Conflicts: nss-pam-ldapd < 0.8.4
|
Conflicts: nss-pam-ldapd < 0.8.4
|
||||||
|
|
||||||
# mod_proxy provides a single API to communicate over SSL. If mod_ssl
|
|
||||||
# is even loaded into Apache then it grabs this interface.
|
|
||||||
Conflicts: mod_ssl
|
|
||||||
|
|
||||||
Obsoletes: ipa-server >= 1.0
|
Obsoletes: ipa-server >= 1.0
|
||||||
|
|
||||||
%description server
|
%description server
|
||||||
@ -836,6 +832,9 @@ fi
|
|||||||
%endif # ONLY_CLIENT
|
%endif # ONLY_CLIENT
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Aug 25 2013 Martin Kosek <mkosek@redhat.com> - 3.3.90-4
|
||||||
|
- Remove mod_ssl conflict, it can now live with mod_nss installed
|
||||||
|
|
||||||
* Wed Sep 4 2013 Ana Krivokapic <akrivoka@redhat.com> - 3.3.90-3
|
* Wed Sep 4 2013 Ana Krivokapic <akrivoka@redhat.com> - 3.3.90-3
|
||||||
- Conform to tmpfiles.d packaging guidelines
|
- Conform to tmpfiles.d packaging guidelines
|
||||||
|
|
||||||
|
@ -474,6 +474,10 @@ def main():
|
|||||||
if options.setup_dns:
|
if options.setup_dns:
|
||||||
check_bind()
|
check_bind()
|
||||||
|
|
||||||
|
# Check to see if httpd is already configured to listen on 443
|
||||||
|
if httpinstance.httpd_443_configured():
|
||||||
|
sys.exit("Aborting installation")
|
||||||
|
|
||||||
check_dirsrv()
|
check_dirsrv()
|
||||||
|
|
||||||
if options.conf_ntp:
|
if options.conf_ntp:
|
||||||
|
4
install/tools/ipa-server-install
Normal file → Executable file
4
install/tools/ipa-server-install
Normal file → Executable file
@ -791,6 +791,10 @@ def main():
|
|||||||
except ipaclient.ntpconf.NTPConfigurationError:
|
except ipaclient.ntpconf.NTPConfigurationError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# Check to see if httpd is already configured to listen on 443
|
||||||
|
if httpinstance.httpd_443_configured():
|
||||||
|
sys.exit("Aborting installation")
|
||||||
|
|
||||||
realm_name = ""
|
realm_name = ""
|
||||||
host_name = ""
|
host_name = ""
|
||||||
domain_name = ""
|
domain_name = ""
|
||||||
|
@ -1047,6 +1047,7 @@ def main():
|
|||||||
http.remove_httpd_ccache()
|
http.remove_httpd_ccache()
|
||||||
http.configure_selinux_for_httpd()
|
http.configure_selinux_for_httpd()
|
||||||
http.configure_httpd_ccache()
|
http.configure_httpd_ccache()
|
||||||
|
http.change_mod_nss_port_to_http()
|
||||||
|
|
||||||
ds = dsinstance.DsInstance()
|
ds = dsinstance.DsInstance()
|
||||||
ds.configure_dirsrv_ccache()
|
ds.configure_dirsrv_ccache()
|
||||||
|
@ -23,6 +23,7 @@ import tempfile
|
|||||||
import pwd
|
import pwd
|
||||||
import shutil
|
import shutil
|
||||||
import stat
|
import stat
|
||||||
|
import re
|
||||||
|
|
||||||
import service
|
import service
|
||||||
import certs
|
import certs
|
||||||
@ -32,6 +33,7 @@ from ipapython import ipautil
|
|||||||
from ipapython import services as ipaservices
|
from ipapython import services as ipaservices
|
||||||
from ipapython import dogtag
|
from ipapython import dogtag
|
||||||
from ipapython.ipa_log_manager import *
|
from ipapython.ipa_log_manager import *
|
||||||
|
from ipaserver.install import sysupgrade
|
||||||
from ipalib import api
|
from ipalib import api
|
||||||
|
|
||||||
HTTPD_DIR = "/etc/httpd"
|
HTTPD_DIR = "/etc/httpd"
|
||||||
@ -46,6 +48,31 @@ change with the command:
|
|||||||
Try updating the policycoreutils and selinux-policy packages.
|
Try updating the policycoreutils and selinux-policy packages.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
def httpd_443_configured():
|
||||||
|
"""
|
||||||
|
We now allow mod_ssl to be installed so don't automatically disable it.
|
||||||
|
However it can't share the same listen port as mod_nss, so check for that.
|
||||||
|
|
||||||
|
Returns True if something other than mod_nss is listening on 443.
|
||||||
|
False otherwise.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
(stdout, stderr, rc) = ipautil.run(['/usr/sbin/httpd', '-t', '-D', 'DUMP_VHOSTS'])
|
||||||
|
except ipautil.CalledProcessError, e:
|
||||||
|
service.print_msg("WARNING: cannot check if port 443 is already configured")
|
||||||
|
service.print_msg("httpd returned error when checking: %s" % e)
|
||||||
|
return False
|
||||||
|
|
||||||
|
port_line_re = re.compile(r'(?P<address>\S+):(?P<port>\d+)')
|
||||||
|
for line in stdout.splitlines():
|
||||||
|
m = port_line_re.match(line)
|
||||||
|
if m and int(m.group('port')) == 443:
|
||||||
|
service.print_msg("Apache is already configured with a listener on port 443:")
|
||||||
|
service.print_msg(line)
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
class WebGuiInstance(service.SimpleServiceInstance):
|
class WebGuiInstance(service.SimpleServiceInstance):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
service.SimpleServiceInstance.__init__(self, "ipa_webgui")
|
service.SimpleServiceInstance.__init__(self, "ipa_webgui")
|
||||||
@ -87,7 +114,6 @@ class HTTPInstance(service.Service):
|
|||||||
self.ldap_connect()
|
self.ldap_connect()
|
||||||
|
|
||||||
|
|
||||||
self.step("disabling mod_ssl in httpd", self.__disable_mod_ssl)
|
|
||||||
self.step("setting mod_nss port to 443", self.__set_mod_nss_port)
|
self.step("setting mod_nss port to 443", self.__set_mod_nss_port)
|
||||||
self.step("setting mod_nss password file", self.__set_mod_nss_passwordfile)
|
self.step("setting mod_nss password file", self.__set_mod_nss_passwordfile)
|
||||||
self.step("enabling mod_nss renegotiate", self.enable_mod_nss_renegotiate)
|
self.step("enabling mod_nss renegotiate", self.enable_mod_nss_renegotiate)
|
||||||
@ -227,15 +253,25 @@ class HTTPInstance(service.Service):
|
|||||||
http_fd.close()
|
http_fd.close()
|
||||||
os.chmod(target_fname, 0644)
|
os.chmod(target_fname, 0644)
|
||||||
|
|
||||||
def __disable_mod_ssl(self):
|
def change_mod_nss_port_to_http(self):
|
||||||
if os.path.exists(SSL_CONF):
|
# mod_ssl enforces SSLEngine on for vhost on 443 even though
|
||||||
self.fstore.backup_file(SSL_CONF)
|
# the listener is mod_nss. This then crashes the httpd as mod_nss
|
||||||
os.unlink(SSL_CONF)
|
# listened port obviously does not match mod_ssl requirements.
|
||||||
|
#
|
||||||
|
# Change port to http to workaround the mod_ssl check, the SSL is
|
||||||
|
# enforced in the vhost later, so it is benign.
|
||||||
|
#
|
||||||
|
# Remove when https://bugzilla.redhat.com/show_bug.cgi?id=1023168
|
||||||
|
# is fixed.
|
||||||
|
if not sysupgrade.get_upgrade_state('nss.conf', 'listen_port_updated'):
|
||||||
|
installutils.set_directive(NSS_CONF, 'Listen', '443 http', quotes=False)
|
||||||
|
sysupgrade.set_upgrade_state('nss.conf', 'listen_port_updated', True)
|
||||||
|
|
||||||
def __set_mod_nss_port(self):
|
def __set_mod_nss_port(self):
|
||||||
self.fstore.backup_file(NSS_CONF)
|
self.fstore.backup_file(NSS_CONF)
|
||||||
if installutils.update_file(NSS_CONF, '8443', '443') != 0:
|
if installutils.update_file(NSS_CONF, '8443', '443') != 0:
|
||||||
print "Updating port in %s failed." % NSS_CONF
|
print "Updating port in %s failed." % NSS_CONF
|
||||||
|
self.change_mod_nss_port_to_http()
|
||||||
|
|
||||||
def __set_mod_nss_nickname(self, nickname):
|
def __set_mod_nss_nickname(self, nickname):
|
||||||
installutils.set_directive(NSS_CONF, 'NSSNickname', nickname)
|
installutils.set_directive(NSS_CONF, 'NSSNickname', nickname)
|
||||||
|
Loading…
Reference in New Issue
Block a user