Bug 1413136

Summary: Problem with default AJP hostname in IPv6 environment.
Product: Red Hat Enterprise Linux 7 Reporter: Endi Sukma Dewata <edewata>
Component: pki-coreAssignee: RHCS Maintainers <rhcs-maint>
Status: CLOSED ERRATA QA Contact: Asha Akkiangady <aakkiang>
Severity: urgent Docs Contact: Petr Bokoc <pbokoc>
Priority: urgent    
Version: 7.3CC: gparente, mharmsen, msauton, pbokoc, ssidhaye, tscherf
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pki-core-10.4.0-1.el7 Doc Type: Bug Fix
Doc Text:
*Tomcat* now works with *IPv6* by default The *IPv4*-specific `127.0.0.1` loopback address was previously used in the default server configuration file as the default *AJP* host name. This caused connections to fail on servers which run in *IPv6*-only environments. With this update, the default value is changed to `localhost`, which works with both *IPv4* and *IPv6* protocols. Additionally, an upgrade script is available to automatically change the *AJP* host name on existing server instances.
Story Points: ---
Clone Of:
: 1417190 (view as bug list) Environment:
Last Closed: 2017-08-01 22:50:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1398600, 1417190    

Description Endi Sukma Dewata 2017-01-13 17:35:10 UTC
This bug is cloned from https://fedorahosted.org/pki/ticket/2570.

Currently the IPv4-specific "127.0.0.1" loopback address is used as the default AJP hostname in the default deployment configuration file which may cause problems in IPv6 environment. See the following issues:

* ​https://bugzilla.redhat.com/show_bug.cgi?id=1081561
* ​https://bugzilla.redhat.com/show_bug.cgi?id=1398600 

The default AJP hostname should be changed to use a generic "localhost" address which should work in both IPv4 and IPv6 environments. The man page should be updated as well.

Steps to reproduce:
1. Install basic CA. Do not install IPA to validate this bug since it overrides the default AJP hostname.
2. Check the following entry in server.xml:

 <Connector port="8009"
     protocol="AJP/1.3"
     redirectPort="8443"
     address="..." />

Actual result: The address attribute contains "127.0.0.1" which may not work in IPv6 environment.

Expected result: The address attribute should contain "localhost" which will work in both IPv4 and IPv6 environments.

The workaround is to override the default AJP hostname in the deployment configuration as follows:

[Tomcat]
pki_ajp_host=localhost

Comment 2 Endi Sukma Dewata 2017-01-19 19:43:10 UTC
Fixed in master:
* 5ec9701229b4945cadcf60d84863521ad8485ca5

Comment 3 Endi Sukma Dewata 2017-01-20 14:07:54 UTC
Added upgrade script:
* cb839206d6c1d562e2e4385f6822c7934e9455c6

Backported to 10.3 branch:
* 3a49b9b3738befc03914b0a96aad61f9650fb935
* 6b8c54d29cfc4f448566f50cb27a40eda07052ca

Comment 4 Endi Sukma Dewata 2017-01-20 14:17:45 UTC
The fix should be backported to RHEL 7.3 to address IPA bug #1398600.

Please note that when backporting to RHEL the upgrade script needs to be moved to the upgrade folder matching the RHEL version number (i.e. 10.3.3) and the sequence number in the script file name needs to be updated as well.

Comment 7 Sumedh Sidhaye 2017-05-05 08:31:36 UTC
Build used to verify fix:

[root@pki1 ~]# pki --version
PKI Command-Line Interface 10.4.1-3.el7
[root@pki1 ~]# rpm -qi pki-base
Name        : pki-base
Version     : 10.4.1
Release     : 3.el7
Architecture: noarch
Install Date: Friday 05 May 2017 01:31:47 AM EDT
Group       : System Environment/Base
Size        : 2086078
License     : GPLv2
Signature   : RSA/SHA256, Tuesday 02 May 2017 04:38:09 PM EDT, Key ID 199e2f91fd431d51
Source RPM  : pki-core-10.4.1-3.el7.src.rpm
Build Date  : Tuesday 02 May 2017 03:15:26 PM EDT
Build Host  : ppc-015.build.eng.bos.redhat.com
Relocations : (not relocatable)
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Vendor      : Red Hat, Inc.
URL         : http://pki.fedoraproject.org/
Summary     : Certificate System - PKI Framework

Result:

After configuring a pure IPV6 environment and installing a CA instance on it,
the address attribute contains localhost.

Comment 8 errata-xmlrpc 2017-08-01 22:50:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2110