Commit Graph

227 Commits

Author SHA1 Message Date
64cae59df9 Merge 1328345, add CHANGES entry:
* server/main.c (main): Bail out *before* signalling the server
  if the config is bad. (as per the claim in the docs!)

Submitted by: jorton
Reviewed by: jorton, jim, sf


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1331847 13f79535-47bb-0310-9956-ffa450edef68
2012-04-28 22:56:20 +00:00
0d0b2542fe Merge r1225197:
Adapt loglevel of config errors during second pass

Don't use APLOG_STARTUP since at that point, the error log is already
available. This gives us timestamps if these errors happen during graceful
restart.

Use level 'emerg' as these errors are fatal.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1225201 13f79535-47bb-0310-9956-ffa450edef68
2011-12-28 14:59:11 +00:00
b6ae8ca44a Backport r1209766, r1210252, r1210284:
Add lots of unique tags to error log messages

ssl_util.c: Downgrade some dynamic locking messages from level DEBUG
to TRACE1-3


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1210287 13f79535-47bb-0310-9956-ffa450edef68
2011-12-05 00:08:01 +00:00
3fb597edad Merge r1201354 from trunk:
Server directive display (-L): Include directives of DSOs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1201358 13f79535-47bb-0310-9956-ffa450edef68
2011-11-12 23:52:14 +00:00
239e4c0466 config generation # (reported by ap_state_query(AP_SQ_CONFIG_GEN):
* start at 0 instead of 1
* don't increment until after pconf cleanups run, in case a 
  cleanup needs to check the related config generation


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200147 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 04:52:52 +00:00
b791885bad Only init the RNG once at startup. This saves some entropy and works around the APR bug
fixed in r1198921


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1198930 13f79535-47bb-0310-9956-ffa450edef68
2011-11-07 20:57:02 +00:00
0ddfb3e6cc Add -D DUMP_RUN_CFG option to dump some configuration items
from the parsed (or default) config. This is useful for init scripts that
need to setup temporary directories and permissions, for example if those
temporary directories are located on a ram disk.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1180681 13f79535-47bb-0310-9956-ffa450edef68
2011-10-09 18:35:23 +00:00
a861cc3cfb Sort hooks twice, once before pre_config, once after ap_process_config_tree.
This fixes a regression with perl modules introduced by r1032002

PR: 45076
Submitted by: Torsten Foertsch <torsten foertsch gmx net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1180325 13f79535-47bb-0310-9956-ffa450edef68
2011-10-08 07:15:58 +00:00
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
01ed21af9d Add wrappers for malloc, calloc, realloc that check for out of memory
situations.  Use them in most places where malloc, and friends are used.
This results in clean error messages in an out of memory situation instead of
segfaulting or silently malfunctioning. In some places, it just allows to
remove some logging code.

PR 51568, PR 51569, PR 51571.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1172686 13f79535-47bb-0310-9956-ffa450edef68
2011-09-19 16:25:42 +00:00
6bd438fe64 Add in a configuration generation... this is independent of
MPM gen, just in case we ever switch MPMs at a graceful ;)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1087331 13f79535-47bb-0310-9956-ffa450edef68
2011-03-31 15:12:09 +00:00
9144fec263 * server/main.c (main): Use the real null cleanup callback.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1082170 13f79535-47bb-0310-9956-ffa450edef68
2011-03-16 15:53:34 +00:00
d7edefbbe4 Ensure that ap_server_conf always points to valid data or is NULL.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1080784 13f79535-47bb-0310-9956-ffa450edef68
2011-03-11 22:16:16 +00:00
d6de9e9f67 Create new ap_state_query() function that allows modules to determine
if the current configuration run is the initial one at server startup,
and if the server is started for testing/config dumping only.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070151 13f79535-47bb-0310-9956-ffa450edef68
2011-02-12 21:18:32 +00:00
2e8001b539 revert r1066944, r1067177 for now
breaks MacOS X and wherever this code will go, server/main.c does not seem to be the right place.
See
http://mail-archives.apache.org/mod_mbox/httpd-dev/201102.mbox/%3C01930193-8A3B-4635-9EB0-5EE31349E49C@jaguNET.com%3E


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1067483 13f79535-47bb-0310-9956-ffa450edef68
2011-02-05 19:02:33 +00:00
3b7deb691f Until this is fixed to link in lresolv, exclude.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1067177 13f79535-47bb-0310-9956-ffa450edef68
2011-02-04 13:24:39 +00:00
9ae08fc325 Reload resolv.conf on graceful restarts
PR: 50619
Submitted by: Matt Miller <m miller f5 com>, Stefan Fritsch


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1066944 13f79535-47bb-0310-9956-ffa450edef68
2011-02-03 20:20:02 +00:00
35cdba6976 Replace ap_expr with a parser derived from mod_ssl's parser. Make mod_ssl use
the new parser. Rework ap_expr's public interface and provide hooks for modules
to add variables and functions.

The Netware and Windows build files still need to be adjusted


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1032073 13f79535-47bb-0310-9956-ffa450edef68
2010-11-06 14:31:16 +00:00
26d9243e32 Fix hook sorting for the pre_config hook.
Move modules/http/config2.m4 back to modules/http/config.m4, since this was
only done as work-around in r88887 for the broken hook-sorting.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1032002 13f79535-47bb-0310-9956-ffa450edef68
2010-11-06 11:11:17 +00:00
d77ea5e459 Renamed optarg -> opt_arg to avoid name clashes with system-own optarg.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1004297 13f79535-47bb-0310-9956-ffa450edef68
2010-10-04 15:45:38 +00:00
6526baeced Fortify complains about an overflow of pad[], which would
require a mongo argv[0].  Get the vprintf formatter to handle
the padding and avoid creating the padding altogether.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@987339 13f79535-47bb-0310-9956-ffa450edef68
2010-08-19 22:35:21 +00:00
ab778a0924 add -X to usage message
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@956684 13f79535-47bb-0310-9956-ffa450edef68
2010-06-21 20:34:44 +00:00
75e31c7abf remove APLOG_USE_MODULE from main.c:
It causes build problems on Windows and the ap_log* calls in main.c
don't profit from it anyway, because there is no server_rec yet where
they could look up core_module's loglevel.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@952783 13f79535-47bb-0310-9956-ffa450edef68
2010-06-08 19:30:24 +00:00
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
60821a3b74 replace duplicate code with new function ap_parse_log_level()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@905454 13f79535-47bb-0310-9956-ffa450edef68
2010-02-01 23:27:32 +00:00
27a6babb71 Design error; main.c is not part of the libhttpd, you can't forward
referrence storage like this.  Move the variable allocation into the
ap_ library module.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@901557 13f79535-47bb-0310-9956-ffa450edef68
2010-01-21 06:31:47 +00:00
16c7c53458 * With APR >= 2.0 there is no longer an APR-UTIL only an APR.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@893542 13f79535-47bb-0310-9956-ffa450edef68
2009-12-23 15:09:21 +00:00
2631cbd498 Strip SHARED_CORE deadwood.
PR 46239


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@893044 13f79535-47bb-0310-9956-ffa450edef68
2009-12-22 00:05:40 +00:00
71702c45ac (re)-introduce -T commandline option to suppress documentroot check at startup
PR 41887
Patch by Jan van den Berg


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@893027 13f79535-47bb-0310-9956-ffa450edef68
2009-12-21 23:26:00 +00:00
2e9668a33d Replace AcceptMutex, LockFile, RewriteLock, SSLMutex, SSLStaplingMutex,
and WatchdogMutexPath with a single Mutex directive.  Add APIs to
simplify setup and user customization of APR proc and global mutexes.  
(See util_mutex.h.)  Build-time setting DEFAULT_LOCKFILE is no longer
respected; set DEFAULT_REL_RUNTIMEDIR instead.

Some existing modules, such as mod_ldap and mod_auth_digest gain 
configurability for their mutexes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@883540 13f79535-47bb-0310-9956-ffa450edef68
2009-11-23 23:17:51 +00:00
87996b526a Fix usage message on the Windows platform.
- do not include graceful commands and duplicate
  start|restart|stop
- add ServerRoot to the parameters encapsulated by "-n"


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@772356 13f79535-47bb-0310-9956-ffa450edef68
2009-05-06 16:53:55 +00:00
d1c3416282 main() can use ap_run_mpm() directly, so axe the old ap_mpm_run() function
change the mpm hooks to return OK/DONE instead of 0/1


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@762127 13f79535-47bb-0310-9956-ffa450edef68
2009-04-05 17:54:22 +00:00
0d2cef82b3 stop exporting APACHE_MPM_DIR to modules -- unclear why this was ever necessary, and it
makes no sense with loadable MPMs
axe the unnecessary MPM_DIR build variable
move the stray APACHE_SUBST(MPM_LIB) from configure.in to server/mpm/config.m4, where
  the other MPM_foos are handled


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@760403 13f79535-47bb-0310-9956-ffa450edef68
2009-03-31 11:34:49 +00:00
577e7224d5 resurrect the call to show_mpm_settings(), but defer the entire -V processing until
after module loading if there is no built-in MPM

(we could just defer displaying the MPM info, but that would change the order of
output from what people/scripts expect)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758335 13f79535-47bb-0310-9956-ffa450edef68
2009-03-25 16:33:53 +00:00
9db133b4a8 Provide ap_set_retained_data()/ap_get_retained_data() for preservation
of module state across unload/load.

The existing idiom used by modules to associate userdata with pglobal
doesn't work in the earliest phases of module execution.

(This does expose pglobal as an implementation detail, but it would be great 
to unexpose it if at all possible (but modules already have access to pglobal
at almost all stages of execution anyway).)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758173 13f79535-47bb-0310-9956-ffa450edef68
2009-03-25 08:30:18 +00:00
f6d5287c57 set ap_server_conf as early as possible; axe the duplicate variable
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758065 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 22:30:38 +00:00
7720a70dc4 axe the remaining checks of AP_MPM_WANT_foo to see what code to generate
MPMs no longer provide those definitions

(the signal server support is an interesting problem, since it has to be known before loading
loading the MPM)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758014 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 20:52:10 +00:00
e0eb7d1eef Introduce a new set of APIs to allow MPMs to be proper modules instead
of integral parts which share global variables, functions, and macros
with the rest of httpd.

Converted now:
  prefork, worker, event, simple, WinNT*

*WinNT hasn't been built or tested, and relies on a hack to include the
WinNT mpm.h to disable Unixy MPM support routines in mpm_common.c


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757853 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 15:43:59 +00:00
a73acf02f6 API Cleanup in preperation for 2.4.x, make sure all exported functions or variables contain an ap_ prefix.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@722399 13f79535-47bb-0310-9956-ffa450edef68
2008-12-02 08:13:36 +00:00
b850cc9e29 * Give possible piped loggers a chance to process their input before they get
killed by us.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@681204 13f79535-47bb-0310-9956-ffa450edef68
2008-07-30 21:08:33 +00:00
a757663206 * server/main.c: Unbreak the build.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645540 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 14:31:09 +00:00
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
c8ba67fb83 Avoid calling access control hooks for internal requests with
configurations which match those of the initial request.  Revert to
the original behaviour (call access control hooks for internal requests
with URIs different from the initial request) if any access control hooks
or providers are not registered as permitting this optimization.
Introduce wrappers for access control hook and provider registration
which can accept additional mode and flag data.

The configuration walk optimizations were originally proposed a while
ago (see http://marc.info/?l=apache-httpd-dev&m=116536713506234&w=2);
they have been used since then in production systems and appear to be
stable and effective.  They permit certain combinations of modules
and clients to function efficiently, especially when a deeply recursive
series of internal requests, such as those generated by certain WebDAV
requests, are all subject to the identical authentication and authorization
directives.

The major change from the original proposal is a cleaner mechanism for
detecting modules which may expect the old behaviour.  This has been
tested successfully with Subversion's mod_authz_svn, which specifically
requires the old behaviour when performing path-based authorization based
against its own private access control configuration files.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@644525 13f79535-47bb-0310-9956-ffa450edef68
2008-04-03 21:51:07 +00:00
41df671a88 Flesh out ap_expr with:
* Re-usable parse trees
 * Canonical string parser function (candidate)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@642971 13f79535-47bb-0310-9956-ffa450edef68
2008-03-31 12:16:58 +00:00
5873511f51 make sure we Unix weenies get a newline at the end
of the message instead of our shell prompt

don't be overprotective of apr_ctime() by giving it 
more memory than it requires or nuking a newline 
which isn't there


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@569934 13f79535-47bb-0310-9956-ffa450edef68
2007-08-27 00:45:56 +00:00
67eafbb00a Add a comment to prevent a future upgrade of APR 2.0 or similar
from inflicting new fatal errors on the startup error reporting.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@569137 13f79535-47bb-0310-9956-ffa450edef68
2007-08-23 20:48:30 +00:00
8f63aa601c main core: Emit errors during the initial apr_app_initialize()
or apr_pool_create() (when apr-based error reporting is not ready).

This moves apr_app_initialize() into init_process (and indirects the
argv/argc parameters for this function) since the same error logging
is appropriate to either failure.

Note the change of the internal name create_process to init_process,
since create_process means something very different in apr-land.

(Replaces the misapplied commit r568762, already backed out).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@568779 13f79535-47bb-0310-9956-ffa450edef68
2007-08-23 00:10:35 +00:00
2c1ba34b2a Revert r568762; will reapply in two segments
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@568778 13f79535-47bb-0310-9956-ffa450edef68
2007-08-23 00:05:58 +00:00
ca1c141ec2 Eliminate an XXX; apr-based file logging isn't available to report
failures of apr_app_initialize() nor the very first apr_create_pool.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@568762 13f79535-47bb-0310-9956-ffa450edef68
2007-08-22 22:40:04 +00:00
ada9c28dcf Revert r547987 ("svn merge -c -547987 .")
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@551835 13f79535-47bb-0310-9956-ffa450edef68
2007-06-29 09:31:11 +00:00