1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-13 21:42:17 +03:00
Commit Graph

120 Commits

Author SHA1 Message Date
Eric Covener
f889cb92be name-based vhosts listed twice with apachectl -S
When processing a vhost with * or _default_, we'd add the "names" once
for 0.0.0.0 and once for [::], but these are stored in the same "default"
ip chain.  Catch the back-to-back wildcard + same port and short-circuit the
second add.

Submitted By: rjung
Committed By: covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1525000 13f79535-47bb-0310-9956-ffa450edef68
2013-09-20 13:36:33 +00:00
Eric Covener
75d64cebb7 PR54948: wildcard name-based vhosts printed twice in apachectl -S
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1481306 13f79535-47bb-0310-9956-ffa450edef68
2013-05-11 12:05:24 +00:00
Ruediger Pluem
3bd54f88b5 * Ensure that is_v6literal is always initialized
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1436457 13f79535-47bb-0310-9956-ffa450edef68
2013-01-21 16:23:43 +00:00
Stefan Fritsch
4b5fd517b2 remove comment; empty host headers can happen in proxy requests
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1426988 13f79535-47bb-0310-9956-ffa450edef68
2012-12-30 20:58:39 +00:00
Stefan Fritsch
8283707a4f add log tags missing in r1426877
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1426879 13f79535-47bb-0310-9956-ffa450edef68
2012-12-30 01:28:17 +00:00
Stefan Fritsch
f726113d33 Add an option to enforce stricter HTTP conformance
This is a first stab, the checks will likely have to be revised.
For now, we check

 * if the request line contains control characters
 * if the request uri has fragment or username/password
 * that the request method is standard or registered with RegisterHttpMethod
 * that the request protocol is of the form HTTP/[1-9]+.[0-9]+,
   or missing for 0.9
 * if there is garbage in the request line after the protocol
 * if any request header contains control characters
 * if any request header has an empty name
 * for the host name in the URL or Host header:
   - if an IPv4 dotted decimal address: Reject octal or hex values, require
     exactly four parts
   - if a DNS host name: Reject non-alphanumeric characters besides '.' and
     '-'. As a side effect, this rejects multiple Host headers.
 * if any response header contains control characters
 * if any response header has an empty name
 * that the Location response header (if present) has a valid scheme and is
   absolute

If we have a host name both from the URL and the Host header, we replace the
Host header with the value from the URL to enforce RFC conformance.

There is a log-only mode, but the loglevels of the logged messages need some
thought/work. Currently, the  checks for incoming data log for 'core' and the
checks for outgoing data log for 'http'. Maybe we need a way to configure the
loglevels separately from the core/http loglevels.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1426877 13f79535-47bb-0310-9956-ffa450edef68
2012-12-30 01:23:24 +00:00
Stefan Fritsch
33a2fbf2bc Correctly parse an IPv6 literal host specification in an absolute URL
in the request line.

- Fix handling of brackets [ ] surrounding the IPv6 address.
- Skip parsing r->hostname again if not necessary.
- Do some checks that the IPv6 address is sane. This is not done by
  apr_parse_addr_port().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1426827 13f79535-47bb-0310-9956-ffa450edef68
2012-12-29 20:39:49 +00:00
Stefan Fritsch
a686e267b5 log client error at level debug, log broken Host header value
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1407006 13f79535-47bb-0310-9956-ffa450edef68
2012-11-08 10:44:49 +00:00
Stefan Fritsch
92e366007c Add lots of unique tags to error log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 23:02:04 +00:00
Jim Jagielski
427c85bd23 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:39:32 +00:00
Ruediger Pluem
cfe0a63cd5 * Correctly obey ServerName / ServerAlias if the Host header from the
request matches the VirtualHost address.

PR: 51709
Submitted by: Micha Lenk <micha lenk.info>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1172002 13f79535-47bb-0310-9956-ffa450edef68
2011-09-17 15:08:14 +00:00
Joe Orton
87d9d36a40 * server/vhost.c (get_addresses): For '*' and '_default_', return
address(es) for any address family, not IPv4 only.
  (dump_a_vhost): Use '*' for v4 or v6 wildcard address.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1147806 13f79535-47bb-0310-9956-ffa450edef68
2011-07-18 10:47:49 +00:00
Stefan Fritsch
51692222f6 Various code cleanup
PR: 51398
Submitted by: Christophe Jaillet <christophe jaillet wanadoo fr>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1138627 13f79535-47bb-0310-9956-ffa450edef68
2011-06-22 20:45:34 +00:00
Stefan Fritsch
c9fd2623da Introduce ap_(get|set)_core_module_config() functions/macros and use them
everywhere.

We know that the core module has module_index 0. Therefore we can save
some pointer operations in ap_get_module_config(cv, &core_module) and
ap_set_module_config(cv, &core_module, val). As these are called rather often,
this may actually have some (small) measurable effect.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132781 13f79535-47bb-0310-9956-ffa450edef68
2011-06-06 21:26:56 +00:00
Eric Covener
53e4a906db prefer exact port matches in ip-based VH lookup over wildcards.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1053309 13f79535-47bb-0310-9956-ffa450edef68
2010-12-28 11:21:56 +00:00
Eric Covener
458ab7f915 Remove need for NameVirtualHost directive by implicitly configuring any duplicated
VH addresses as name-based virtual hosts.  This also combines _default_ and *
into a single type of wildcard since these presented a false dichotomy between
address specs.

These are post-config only changes and do not change the runtime lookups.

The biggest loss here is that an unintended duplication of virtual host addresses
can no longer be reported as directly in the past, but should still be debuggabl
via apachectl -S (unintended NVH).  These problems are a drop in the bucket compared
to the difficulty users have with using NameVirtualHost.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1053230 13f79535-47bb-0310-9956-ffa450edef68
2010-12-28 00:46:50 +00:00
Daniel Earl Poirier
e4b94e1f8c Fail startup for vhost configuration problems, rather than
running with a configuration with undefined behavior.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@990844 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 16:09:50 +00:00
Daniel Earl Poirier
09e3207660 With -S, show ServerAlias values that go with the virtual hosts
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982629 13f79535-47bb-0310-9956-ffa450edef68
2010-08-05 14:12:25 +00:00
Stefan Fritsch
ebb62867fb Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
advantage of per-module loglevels


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951895 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:59:50 +00:00
Rich Bowen
ad563f431c Expand the "NameVirtualHost has no VirtualHosts" error message, since it
seems that we have to explain a dozen times a day what it really means.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@934984 13f79535-47bb-0310-9956-ffa450edef68
2010-04-16 16:33:20 +00:00
Jeff Trawick
e2a34108a3 non-static directive parsers should be AP_DECLARE_NONSTD()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@883860 13f79535-47bb-0310-9956-ffa450edef68
2009-11-24 20:32:42 +00:00
Nick Kew
093b9d66a0 Vhosts: treating a pure-numeric Host header as a port is nonsense.
PR 44979


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832172 13f79535-47bb-0310-9956-ffa450edef68
2009-11-02 22:51:45 +00:00
Paul J. Reder
3474fcacee Output -M and -S dumps (modules and vhosts) to stdout instead of stderr.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@727452 13f79535-47bb-0310-9956-ffa450edef68
2008-12-17 18:03:09 +00:00
Paul Querna
a324a1d72f Remove all references to CORE_PRIVATE.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645455 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 10:45:43 +00:00
Roy T. Fielding
de659cbed0 update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
Colm MacCarthaigh
dd95d7c37c Update the copyright year in all .c, .h and .xml files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
Jim Jagielski
5061d9fa92 No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:11:44 +00:00
Jim Jagielski
5d2fae4818 No functional change: simple detabbing of indented code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332305 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:05:51 +00:00
Ian Holsman
8c1e315d3f Doxygen fixup / cleanup
submited by: Neale Ranns neale ranns.org
reviewed by: Ian Holsman



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@263931 13f79535-47bb-0310-9956-ffa450edef68
2005-08-28 23:03:59 +00:00
Joe Orton
675c62c505 * server/vhost.c (get_addresses): Fix double negative and make errors
consistent; thanks Joshua.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@230469 13f79535-47bb-0310-9956-ffa450edef68
2005-08-05 13:49:07 +00:00
Joe Orton
8b92612278 * server/vhost.c (get_addresses): Fail with an error message rather
than an assert() for errors which plague users on Solaris boxes which
don't have a properly configured resolver.

PR: 27525


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@230453 13f79535-47bb-0310-9956-ffa450edef68
2005-08-05 12:27:57 +00:00
Paul Querna
03c53e0a5b Add ap_vhost_iterate_given_conn() as I had previously mentioned on the mailing list.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@164538 13f79535-47bb-0310-9956-ffa450edef68
2005-04-25 05:23:18 +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
Jeff Trawick
77ed5d99b1 <VirtualHost myhost> now applies to all IP addresses for myhost
instead of just the first one reported by the resolver.  This
corrects a regression since 1.3.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103897 13f79535-47bb-0310-9956-ffa450edef68
2004-06-11 13:44:14 +00:00
Joe Orton
b39f62cdc4 * server/vhost.c (remove_unused_name_vhosts): Remove redundant check;
catch all port-based NameVirtualHosts without defined VirtualHosts,
preventing segfaults later in some misconfigurations.

PR: 27731


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103400 13f79535-47bb-0310-9956-ffa450edef68
2004-04-15 20:36:45 +00:00
Joe Orton
28f9afc89e * server/vhost.c: Fix comments which got search'n'replaced.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102936 13f79535-47bb-0310-9956-ffa450edef68
2004-03-11 19:46:35 +00:00
André Malo
eeb57c17ad fix name of The Apache Software Foundation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102619 13f79535-47bb-0310-9956-ffa450edef68
2004-02-09 20:40:53 +00:00
André Malo
e88fcf3c64 fix copyright dates according to the first check in
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102589 13f79535-47bb-0310-9956-ffa450edef68
2004-02-08 13:58:22 +00:00
André Malo
4f02cb1e18 apply Apache License, Version 2.0
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102525 13f79535-47bb-0310-9956-ffa450edef68
2004-02-06 22:58:42 +00:00
André Malo
fb07607180 update license to 2004.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102135 13f79535-47bb-0310-9956-ffa450edef68
2004-01-01 13:26:26 +00:00
Jeff Trawick
07e907f0c2 stop using apr_sockaddr_port_get() accessor function, as it will
disappear from APR 1.0 API shortly


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101991 13f79535-47bb-0310-9956-ffa450edef68
2003-12-05 00:59:29 +00:00
André Malo
742af25096 finished that boring job:
update license to 2003.

Happy New Year! ;-))


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98573 13f79535-47bb-0310-9956-ffa450edef68
2003-02-03 17:53:28 +00:00
Brian Pane
679f82a1d2 Rearranged the loop in fix_hostname() to run faster in the
common case in which lowercase characters are the most frequent
characters in the hostname


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96616 13f79535-47bb-0310-9956-ffa450edef68
2002-09-02 01:37:54 +00:00
Victor J. Orlikowski
d982829aa1 Continue the Bill Rowe apr_size_t crusade.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95993 13f79535-47bb-0310-9956-ffa450edef68
2002-07-10 06:01:14 +00:00
Brian Pane
f24fa31695 Convert the hostname to all-lowercase in fix_hostname() so that
the implementation matches the comments.  (Note: The current virtual
hosting code does case-insensitive host matching, so this fix is useful
mostly to help ensure that custom modules and any future vhosting code
don't get tripped up by case-sensitivity issues.)
Submitted by:	Perry Harrington <pedward@webcom.com>
Reviewed by:	Brian Pane


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95866 13f79535-47bb-0310-9956-ffa450edef68
2002-06-23 08:10:49 +00:00
Jeff Trawick
c871b41d3c stop using APLOG_NOERRNO in calls to ap_log_?error()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95149 13f79535-47bb-0310-9956-ffa450edef68
2002-05-17 11:11:39 +00:00
Brian Pane
e556e52b59 Eliminate some sprintf calls
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94885 13f79535-47bb-0310-9956-ffa450edef68
2002-05-01 06:41:36 +00:00
Justin Erenkrantz
e955e53d37 Allow empty Host: header arguments.
Previously, request that sent:

GET / HTTP/1.1
Host:

would get a 400.  RFC 2616 specifically allows for a "blank" host field.

The read_request code properly handled this, but the fix_hostname in
vhost.c would cause the 400.  Now, simply return in fix_hostname when
we see a blank hostname rather than erroring out.

PR: 7441


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94655 13f79535-47bb-0310-9956-ffa450edef68
2002-04-15 02:58:11 +00:00
Brian Pane
d2fdf5ba21 Fix for vhosts where the hostname is followed by '.'
PR: 9187
Submitted by:	Ryan Cruse <ryan@estara.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93988 13f79535-47bb-0310-9956-ffa450edef68
2002-03-18 01:43:17 +00:00
Jeff Trawick
a070cd5c90 clean up the use of apr_sockaddr_t (stay out of family-specific
struct sockaddr* as much as possible)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93960 13f79535-47bb-0310-9956-ffa450edef68
2002-03-15 17:47:48 +00:00