Bug 1029491

Summary: Attribute resolve-host of access log has no effect
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Jan Blizňák <jbliznak>
Component: WebAssignee: Rémy Maucherat <rmaucher>
Status: CLOSED CURRENTRELEASE QA Contact: Michael Cada <mcada>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: pslavice
Target Milestone: DR1   
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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: 1138672    
Bug Blocks:    

Description Jan Blizňák 2013-11-12 13:28:45 UTC
Description of problem:
When enabling host resolution for access log there is no change at log records, so it seems that this setting is not effective at all.


Version-Release number of selected component (if applicable):
EAP 6.2.0.ER7, JBoss Web 7.2.2.Final-redhat-1, JBoss Application Server: Web Subsystem 7.3.0.Final-redhat-SNAPSHOT

How reproducible:
always

Steps to Reproduce:
0. default instalation of EAP with default config started as standalone
1. Enable access log with resolving disabled: /subsystem=web/virtual-server=default-host/access-log=configuration:add(resolve-hosts=false)
2. perform several web accesses at localhost:8080 or if you can, do external access to your public IP
3. check log at <eap-dir>/standalone/log/default-host and see that IP is in first field of each record.
4. Enable resolving: /subsystem=web/virtual-server=default-host/access-log=configuration:write-attribute(name=resolve-hosts,value=false)
5. again perform several web accesses the same way as in step 2)
6. check log again and check if hostname is in first field of each new record.


Actual results:
Resolving hostnames is not seem to work, there are only IPs in log.

Expected results:
Resolving hostnames works.


Additional info:
Since JBoss Web has very poor docs and is based on Tomcat, I found at
http://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/valves/AccessLogValve.html where it says "Remote host name (or IP address if enableLookups for the connector is false)" for request hostname.
So I try to turn it on /subsystem=web/connector=http:write-attribute(name=enable-lookups,value=true)
and it starts to resolving hosts no matter what the value of resolve-host attribute is.

Comment 1 Radim Hatlapatka 2013-11-12 17:18:51 UTC
If I look to JBoss Web documentation (version used in EAP 6.2) [1], I see, that information regarding resolveHosts are the same as for Tomcat 6.0 => should still work and is not marked deprecated as is in Tomcat 7.

[1]
http://anonsvn.jboss.org/repos/jbossweb/branches/7.2.x/webapps/docs/config/valve.xml

Comment 2 Martin Velas 2014-08-04 12:08:18 UTC
Issue is still valid for the EAP 6.3.0.ER10 bits.

Comment 3 Rémy Maucherat 2014-09-04 13:09:36 UTC
The pattern uses something different for the address and the host, so the setting is obviously useless. Now since it is there, I'll use it as an additional override ... Indeed resolving hosts will also need resolveHosts on the connector. r2501 in web.

Note that it is likely a bad idea to actually enable host resolution on a real server.

Comment 4 Kabir Khan 2014-09-08 11:54:18 UTC
Fixed by component upgrade to JBoss Web 7.5.0.Beta1: https://bugzilla.redhat.com/show_bug.cgi?id=1138672

Comment 5 Radim Hatlapatka 2014-09-23 13:41:52 UTC
Verified in EAP 6.4.0.DR1.1