Chuck Murcko [Mon, 12 Jun 2000 21:41:58 +0000 (21:41 +0000)]
New mod_proxy/mod_cache (file cache) for 2.0. This uses a caching API so
that shared mem, LDAP servers, DBs, etc. can also be used for proxy
caching. The caching API is very young, and subject to change as APR changes.
proxy_cache.c from the proxy subdir is no longer used.
Build with --enable-modules=proxy,cache
Lightly tested on Linux, no warranties expressed or implied yet.
This should be considered a *reference* proxy implementation for 2.0. What
actually ends up shipping with 2.0 is likely going to be rather different as
the redesign evolves. This may end up being the 2.0 backwards compatibility
workalike.
Modified to work with today's conf/build/layout scheme
Jeff Trawick [Mon, 12 Jun 2000 21:39:57 +0000 (21:39 +0000)]
Fix logging of errors creating the httpd.pid file.
perror() was converted to ap_log_error(), which will interpret the
specified APR error code properly.
The existing ap_log_error() call was changed so that the message is
formatted properly. Note that this call is made from the mpm after
we detach from the foreground process, so it can only appear in the
log.
Jeff Trawick [Mon, 12 Jun 2000 21:08:25 +0000 (21:08 +0000)]
Back out ap_set_default_perms(). Remove old logic to play with umask
around the creation of the httpd.pid file. Pass explicit permissions to
ap_open(), omitting write-ability except by the owning user. As always,
we end up with rw-r--r-- for the permissions unless the umask is something
unusual.
Note that the OS/2 and Win32 implementations of ap_open() ignore the
permissions parameter altogether.
Ryan Bloom [Mon, 12 Jun 2000 16:00:33 +0000 (16:00 +0000)]
Add a new function ap_set_default_fperms. This allows people to set the
umask to be used when creating files. This should change the permissions
of files created using APR_DEFAULT_OS. Also removed a warning introduced
with the sys/stat.h changes.
Ryan Bloom [Mon, 12 Jun 2000 15:29:09 +0000 (15:29 +0000)]
Remove the final vestiges of stat.h from Apache 2.0. All calls are now to
ap_stat. This also adds the new function ap_lstat(). This function is
analogous to lstat.
Jeff Trawick [Sun, 11 Jun 2000 22:06:57 +0000 (22:06 +0000)]
Fix a couple of problems with the pre/post config processing changes:
1) symptom: on system with bad/no DNS setup, ServerName isn't
processed so init fails
cause:
ap_fini_vhost_config() called before ap_process_config_tree(), so
ServerName was never stored in the config structure
2) symptom: on system with virtual hosts configured, SIGSEGV in
open_multi_logs()
cause:
the module configs for the virtual hosts haven't been merged in
yet, and open_multi_logs() gets NULL for the mod_log_config
configuration
This stuff needs to be cleaned up further, exploring the use of a
post-config hook for fixup_virtual_hosts(), ap_fini_vhost_config(),
and ap_sort_hooks(), getting a lot of logic out of main(), and
processing the config tree only once.
Ben Laurie [Sun, 11 Jun 2000 14:08:16 +0000 (14:08 +0000)]
Make "make depend" work - pending a real fix, that is. I did attempt to do this
properly, but that means some radical autoconf shit that is, once more, beyond
me.
Jeff Trawick [Sat, 10 Jun 2000 18:20:35 +0000 (18:20 +0000)]
Get FreeBSD 3.4 building again. It doesn't have lib dl, so the build
was broken as of the time we started always sticking in -ldl.
src/modules/standard/config.m4:
. don't add "-ldl" to LIBS for FreeBSD either
. back out previous change regarding LTFLAGS; it should be o.k.
to add it for any platform, because libtool knows what to do with
it (no, Greg A., I haven't added support for it to OS/390 libtool
yet :) )
src/lib/apr/configure.in:
. if dlopen() isn't found in lib dl, don't fret (yet); try to find
it in the default libraries;
Ryan Bloom [Sat, 10 Jun 2000 16:15:08 +0000 (16:15 +0000)]
Cleanup more of the Apache configuration. This removes all of the shared
memory checks, because Apache relies completely on APR for shared memory
support. In doing this, we also need to know how APR/MM are providing
our shared memory (ie file or memory) that requires the change made to
APR's configure script that was just committed.
Jeff Trawick [Sat, 10 Jun 2000 11:25:26 +0000 (11:25 +0000)]
Fix a Solaris compilation problem with mod_cgid:
Use <sys/un.h> to get sockaddr_un. Previously we declared it ourselves
for unknown reasons. I am now able to compile on Linux (RH6.1), Solaris
8, and FreeBSD 3.4. Also, I don't see a mention in UNP V1 (2e) of the
need to play tricks to get sockaddr_un.
dgaudet [Sat, 10 Jun 2000 02:06:02 +0000 (02:06 +0000)]
another iteration on the saferead/bhalfduplex stuff ... there was a
commented out bhalfduplex call which ryan missed; and which was a bit
more troublesome to solve with the iol interface.
dgaudet [Sat, 10 Jun 2000 01:10:10 +0000 (01:10 +0000)]
fix dependencies. (what is a .lo anyway? i tried making the .o depend
on the .h which is how dependencies usually work, but the other rules
didn't work out right unless i used a .lo ... i suppose this only matters
to folks building with -j N)
Ryan Bloom [Fri, 9 Jun 2000 21:19:52 +0000 (21:19 +0000)]
Remove a bunch of string functions from Apache. These are basically
standard string functions like strstr, strcasecmp, etc that Apache used
to define for platforms that don't have them. These functions and the
feature tests have moved down to APR where they really belong. In doing
this, I am also able to remove a bunch of tests from the Apache configure
process.
Ryan Bloom [Fri, 9 Jun 2000 18:57:16 +0000 (18:57 +0000)]
Remove all occurances of strerror from Apache. ap_strerror works just
fine with standard errno values, and it is more portable. This also allows
me to remove the check for strerror from Apache's configure script.
Andrew Braund's very complete review of the Win32 documentation!
These should have a profound effect on the number of Win32 inquiries
and problem reports.
I will have some minor notes on running as another user, and
using the perl .dsp conversion scripts to add as a seperate
commit later today.
Jeff Trawick [Fri, 9 Jun 2000 14:48:58 +0000 (14:48 +0000)]
The prefork MPM now uses an APR lock for the accept() mutex.
It has not been getting a lock at all recently.
Note: The TPF and SGI folks need to each APR how to get the most
efficient lock on those platforms. (For SGI it depends on whether
or not we're building for SMP.)
Ryan Bloom [Thu, 8 Jun 2000 19:29:40 +0000 (19:29 +0000)]
Cleanup APR header files a bit. Basically, this splits ap_table_t related
functions into their own header file, away from apr_pools.h. At the same
time as I was doing this, I removed a couple of definitions that aren't
used anywhere anymore, like ap_child_info_t.
Ryan Bloom [Thu, 8 Jun 2000 01:47:21 +0000 (01:47 +0000)]
Fix some problems with the time commit. I guess mod_unique_id isn't turned
on by default, which is why my last build's didn't catch this. I'll be
more careful in the future.
Submitted by: Greg Stein
Jeff Trawick [Wed, 7 Jun 2000 12:36:51 +0000 (12:36 +0000)]
Change the mmap() feature test to check only for existence.
The autoconf-provided check used previously fails when the
platform doesn't support MAP_FIXED. Apache doesn't use that
mmap() feature, so we don't want to require it.
Submitted by: Greg Ames
Jeff Trawick [Tue, 6 Jun 2000 22:22:52 +0000 (22:22 +0000)]
Fix a couple of bugs in mod_cgid:
The cgi arguments were sometimes mangled because no terminating '\0' was
added to the arg string passed to the cgi daemon.
The len parm to accept() was not initialized, leading sometimes to an
endless loop of failed accept() calls on OS/390 and anywhere else that
failed the call if the len was negative.
Tweaks: Add some traces for failed socket calls at cgi daemon setup time
(most of which I hit while playing around).
Ryan Bloom [Tue, 6 Jun 2000 21:45:16 +0000 (21:45 +0000)]
Add the resource limiting code back to Apache 2.0. This only works on
Unix because I can't find any other platforms with rlimit. If there are
other platforms that need this code, then some of the code needs to move.
This has just barely been tested, so it could probably use some good
testing.
Jeff Trawick [Tue, 6 Jun 2000 05:58:16 +0000 (05:58 +0000)]
Fix zombie process problem with mod_cgi. This problem was introduced
as part of the "Convert ap_proc_t to a complete type." enhancement.
mod_cgi previously declared a ptr to an ap_proc_t, storage was allocated
by ap_create_process() from the request pool, and the ap_proc_t address
was passed to ap_note_subprocess().
With the "Convert ap_proc_t to a complete type." change, ap_proc_t
lived in autodata, but the address was still passed to
ap_note_subprocess(). When the pool was cleaned up, the ap_proc_t
in autodata had been used for something else, so the contents were
garbage, but pool cleanup needed the contents, especially the os
pid to pass to waidpid(). Since this was garbage, we never reaped
status from the cgi child and thus the cgi child remained a zombie.
Jeff Trawick [Tue, 6 Jun 2000 00:51:20 +0000 (00:51 +0000)]
Fix typo in configure script when checking for mod_so. bash
doesn't seem to have a problem but /bin/sh on Solaris does.
Symptom: "./configure: test: unknown operator =="
Ryan Bloom [Mon, 5 Jun 2000 23:14:35 +0000 (23:14 +0000)]
Remove the ability to enable/disable DSO support in APR. The only current
way to check for DSO support is to look for libdl. Apache automatically
adds -ldl to it's LIBS flag from config.m4 in modules/standard. Other
platforms will need to add the correct flag for their system.
Jeff Trawick [Mon, 5 Jun 2000 20:45:08 +0000 (20:45 +0000)]
Make a copy of getenv("PATH") before storing for later use. Some
getenv() implementations use the same storage for successive calls.
CGIs on OS/390 had a bad PATH due to this. (Believe it or not, ANSI
says getenv() can do this.)
Some similar getenv() usage was left alone as it was specific to a
certain platform, and I assume that getenv() doesn't have the "issue"
on those platforms.
Ryan Bloom [Mon, 5 Jun 2000 19:44:02 +0000 (19:44 +0000)]
Add server tokens back to 2.0. Also bring forward the change to allow
the PRODUCT_ONLY value for ServerTokens. This is relatively clean,
all of the code lives in http_core, and when a module wants to add a token,
they just call ap_add_version_component from the post_config hook. Actually
ap_add_version_component can be done anytime after the config has been
parsed, it just makes the most sense to do it in post_config IMHO.