1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-07 04:02:58 +03:00

474 Commits

Author SHA1 Message Date
Mladen Turk
e7479bf114 Add status param option so that current worker
status can be changed via editing httpd.conf instead
just using web page. Seems the ApacheCon is paying of.
Thanks to Sander for pointing that out.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@225751 13f79535-47bb-0310-9956-ffa450edef68
2005-07-28 11:16:34 +00:00
Ian Holsman
9ffe8c5d1a This patch adds a new hook (request_status) that gets ran in proxy_handler
just before the final return.  This gives modules an opportunity to do
something based on the proxy status.

A couple of examples where this is useful:

-You are using a caching module and would rather return stale content rather
than an error to the client if the origin is down.

-you proxy some subrequests (using SSI - mod_include) and do not want SSI
errors when the backend is down. If you would normally return
HTTP_BAD_GATEWAY, you may have a module that serves some other content.


new hook -- so mmn bump.. i made it a major one, hope thats ok 

Patch From Brian Akins <Brian.Akins turner.com>




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@219372 13f79535-47bb-0310-9956-ffa450edef68
2005-07-17 05:12:10 +00:00
William A. Rowe Jr
d2ff850241 End abuse of apr_strnat[case]cmp - it isn't str[case]cmp.
Unsure if apr_strnatcasecmp(conf_ip, uri_ip) was intentional, on the
  off chance that the left or right hand ip string happens to contain
  leading zeros.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@216111 13f79535-47bb-0310-9956-ffa450edef68
2005-07-13 04:43:59 +00:00
William A. Rowe Jr
179ca062fd This test for TraceEnable cases cannot be buried within the max-forwards
logic cases.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@209406 13f79535-47bb-0310-9956-ffa450edef68
2005-07-06 04:10:50 +00:00
William A. Rowe Jr
d90cbe8650 Plug AllowTrace extended|on|off into proxy and http core.
It still is not 'correct' until REQUEST_CHUNKED_PASS is reimplemented
  and passes some chunk headers, since we aren't echoing the entire
  request.  But it gets me further on testing 1.3 -> 2.0 -> 2.1 -> 2.0 -> 1.3
  proxy behaviors.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@208787 13f79535-47bb-0310-9956-ffa450edef68
2005-07-01 19:59:59 +00:00
Paul Querna
c84966321a Make sure mod_rewrite always runs before mod_proxy in the translate_name hook. This makes doing RewriteRules on a Reverse Proxy.. Slightly more predictable than the order of LoadModules.
Reported By: David D. Miller <justdave bugzilla.org>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@169692 13f79535-47bb-0310-9956-ffa450edef68
2005-05-11 20:11:44 +00:00
Mladen Turk
9fac5c4376 Add failover to mod proxy. If the service is unavailable,
check another worker in case this is balancer request.
In case the error in unrecoverable, fail with returned
status code.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@160848 13f79535-47bb-0310-9956-ffa450edef68
2005-04-11 08:45:15 +00:00
Mladen Turk
363117e7a1 Move direct_connect out of attempt loop. No need to
calculate that value on each attempt, because it's always
the same.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@160705 13f79535-47bb-0310-9956-ffa450edef68
2005-04-09 18:33:00 +00:00
Mladen Turk
0eab042f6a Use two optional functions from mod_ssl so that we
can receive both is_ssl and ssl_var for ajp protocol.
This is combined work based on patch from Brad Boyer and
Joe Orton's suggestion to use ssl_var_lookup.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@160690 13f79535-47bb-0310-9956-ffa450edef68
2005-04-09 16:16:54 +00:00
Joe Orton
a0570c8746 Move the POSIX reg* implementations into the ap_* namespace;
internalise the ap_reg*<->PCRE wrapper:

* configure.in: Add srclib/pcre to the include path.

* include/ap_regex.h: Renamed from include/pcreposix.h.  Prefix all
constants with AP_; prefix all functions and types with ap_.  Define
AP_DECLARE to nothing if necessary.  Remove regcomp error codes.

* include/httpd.h: Include ap_regex.h not pcreposix.h.
(ap_pregcomp, ap_regexec, ap_regfree): s/regex_t/ap_regex_t/.
(ap_regexec, ap_regerror): Prototypes moved to ap_regex.h.

* server/util.c (regex_cleanup, ap_pregcomp, ap_pregsub, ap_pregfree):
Adjust for ap_ prefixed types.  (ap_regexec, ap_regerror): Removed.

* server/Makefile.in: Build util_pcre.c.

* server/util_pcre.c: Copied from srclib/pcre/pcreposix.c; remove use
of PCRE-internals to do error mapping; rename types to add AP_/ap_
prefixes as above.  Use APR includes.  (ap_regerror): Use apr_snprintf.

* srclib/pcre/Makefile.in: Don't build pcreposix.c into libpcre.la.

* modules/*: Update to use new type and constant names.

PR: 27750 (part one)
Submitted by: Andres Salomon <dilinger voxel.net>, Joe Orton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@153384 13f79535-47bb-0310-9956-ffa450edef68
2005-02-11 12:00:41 +00:00
Justin Erenkrantz
905cdf9f0b Update copyright year to 2005 and standardize on current copyright owner line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 20:28:49 +00:00
Justin Erenkrantz
632ec345e9 mod_proxy: Fix ProxyRemoteMatch directive.
PR: 33170
Submitted by: Rici Lake <rici ricilake.net>
Reviewed by:  Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151248 13f79535-47bb-0310-9956-ffa450edef68
2005-02-03 23:18:48 +00:00
Sander Striker
4162b98a0f Clean up some crumbs... The sandwich is next.
* modules\proxy\mod_proxy.c

  (alias_match): Removed unused variables.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151241 13f79535-47bb-0310-9956-ffa450edef68
2005-02-03 22:05:06 +00:00
Jim Jagielski
745572221a Remove old FIX_15207 snippets
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151212 13f79535-47bb-0310-9956-ffa450edef68
2005-02-03 19:25:38 +00:00
Jim Jagielski
9935c31bdd Close PR 32459, 15207. API change for PROXY_DECLARE ap_proxy_canonenc()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151153 13f79535-47bb-0310-9956-ffa450edef68
2005-02-03 13:38:24 +00:00
Mladen Turk
e6664a0bb2 Fix #32367 support for ProxyPass /foo !
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@149420 13f79535-47bb-0310-9956-ffa450edef68
2005-02-01 17:17:40 +00:00
Jim Jagielski
fe2650384d Add in a weighted byte count of all traffic (in and out) as
an alternative balancing method. We do not "adjust" the
byte count wrt scheme or method, simply by factoring
in the lbfactor value.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@126304 13f79535-47bb-0310-9956-ffa450edef68
2005-01-24 18:28:16 +00:00
William A. Rowe Jr
d962fcfc8b FINALLY Correct ap_http_method()! It is NOT a method, it's a SCHEME!
Bumped mmn, and ap module cookie, for this function rename.

  It's not a deprecation, as ap_http_method would be a lovely function
  name sometime in the future: to determine what the function name implies.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@123882 13f79535-47bb-0310-9956-ffa450edef68
2005-01-02 05:33:44 +00:00
Jim Jagielski
79419db65a simplify the BalancerMember load factor weighting. Instead of
being percentages (and adjusting when the number don't add
up), loadfactors/lbfactors are now normalized values, so
values like:

   worker    a   b   c
   lbfactor  1   1   2

work as expected (ie: a gets 25%, b gets 25% and c gets 50%).
So we could also have the above as:

   worker    a   b   c
   lbfactor 25  25  50

or even

   worker    a   b   c
   lbfactor 15  15  30



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@122551 13f79535-47bb-0310-9956-ffa450edef68
2004-12-16 14:09:30 +00:00
Cliff Woolley
a89bce3fd9 "transfered" is not a word.
s/transfered/transferred/g;



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111858 13f79535-47bb-0310-9956-ffa450edef68
2004-12-14 18:58:25 +00:00
Jim Jagielski
0fb2f37f3e grammatical parameter change... "readed" -> "read"
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111830 13f79535-47bb-0310-9956-ffa450edef68
2004-12-14 16:08:55 +00:00
Mladen Turk
939710c063 Make proxy address cache thread safe and available only
to pooled workers.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111827 13f79535-47bb-0310-9956-ffa450edef68
2004-12-14 15:45:19 +00:00
Mladen Turk
4dda290fd1 Add generic reverse proxy worker so that module-driven reverse proxying works. It is enabled by default, but IMO it should be configurable like any other worker so we can limit the number of outgoing connections.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@109316 13f79535-47bb-0310-9956-ffa450edef68
2004-12-01 08:44:11 +00:00
Mladen Turk
f648ac6494 Merge the proxy_status too. Thanks to Christian von Rouques for the patch.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105457 13f79535-47bb-0310-9956-ffa450edef68
2004-10-14 16:00:41 +00:00
Mladen Turk
084ca3d9eb Use apr_strftime instead our own format_byte_out function.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105346 13f79535-47bb-0310-9956-ffa450edef68
2004-09-29 19:07:47 +00:00
Mladen Turk
258273c945 Make sure that we don't increase balancer worker count on
gracefull restart. Thanks to Christian...again.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105318 13f79535-47bb-0310-9956-ffa450edef68
2004-09-28 16:35:29 +00:00
Mladen Turk
349fbd8eb1 Initialize workers for every virtual server not just for default one.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105298 13f79535-47bb-0310-9956-ffa450edef68
2004-09-26 18:17:38 +00:00
Mladen Turk
8a2d25e4fa Remove proxy_runtime_worker and make the things simpler by
sharing runtime status accross child processes. Also make sure
that shared data is initialized after the scoreboard is created.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105293 13f79535-47bb-0310-9956-ffa450edef68
2004-09-26 06:54:27 +00:00
Mladen Turk
c2f0914c75 Display worker status under server-status
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105172 13f79535-47bb-0310-9956-ffa450edef68
2004-09-16 14:02:16 +00:00
Mladen Turk
6799ab5774 Add maximum nuber of attempts for failover and run scheme handler
if worker is in error state up to that number.
Another great idea from Christian von Roques.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105171 13f79535-47bb-0310-9956-ffa450edef68
2004-09-16 12:08:00 +00:00
Mladen Turk
ff2207a250 Register output function so that core can retrieve it and set
scoreboard accordingly


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105132 13f79535-47bb-0310-9956-ffa450edef68
2004-09-15 11:57:02 +00:00
Mladen Turk
3e6833da34 Add more comments to the code -- No functional change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105077 13f79535-47bb-0310-9956-ffa450edef68
2004-09-11 17:14:49 +00:00
Mladen Turk
dd00fb7d89 Do not add forward proxy to other proxies. Use new function to
create the worker that isn't by default added to the list of other workers.
This enalbles mixing forward and reverse proxy functionality on the same box.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105070 13f79535-47bb-0310-9956-ffa450edef68
2004-09-11 09:31:10 +00:00
Mladen Turk
a64681b5cf Initialize the forward proxy worker too.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105065 13f79535-47bb-0310-9956-ffa450edef68
2004-09-10 18:47:55 +00:00
Mladen Turk
225dd230c4 Just like for balancers initialize the workers on post_config
instead on first request to skip the race condition.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105064 13f79535-47bb-0310-9956-ffa450edef68
2004-09-10 18:29:16 +00:00
Mladen Turk
44d1474f1e Add PROXY_WORKER_IGNORE_ERRORS flags that
disables puting the entire worker in retry mode, cause
for forward workers the remote is not fixed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105047 13f79535-47bb-0310-9956-ffa450edef68
2004-09-09 13:15:40 +00:00
Mladen Turk
c355a4dc78 Add 'default' foward proxy worker to the proxy_server_conf.
Forward worker is constructed on ProxyRequests directive
with sceme and host equals '*', meaning all.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105044 13f79535-47bb-0310-9956-ffa450edef68
2004-09-09 10:24:27 +00:00
André Malo
7fe1e763e8 remove unused variables and fix some compiler warnings about const
qualifiers


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104838 13f79535-47bb-0310-9956-ffa450edef68
2004-08-26 21:10:01 +00:00
Mladen Turk
a224ba752c Add pool used for allocating proxy_server_conf to that struct.
It will be used for dynamic configuration, to ensure that dynamic
params has the same lifetime as the config has.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104811 13f79535-47bb-0310-9956-ffa450edef68
2004-08-26 06:49:22 +00:00
Mladen Turk
40bc85dc55 Untabify the code. Have no idea who put all those tabs in sources.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104795 13f79535-47bb-0310-9956-ffa450edef68
2004-08-25 09:19:43 +00:00
Mladen Turk
c6e48bbe65 Added ProxySet directive (can be rename to something else).
The purpose is to be able to set the worker/balancer params
withouth the need for very long config lines :
<Proxy balancer://cluster>
  ProxySet stickysession=JSESSIONID
</Proxy>
Or...
ProxySet balancer://cluser nofaiover=On timeout=2


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104794 13f79535-47bb-0310-9956-ffa450edef68
2004-08-25 09:13:09 +00:00
Mladen Turk
89bbf038a4 Remove BalancerStickySession directive.
This directive was leftover from the initial implementation.
The stickysession is set using 'name=val' like any other option.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104793 13f79535-47bb-0310-9956-ffa450edef68
2004-08-25 08:00:27 +00:00
Justin Erenkrantz
a32e605179 Clean up some bogus error messages.
(I'll note that the code style in this file borders on unreadable.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104784 13f79535-47bb-0310-9956-ffa450edef68
2004-08-24 08:55:45 +00:00
Jean-Frederic Clere
ba8ab9bed4 Prevent / beeing accepted wrongly by the proxy when having for example:
<Location /examples/>
   ProxyPass ajp://localhost:8009/examples/
</Location>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104714 13f79535-47bb-0310-9956-ffa450edef68
2004-08-18 16:46:12 +00:00
Jeff Trawick
26f21a9cbf fix format string mismatch (int vs. apr_time_t)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104643 13f79535-47bb-0310-9956-ffa450edef68
2004-08-13 12:09:13 +00:00
William A. Rowe Jr
84fd685bce Small status displaying fix.
Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104629 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 23:31:40 +00:00
William A. Rowe Jr
c42bcbc7ba Added proxy status for conf, and elected member to runtime worker
Added mod_status extension for displaying runtime
status informations for load balancer.

Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104627 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 23:30:17 +00:00
William A. Rowe Jr
c84854f270 Make sure that if the pre_request was called that the post_request
gets called too, no mather what the error code is.

Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104620 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 23:07:16 +00:00
William A. Rowe Jr
08e97ab50f Use the pool for add_worker call.
Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104616 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 23:01:39 +00:00
William A. Rowe Jr
8ca5c23d99 Add pool to functions for setting worker and balancer parameters.
Still have no idea why that doesn't work without duping as JeanFrederic reported.

Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104615 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 23:00:07 +00:00