You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2011/11/18 09:16:47 UTC

DO NOT REPLY [Bug 52207] New: Upgrade apache version from 2.0.59 to 2.2.12 or above result URL redirection error

https://issues.apache.org/bugzilla/show_bug.cgi?id=52207

             Bug #: 52207
           Summary: Upgrade apache version from 2.0.59 to 2.2.12 or above
                    result URL redirection error
           Product: Apache httpd-2
           Version: 2.2.21
          Platform: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: mod_alias
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: yonyang@cisco.com
    Classification: Unclassified


URL: http://aaa.bbb.com under Load Balance, apache is running both 80 and 1701
ports.
We have the redirect rule: RedirectMatch ^/[\/]?$ /redirect/redirect? and we
expect to get: http://aaa.bbb.com/redirect/redirect?
However it actually gives back: http://aaa.bbb.com:1701/redirect/redirect?
1701 is the real server port and it should not show up here.

After workaround in different apache version, we found the issue can be
replicated in 2.2.12 and above versions. We also found the issue is in
modules/mapper/mod_alias.c and we located at the following codes:
            if (ret[0] == '/') {

                ret = ap_construct_url(r->pool, ret, r);
                ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                              "incomplete redirection target of '%s' for "
                              "URI '%s' modified to '%s'",
                              orig_target, r->uri, ret);
            }

If we remove this code and recompile apache, apache 2.2.12 or above versions
will work in our environment.
I don't know why others do not report the issue, but we are using Cisco ACE as
a load balancer, and we know current version 2.0.59 works well. 

Here is the list we tested:

Works                   2.0.59 (in use) 
Works                   2.0.64 
Works                   2.2.3
Works                   2.2.11
Issue                     2.2.12 (need mod_alias.c update, verified)
Issue                     2.2.13 (need mod_alias.c update)
Issue                     2.2.15 (need mod_alias.c update)
Issue                     2.2.19 (need mod_alias.c update)
Issue                     2.2.21 (need mod_alias.c update, verified)
Issue                     2.3.15 (need mod_alias.c update)

Please help on this special case and we want to know:
1.) what the exactly reason we have these pieces of code? what use case?
2.) is it an apache redirection issue or ACE has issue in forwarding?
3.) if it is actually a bug, can we fix it in next release?

Thanks a lot!

--Vincent

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52207] Upgrade apache version from 2.0.59 to 2.2.12 or above result URL redirection error

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52207

--- Comment #10 from Vincent Yang <yo...@cisco.com> 2011-11-19 04:57:26 UTC ---
Actually we don't want to use ServerName override the port defined in vhost.

We have 20 ports listening on apache from 1701 - 1720.
We use different VIPs configured in load balance to point different apache
ports.
These different VIPs are for different customers.

As I am not a system architecture of our service, I may not exactly present the
whole architecture level, but here is an example:

cust.corp.com 
    -CNAME- {LoadBalance 64.xx.xx.8} 
    -LB- {VIP- 64.xx.xx.34:80, 64.xx.xx.34:443} 
    -LB-WS- {Apache- 64.xx.xx.181:1701, 64.xx.xx.181:1702} 
    -vhost- {Tomcat- 64.xx.xx.185:2001, 64.xx.xx.185:2003}

Thanks,

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52207] Upgrade apache version from 2.0.59 to 2.2.12 or above result URL redirection error

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52207

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEEDINFO
     Ever Confirmed|0                           |1

--- Comment #9 from Eric Covener <co...@gmail.com> 2011-11-19 03:51:21 UTC ---
If you want the port in the ServerName to override the port in the host header,
set UseCanonicalName to On.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52207] Upgrade apache version from 2.0.59 to 2.2.12 or above result URL redirection error

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52207

Vincent Yang <yo...@cisco.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |
     Ever Confirmed|1                           |0

--- Comment #2 from Vincent Yang <yo...@cisco.com> 2011-11-18 23:38:26 UTC ---
Hi

CHANGES only show:
  *) mod_alias: check sanity in Redirect arguments.
     PR 44729 [Sönke Tesch <st kino-fahrplan.de>, Jim Jagielski]
https://issues.apache.org/bugzilla/show_bug.cgi?id=44729

  *) mod_alias: Ensure Redirect emits HTTP-compliant URLs.
     PR 44020
https://issues.apache.org/bugzilla/show_bug.cgi?id=44020 

However this does not help us, we don't know why a normal vip:80/443 to
realip:1701 and also a normal redirectmatch "RedirectMatch ^/[\/]?$
/dispatcher/dispatcher.do?" can cause problem after version 2.2.12

To make the issue more clear, I attached a document to present the logic flow
and our issue "fix" by comment out one of the function in the source code of
mod_alias.c

Thanks
Vincent

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52207] Upgrade apache version from 2.0.59 to 2.2.12 or above result URL redirection error

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52207

--- Comment #3 from Vincent Yang <yo...@cisco.com> 2011-11-18 23:39:10 UTC ---
Created attachment 27971
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27971
Logic flow

The logic flow document and the issue fix.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52207] Upgrade apache version from 2.0.59 to 2.2.12 or above result URL redirection error

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52207

--- Comment #12 from Vincent Yang <yo...@cisco.com> 2011-11-19 05:27:33 UTC ---
Thanks all for your posts.
After setting the ServerName and enable UseCanonicalName.
ServerName webserver.corp.com:80
UseCanonicalName On

the url will have this redirection:
http://cust.corp.com --> http://websvr.corp.com:1701/dispatcher/dispatcher.do?

this is not what we want, we don't want to present the actual websvr ip or
domain name in the url as it should be hidden inside of load balance. I mean we
want this kind of redirection:
http://cust.corp.com --> http://cust.corp.com/dispatcher/dispatcher.do?
and this is exactly what version before 2.2.12 does and works.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52207] Upgrade apache version from 2.0.59 to 2.2.12 or above result URL redirection error

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52207

Nick Kew <ni...@webthing.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID
         OS/Version|                            |All

--- Comment #1 from Nick Kew <ni...@webthing.com> 2011-11-18 09:14:28 UTC ---
Since you've discovered which version changed, you can look in CHANGES to see
exactly what changed.  In this case it's a bug fix, from earlier behaviour that
was in violation of HTTP.

You appear to have a configuration problem, possibly concerning your canonical
hostname.  If you have trouble fixing it, the users list (and other support
channels) are there to help.  A bug report might arise out of that process, but
this isn't it.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52207] Upgrade apache version from 2.0.59 to 2.2.12 or above result URL redirection error

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52207

--- Comment #5 from William A. Rowe Jr. <wr...@apache.org> 2011-11-19 01:47:33 UTC ---
Also, what is the ServerName of the host?  That is its canonical name.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52207] Upgrade apache version from 2.0.59 to 2.2.12 or above result URL redirection error

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52207

William A. Rowe Jr. <wr...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|                            |INVALID

--- Comment #7 from William A. Rowe Jr. <wr...@apache.org> 2011-11-19 02:52:38 UTC ---
"ServerName is comment out."

Well, duh.

Next time pay attention when a bug is closed on you as INVALID and follow
the advise they offer.  C.f. Nick's gracious reply in comment #2.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52207] Upgrade apache version from 2.0.59 to 2.2.12 or above result URL redirection error

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52207

--- Comment #11 from William A. Rowe Jr. <wr...@apache.org> 2011-11-19 05:23:22 UTC ---
If you set ServerName web-apache.corp.com:80, and had not set CanonicalName
off,
and the redirect resulted in http://web-apache.corp.com:1701/redirect/redirect
then this is indeed a bug.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52207] Upgrade apache version from 2.0.59 to 2.2.12 or above result URL redirection error

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52207

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEEDINFO
     Ever Confirmed|0                           |1

--- Comment #4 from Eric Covener <co...@gmail.com> 2011-11-19 00:23:56 UTC ---
What's the value of usecanonicalphysicalport?

What does the vhost serving this request look like?

What's the host header on the request (log %{host}i)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52207] Upgrade apache version from 2.0.59 to 2.2.12 or above result URL redirection error

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52207

--- Comment #13 from William A. Rowe Jr. <wr...@apache.org> 2011-11-19 20:15:38 UTC ---
Stupid question, but if you move the statement
  ServerName webserver.corp.com:80
into your <VirtualHost > block (as all documentation and tutorials insist
that you)... does this correct the behavior?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52207] Upgrade apache version from 2.0.59 to 2.2.12 or above result URL redirection error

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52207

--- Comment #6 from Vincent Yang <yo...@cisco.com> 2011-11-19 02:30:51 UTC ---
Here is the vHost information:
NameVirtualHost *:1701
<VirtualHost *:1701>
 WebLogicHost [tomcat-ip]
 WebLogicPort 80
 ConnectTimeoutSecs 10
 ConnectRetrySecs 5
 #FileCaching OFF 
 MatchExpression *.do
 MatchExpression *.jsp
 MatchExpression *.php
 MatchExpression *.asp
 MatchExpression *.wbx
 MatchExpression *Servlet*
 MatchExpression *Servlet/*
 MatchExpression sendmail
 MatchExpression TestService
 ErrorLog "|/usr/sbin/rotatelogs /var/httplogs/errorlog_xxx_port1701 86400"
 CustomLog "|/usr/sbin/rotatelogs /var/httplogs/accesslog_xxx_port1701 86400"
combined
 Include /www/conf/rewrite.httpd
</VirtualHost>


Here is the ServerName and part of httpd.conf configuration:
ServerName is comment out.

#ServerName new.host.name:80
ServerRoot "/etc/httpd"
DocumentRoot "/www/htdocs"
Listen 80
Listen 1701
User apache
Group apache

ServerAdmin root@localhost

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 52207] Upgrade apache version from 2.0.59 to 2.2.12 or above result URL redirection error

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52207

Vincent Yang <yo...@cisco.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |
     Ever Confirmed|1                           |0

--- Comment #8 from Vincent Yang <yo...@cisco.com> 2011-11-19 03:17:27 UTC ---
We added ServerName and it does not have any affect on the issue.
ServerName web-apache.corp.com:80 and tried ServerName web-apache's ip

The weird thing is it works in prior to 2.2.12 version, we tested it on 2.2.11,
2.2.3, 2.0.64 and 2.0.59 and all works with same configuration file.

Thanks.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org