73 Commits

Author SHA1 Message Date
9b17700660 mod_systemd: if SELinux is available and enabled, log the SELinux
context at startup, since this may vary when httpd is started via
systemd vs being started directly.

* modules/arch/unix/mod_systemd.c (systemd_post_config):
  Do nothing for the pre-config iteration.
  Log the SELinux context if available.

* modules/arch/unix/config5.m4: Detect libselinux.

Have at least one CI job build mod_systemd.

Github: closes #422


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1916344 13f79535-47bb-0310-9956-ffa450edef68
2024-03-15 15:26:11 +00:00
e343347ab6 mod_systemd: Axe APR_OPTIONAL_FN redeclarations to avoid compiler warning.
ap_find_systemd_socket() and ap_systemd_listen_fds() are already declared in
"ap_listen.h", so just include them.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1916312 13f79535-47bb-0310-9956-ffa450edef68
2024-03-14 17:12:17 +00:00
db0631ed09 Remove libsystemd dependency from main httpd binary
Until this change httpd was linking libsystemd to the main httpd binary. If you want to run lightweight version of httpd in container, sometimes you just want to install
httpd binary with as little dependencies as possible to make container small in size and do not pull uncencessary dependencies and libraries.

This change will move all systemd library calls from listen.c to mod_systemd module and remove systemd linking from the main httpd bin.
Fixed mixed declaration and wrongly declared variable.

Submitted by: Luboš Uhliarik <luhliari redhat.com>

Github: closes #312


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899784 13f79535-47bb-0310-9956-ffa450edef68
2022-04-12 15:43:04 +00:00
af55830264 mod_unixd: Make CoreDumpDirectory work for FreeBSD 11+. PR 65819.
FreeBSD 11+ coredumping requires tracing enabled via procctl(PROC_TRACE_CTL).

Submitted by: David CARLIER <devnexen gmail.com>
Reviewed by: ylavic (by inspection)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897269 13f79535-47bb-0310-9956-ffa450edef68
2022-01-20 20:03:04 +00:00
24ce5b58e2 * modules/arch/unix/config5.m4: Don't override enable_systemd, fixing
--enable-systemd=static per covener's suggestion in
  <CALK=YjPrN644NtLROwYPyBeCpev-GHSAD2J-Z2hupLymZ0op-g@mail.gmail.com>
  Also fix the APACHE_MODULE() usage; disable the module by default
  for the "all" modules selection.

PR: 57632


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1872763 13f79535-47bb-0310-9956-ffa450edef68
2020-01-14 10:29:19 +00:00
003125c843 * modules/arch/unix/mod_systemd.c: Remove IdleShutdown feature which
was buggy per sf's feedback in 2.4.x backport proposal, and would
  probably be more appropriate outside this module anyway.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1872761 13f79535-47bb-0310-9956-ffa450edef68
2020-01-14 09:50:29 +00:00
9b9ecda02d * modules/arch/unix/mod_systemd.c (systemd_pre_mpm, systemd_monitor):
Ignore sd_notify{,f} failure cases as currently recommended by the
  systemd API docs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1840555 13f79535-47bb-0310-9956-ffa450edef68
2018-09-11 12:57:36 +00:00
64552862ed * modules/arch/unix/mod_systemd.c (systemd_post_config): Fix systemd
service getting stuck reloading if "ExtendedStatus off" is
  configured; regression in r1802251.

PR: 62697


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1840554 13f79535-47bb-0310-9956-ffa450edef68
2018-09-11 12:53:30 +00:00
52ecea1e1e Fix overriding ExtendedStatus to "off" with mod_systemd loaded, and
give more feedback to systemd during a reload.

* modules/arch/unix/mod_systemd.c (systemd_pre_config): New
  function; tell systemd the service is reloading here.
  (systemd_pre_mpm): Don't set ap_extended_status here, do nothing
  if ExtendedStatus is off.
  (register_hooks): Register pre_config hook.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1802251 13f79535-47bb-0310-9956-ffa450edef68
2017-07-18 08:14:42 +00:00
af14d158a3 Added many log numbers to log statements that
had none.

Those were not detected by the coccinelle script.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725485 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 12:02:41 +00:00
a0274a45d0 Hmmm... why did git miss this?
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1664456 13f79535-47bb-0310-9956-ffa450edef68
2015-03-05 18:56:05 +00:00
89b58e8552 Follow up r1617201:
Return EPERM if the uid is not root on chroot-ing.

Pointed out by trawick on
<CAKUrXK6EGmG1ZD4+UFZ05yznTe6twOU3n57YeO-Ney-_VV_dCQ@mail.gmail.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1618778 13f79535-47bb-0310-9956-ffa450edef68
2014-08-19 01:27:38 +00:00
1a3f433294 mod_systemd: Use AP_SIG_GRACEFUL instead of SIGWINCH.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1618588 13f79535-47bb-0310-9956-ffa450edef68
2014-08-18 11:51:01 +00:00
c14c0ab2c7 mod_systemd: Add IdleShutdown - number of seconds in idle-state after which
httpd is shutdown. This is useful in a combination with socket activation.
Add mod_systemd documentation.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1618579 13f79535-47bb-0310-9956-ffa450edef68
2014-08-18 10:48:41 +00:00
cd503763ee geteuid is always successful,
so remove errno reference.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1617201 13f79535-47bb-0310-9956-ffa450edef68
2014-08-11 05:06:50 +00:00
4e5e8a3b0b unixd_drop_privileges and ap_unixd_setup_child are almost the same,
so let's remove the redundant code.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1617196 13f79535-47bb-0310-9956-ffa450edef68
2014-08-11 03:04:21 +00:00
f6f568d30c * configure.in: Simplify/fix systemd detection: move later to fix
autoconf warnings; define HAVE_SYSTEMD rather than using CPPFLAGS.

* server/listen.c: Use HAVE_SYSTEMD for systemd #define.

* modules/arch/unix/config5.m4: Update systemd headers check.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1528032 13f79535-47bb-0310-9956-ffa450edef68
2013-10-01 10:15:12 +00:00
ba9ab903c4 Add support for systemd socket activation to listener sockets.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1511033 13f79535-47bb-0310-9956-ffa450edef68
2013-08-06 16:51:15 +00:00
d8ba1cbcfa required by eventopt
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1409295 13f79535-47bb-0310-9956-ffa450edef68
2012-11-14 18:45:43 +00:00
864d3d0d87 Follow on to r1393976 and r1396424:
mod_systemd: Specify "all" instead of "yes" (on Unix) so that APACHE_MODULE doesn't
             act as if the user requested it.

General: Fix APACHE_MODULE so that failed prereqs will disable a module unless the
         user requested it explicitly.

Result: By default systemd will be enabled where it actually works and disabled otherwise,
        but if the user requests it and the prereqs fail then configure will halt.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1396440 13f79535-47bb-0310-9956-ffa450edef68
2012-10-10 01:04:36 +00:00
1e4dc5deb4 Follow up r1393976: Fix typo in enablement of mod_systemd that caused it to be enabled on non-Unix
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1396424 13f79535-47bb-0310-9956-ffa450edef68
2012-10-10 00:01:21 +00:00
ca9bd8eb67 * modules/arch/unix/mod_systemd.c (systemd_pre_mpm): Simplify code
slightly; no functional change.  
  Use AP_DECLARE_MODULE.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1393997 13f79535-47bb-0310-9956-ffa450edef68
2012-10-04 11:44:34 +00:00
7414006ae9 * modules/arch/unix/mod_systemd.c: New module.
Submitted by: Jan Kaluza <jkaluza redhat.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1393976 13f79535-47bb-0310-9956-ffa450edef68
2012-10-04 10:12:41 +00:00
a5d3387329 Clarify code comment.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1375009 13f79535-47bb-0310-9956-ffa450edef68
2012-08-20 13:22:42 +00:00
beaee8f4e3 suexec: Support use of setgid/setuid capability bits on Linux, a
weaker set of privileges than the full setuid/setgid root binary.

* configure.in: Add --enable-suexec-capabilites flag.

* Makefile.in: If configured, use setcap instead of chmod 7555 on
  installed suexec binary.

* modules/arch/unix/mod_unixd.c (unixd_pre_config): Drop test for
  setuid bit if capability bits are used.

* docs/manual/: Add docs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1342065 13f79535-47bb-0310-9956-ffa450edef68
2012-05-23 21:38:39 +00:00
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
ae843193ea Only dump User/Group if DUMP_RUN_CFG is defined
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1180719 13f79535-47bb-0310-9956-ffa450edef68
2011-10-09 21:30:20 +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
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
103f776c25 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@1174748 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:38:09 +00:00
d4d90bdf0a suEXEC: Add Suexec directive to disable suEXEC without renaming the
binary (Suexec Off), or force startup failure if suEXEC is required
but not supported (Suexec On).  Change SuexecUserGroup to fail 
startup instead of just printing a warning if suEXEC is disabled.

Additionally, ap_unixd_config.suexec_disabled_reason has a message,
suitable for logging/messaging, explaining why the feature isn't
available.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1033519 13f79535-47bb-0310-9956-ffa450edef68
2010-11-10 15:34:43 +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
33e15a38e8 more configure-time support for dynamically loadable MPMs:
. axe --with-mpm="shared" hack, replace with --enable-mpms-shared={all|list}
. replace singular MPM_NAME with access to the list of enabled MPMs
. replace singular MPM_SUBDIR with list MPM_SUBDIRS
. enable OS/2 MPM in same manner as others with configure support instead of
  hard-coding in configure.in

Current state: MPMs are built as static archives (but not linked to httpd) with
--enable-mpms-shared, so they still have to be built with apxs to load 
dynamically.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832228 13f79535-47bb-0310-9956-ffa450edef68
2009-11-03 00:38:06 +00:00
96c72f1063 Treat gid's identically to uid's for purposes of numeric formatting.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@816388 13f79535-47bb-0310-9956-ffa450edef68
2009-09-17 21:35:04 +00:00
5181635ab3 Always make mod_*.h files available where they exist, modpath by modpath
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808722 13f79535-47bb-0310-9956-ffa450edef68
2009-08-28 01:27:46 +00:00
60fbe11de1 Bring back OS/2 support.
Reverses r758929 with a little bit of conflict resolution.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@807930 13f79535-47bb-0310-9956-ffa450edef68
2009-08-26 08:56:13 +00:00
777f02ed58 Correctly set suexec_enabled when httpd is run by non-root
PR 42175


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@791337 13f79535-47bb-0310-9956-ffa450edef68
2009-07-05 23:10:30 +00:00
10f788c851 - use apr_strerror() instead of strerror()
- log errno via param when using ap_log_*


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@773968 13f79535-47bb-0310-9956-ffa450edef68
2009-05-12 16:30:55 +00:00
9c47ca1438 Whoops! cleanup r771144, which had some local/dev stuff left in
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@771145 13f79535-47bb-0310-9956-ffa450edef68
2009-05-03 23:04:02 +00:00
40361e60f3 mod_privileges: introduce PrivilegesMode: fast mode as before vs secure
mode to fork an unprivileged child per-request in the manner of MPM-ITK
anwhere there's a risk of running malicious code.
Documentation to follow.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@771144 13f79535-47bb-0310-9956-ffa450edef68
2009-05-03 23:02:35 +00:00
a1908585a8 Core can specify a platform-specific rewrite args hook. Use that on Unix.
Windows continues to specify this in the MPM, at least until someone
can separate out the MPM-specific bits.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@759699 13f79535-47bb-0310-9956-ffa450edef68
2009-03-29 14:41:02 +00:00
301f0404f5 axe unmaintained 1.3-era code to support AUX, SunOS, IRIX, Next, Tandem, MPE,
LynxOS, QNX, and UnixWare


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758944 13f79535-47bb-0310-9956-ffa450edef68
2009-03-27 00:32:22 +00:00
cb8a82faed remove TPF support
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758936 13f79535-47bb-0310-9956-ffa450edef68
2009-03-27 00:05:18 +00:00
ee32468a33 remove OS/2 platform support
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758929 13f79535-47bb-0310-9956-ffa450edef68
2009-03-26 23:47:52 +00:00
c7266edf61 The rewrite-args hook isn't available to MPM DSOs. Piggy-back on the
linked-in mod_unixd.c to handle that.

(The set of MPMs modified is the same set for which mod_unixd is enabled,
which is approximately equivalent to the set of Unix MPMs which anybody has
tried to maintain in recent memory.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758278 13f79535-47bb-0310-9956-ffa450edef68
2009-03-25 14:50:24 +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
076514f3ac Allow building httpd without a built-in MPM by specifying
--with-mpm=shared

on configure.  When built thusly, an MPM should be loaded via LoadModule.

(Currently you need to build the MPM with apxs.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757999 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 20:23:42 +00:00
736d659de0 use a local module header file to store the function prototype
for ap_unixd_setup_child() that is used outside this module.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@739487 13f79535-47bb-0310-9956-ffa450edef68
2009-01-31 01:46:56 +00:00
2288718073 name protect unixd_setup_child and restore its prototype to unixd.h
If someone wants to find a better place for it, then feel free to
so so only if you compile with -Werror before committing.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@739151 13f79535-47bb-0310-9956-ffa450edef68
2009-01-30 02:51:32 +00:00
7061cf0770 Match up formats with args in error messages.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@738526 13f79535-47bb-0310-9956-ffa450edef68
2009-01-28 16:23:11 +00:00