docker-library / httpd

Docker Official Image packaging for Apache HTTP Server
https://httpd.apache.org
Apache License 2.0
309 stars 347 forks source link

suEXEC user mismatch #234

Open dchmayer opened 1 year ago

dchmayer commented 1 year ago

When trying to execute a cgi-file, suexec throws an error, because the apache process is running as user "www-data", whilst the flag "AP_HTTPD_USER" is set to "www" by default.

[2023-05-22 18:21:45]: user mismatch (www-data instead of www)

output of "suexec -V": -D AP_DOC_ROOT="/usr/local/apache2/htdocs" -D AP_GID_MIN=100 -D AP_HTTPD_USER="www" -D AP_LOG_EXEC="/usr/local/apache2/logs/suexec_log" -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin" -D AP_UID_MIN=100 -D AP_USERDIR_SUFFIX="public_html"

Is it possible to replace suEXEC "AP_HTTPD_USER" default value to container default httpd user in order to make it functional by default?

tianon commented 1 year ago

Interesting! I'm not very familiar with suexec, but what I can find in https://httpd.apache.org/docs/2.4/programs/configure.html#suexec doesn't look very promising for a "simple" fix to this (just supplying an appropriate ./configure argument). This probably requires a bit more digging into what we need to set/change in order to get this default value changed appropriately.