Hello. We use ubi9/httpd-24 as a base for the Red Hat Offline Knowledge Portal.
We would like to be able to listen on IPv4 and IPv6, but gracefully handle cases where IPv6 is unavailable.
I began by adding Listen [::]:8080 to our custom config, mimir.conf. That worked, even when IPv6 is disabled with sysctl, however if the kernel is booted with ipv6.disable=1, then Apache will not launch because no IPv6 sockets can be claimed. On such systems, our product cannot run.
Next I tried adding Listen 8080 to our custom config. Apache wouldn't accept that because httpd.conf already claimed 8080.
The only workaround I could come up with so far is to override httpd.conf with a copy that has Listen 8080 and also override common.sh to comment out this sed:
sed -i -e 's/^Listen 80/Listen 0.0.0.0:8080/' ${HTTPD_MAIN_CONF_PATH}/httpd.conf
Would you be open to any of the following:
- Listening on IPv4 + IPv6 (if available) by default:
sed -i -e 's/^Listen 80/Listen 8080/' ${HTTPD_MAIN_CONF_PATH}/httpd.conf
- Having the startup scripts detect IPv6 (
/proc/net/if_inet6) and emit either Listen 8080 or Listen 0.0.0.0:8080 accordingly.
Since the only workaround we have right now involves overriding two core files, we're happy with anything that's less hacky and fragile, that allows us to listen on IPv4 and IPv6.
Side note: yes, we could listen on another port in our custom config, ie Listen 8081, and that should work, but it would require updating our docs, and it be a big problem for all the existing deployments of RHOKP that route to 8080.
Hello. We use
ubi9/httpd-24as a base for the Red Hat Offline Knowledge Portal.We would like to be able to listen on IPv4 and IPv6, but gracefully handle cases where IPv6 is unavailable.
I began by adding
Listen [::]:8080to our custom config,mimir.conf. That worked, even when IPv6 is disabled withsysctl, however if the kernel is booted withipv6.disable=1, then Apache will not launch because no IPv6 sockets can be claimed. On such systems, our product cannot run.Next I tried adding
Listen 8080to our custom config. Apache wouldn't accept that becausehttpd.confalready claimed8080.The only workaround I could come up with so far is to override
httpd.confwith a copy that hasListen 8080and also overridecommon.shto comment out this sed:Would you be open to any of the following:
sed -i -e 's/^Listen 80/Listen 8080/' ${HTTPD_MAIN_CONF_PATH}/httpd.conf/proc/net/if_inet6) and emit eitherListen 8080orListen 0.0.0.0:8080accordingly.Since the only workaround we have right now involves overriding two core files, we're happy with anything that's less hacky and fragile, that allows us to listen on IPv4 and IPv6.
Side note: yes, we could listen on another port in our custom config, ie
Listen 8081, and that should work, but it would require updating our docs, and it be a big problem for all the existing deployments of RHOKP that route to8080.