Ubuntu Server 20.04 + docker (latest in repository)
I have created a Dockerfile for Perl/httpd:
FROM httpd:latest
RUN apt-get update && apt-get -y install \
libapache2-mod-perl2 \
libemail-sender-perl \
libemail-simple-perl \
libemail-valid-perl \
libfile-finder-perl \
libcgi-pm-perl \
libtry-tiny-perl \
libfile-fcntllock-perl \
libjson-perl \
libdatetime-locale-perl \
perl
and an override for httpd.conf, including:
Listen 80
<IfModule !mpm_prefork_module>
LoadModule cgid_module modules/mod_cgid.so
</IfModule>
DocumentRoot "/usr/local/apache2/htdocs"
<Directory "/usr/local/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory "/usr/local/apache2/cgi-bin">
AllowOverride None
Require all granted
Options +ExecCGI
AddHandler cgi-script .pl
</Directory>
and docker-compose.yml:
version: "3"
volumes:
web:
external: true
services:
apache-perl:
image: apache-perl
restart: always
ports:
- 80:80
volumes:
- web:/usr/local/apache2:rw
- ./wp_ports.conf:/usr/local/apache2/ports.conf:ro
- ./httpd-foreground:/usr/local/bin/httpd-foreground:ro
- /opt1/bitnami-wordpress/apache2/htdocs:/usr/local/apache2/htdocs:ro
- /opt1/bitnami-wordpress/apache2/cgi-bin:/usr/local/apache2/cgi-bin:ro
- /opt1/wordpress-bitnami/apache2/logs:/usr/local/apache2/logs:rw
and all my *.pl and *.cgi files in the cgi-bin folder have the execute attribute.
Note that all 3 containers should have the same URL, but with different ports.
Why do I get the following message?
This site can’t be reached hollandnumerics.org.uk refused to connect. Try: Checking the connection Checking the proxy and the firewall ERR_CONNECTION_REFUSED
and now I have found the following message in the apache-perl container log:
{"log":"/usr/local/bin/httpd-foreground: 7: exec: httpd: not found\n","stream":"stderr","time":"2025-03-11T11:56:35.356895565Z"}
So where should httpd be found? I have also tried /usr/local/bin/httpd and /usr/local/apache2/bin/httpd.
…Phil