It turrns out that in httpd-2.4.6 the mod_cgi module is not built or enabled by default.
Here is a build recipe which works:
Build httpd with there configure options:
configure \
--prefix=$TOP \
--with-apr=$TOP/bin/apr-1-config \
--with-apr-util=$TOP/bin/apu-1-config \
--with-pcre=$TOP/bin/pcre-config \
--enable-modules=all \
--enable-proxy \
--enable-proxy-http \
--disable-userdir \
--enable-cgi
And then in the httpd.conf file make sure the mod_cgi.so module is loaded:
LoadModule cgi_module modules/mod_cgi.so
To get the printenv
cgi script to work, add the ExecCGI
option to the options for the /cgi-bin/ directory:
<Directory "/var/tmp/apps/cgi-bin">
AllowOverride None
- Options None
+ Options +ExecCGI
Require all granted
</Directory>