Container platform
OCP 4
Version
No response
OS version of the container image
RHEL 9
Bugzilla, Jira
No response
Description
httpd-prepare: config_general() Listen port substitution is not idempotent. produces Listen 808080 on repeated runs.
Was introduced with c5c9b6c, @notroj
Currently we have our base apache image starting from the base httpd-24 images in redhat catalog. We then bake in a conf in config.d that disables certain ciphers and other standards we want to enforce in all of our apache images. After we drop the new config, I have to run /use/libexec/httpd-prepare or during get start up, I get permission errors.
My local fix is to just run sed -i -e 's/^Listen 808080$/Listen 8080/' ${HTTPD_MAIN_CONF_PATH}/httpd.conf after I run httpd-prepare, but this can be avoided if on https://github.com/sclorg/httpd-container/blob/c5c9b6c9c8c1827eaf80ab233197af484f61f44d/2.4/root/usr/share/container-scripts/httpd/common.sh#L67C3-L67C75, used an end of line anchor sed -i -e 's/^Listen 80$/Listen 8080/' ${HTTPD_MAIN_CONF_PATH}/httpd.conf
Reproducer
Sample container file, have shared config in httpd-cfg
FROM --platform=linux/amd64 registry.redhat.io/ubi9/httpd-24@sha256:73094fec7fcdae7579d23d583b7535158041d6813bf903087e7c5e312b22361c
USER root
COPY httpd-cfg/ /etc/httpd/
RUN /usr/libexec/httpd-prepare && rpm-file-permissions
USER 1001
After first run, Listen port will be 808080
Container platform
OCP 4
Version
No response
OS version of the container image
RHEL 9
Bugzilla, Jira
No response
Description
httpd-prepare: config_general() Listen port substitution is not idempotent. produces Listen 808080 on repeated runs.
Was introduced with c5c9b6c, @notroj
Currently we have our base apache image starting from the base httpd-24 images in redhat catalog. We then bake in a conf in config.d that disables certain ciphers and other standards we want to enforce in all of our apache images. After we drop the new config, I have to run /use/libexec/httpd-prepare or during get start up, I get permission errors.
My local fix is to just run
sed -i -e 's/^Listen 808080$/Listen 8080/' ${HTTPD_MAIN_CONF_PATH}/httpd.confafter I run httpd-prepare, but this can be avoided if on https://github.com/sclorg/httpd-container/blob/c5c9b6c9c8c1827eaf80ab233197af484f61f44d/2.4/root/usr/share/container-scripts/httpd/common.sh#L67C3-L67C75, used an end of line anchorsed -i -e 's/^Listen 80$/Listen 8080/' ${HTTPD_MAIN_CONF_PATH}/httpd.confReproducer
Sample container file, have shared config in httpd-cfg
After first run, Listen port will be 808080