ports/www/apache24 cgi-bin fails, OK on apache22
Julian H. Stacey
jhs at berklix.com
Mon Nov 19 00:47:22 UTC 2018
Hi apache at FreeBSD.org, as MAINTAINER= in /usr/ports/www/apache24/Makefile
(If this is a list, please retain CC: <jhs at berklix.com>
On current, with www/apache24, cgi-bin scripts dont execute, they just list.
What else is needed to make cgi-bin stuff eg printenv & test-cgi execute please ?
My CGI worked on www/apache22 & previous apache.
It would be nicer if the installed httpd.conf.sample supported a working cgi-bin.
pkg delete apache24-2.4.37
pkg install apache24-2.4.37
firefox http://localhost/
OK, lists my /usr/local/www/apache24/data/index.html
grep cgi-bin /usr/local/etc/apache24/httpd.conf
chmod 755 /usr/local/www/apache24/cgi-bin/printenv
firefox http://localhost/cgi-bin/printenv
Fails to execute, Just lists itself
#
# To permit this cgi, replace # on the first line above with the
# appropriate #!/path/to/perl shebang, and on Unix / Linux also
# set this script executable with chmod 755
...etc...
vi /usr/local/www/apache24/cgi-bin/printenv
#!/usr/local/bin/perl
firefox http://localhost/cgi-bin/printenv
Fails.
cp /usr/local/bin/perl /sbin/perl
vi /usr/local/www/apache24/cgi-bin/printenv
firefox http://localhost/cgi-bin/printenv
#!/sbin/perl
Fails
firefox http://localhost/cgi-bin/easter
Fails
firefox http://www.berklix.org/cgi-bin/easter
OK, executes on apache22
2.4 httpd-access.log
127.0.0.1 - - [18/Nov/2018:20:27:44 +0100] "GET /cgi-bin/printenv HTTP/1.1" 200 849
127.0.0.1 - - [18/Nov/2018:20:27:44 +0100] "GET /favicon.ico HTTP/1.1" 200 790
2.4 httpd-access.log
Nothing
2.2 (a different box) httpd-access.log with a working cgi
my_ip - - [19/Nov/2018:00:57:07 +0100] "GET /cgi-bin/easter HTTP/1.1" 200 1925 "-" "Mozilla/5.0 (X11; FreeBSD amd64; rv:63.0) Gecko/20100101 Firefox/63.0"
my_ip - - [19/Nov/2018:00:57:07 +0100] "GET /favicon.ico HTTP/1.1" 200 791 "-" "Mozilla/5.0 (X11; FreeBSD amd64; rv:63.0) Gecko/20100101 Firefox/63.0"
BTW on all hosts I use:
/usr/local/www/apache22@ -> .
/usr/local/www/apache24@ -> .
To unify paths (but I only run one apache version)
I append httpd.conf, stripped of comment, & trailing local cruft.
----------
ServerRoot "/usr/local"
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 1
MaxSpareServers 1
StartServers 2
MaxClients 20
MaxRequestsPerChild 0
Listen 80
<IfDefine SSL>
Listen 443
</IfDefine>
LoadModule mpm_prefork_module libexec/apache24/mod_mpm_prefork.so
LoadModule authn_file_module libexec/apache24/mod_authn_file.so
LoadModule authn_core_module libexec/apache24/mod_authn_core.so
LoadModule authz_host_module libexec/apache24/mod_authz_host.so
LoadModule authz_groupfile_module libexec/apache24/mod_authz_groupfile.so
LoadModule authz_user_module libexec/apache24/mod_authz_user.so
LoadModule authz_core_module libexec/apache24/mod_authz_core.so
LoadModule access_compat_module libexec/apache24/mod_access_compat.so
LoadModule auth_basic_module libexec/apache24/mod_auth_basic.so
LoadModule reqtimeout_module libexec/apache24/mod_reqtimeout.so
LoadModule filter_module libexec/apache24/mod_filter.so
LoadModule mime_module libexec/apache24/mod_mime.so
LoadModule log_config_module libexec/apache24/mod_log_config.so
LoadModule env_module libexec/apache24/mod_env.so
LoadModule headers_module libexec/apache24/mod_headers.so
LoadModule setenvif_module libexec/apache24/mod_setenvif.so
LoadModule version_module libexec/apache24/mod_version.so
LoadModule unixd_module libexec/apache24/mod_unixd.so
LoadModule status_module libexec/apache24/mod_status.so
LoadModule autoindex_module libexec/apache24/mod_autoindex.so
<IfModule !mpm_prefork_module>
</IfModule>
<IfModule mpm_prefork_module>
</IfModule>
LoadModule dir_module libexec/apache24/mod_dir.so
LoadModule alias_module libexec/apache24/mod_alias.so
IncludeOptional etc/apache24/modules.d/[0-9][0-9][0-9]_*.conf
<IfModule unixd_module>
User www
Group www
</IfModule>
ServerAdmin webmaster at ELIDED
<Directory />
AllowOverride none
Require all denied
Options FollowSymLinks
</Directory>
DocumentRoot "/usr/local/www/data"
<Directory "/usr/local/www/data">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Require all granted
Order allow,deny
Allow from all
</Directory>
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
<Files ".ht*">
Require all denied
</Files>
ErrorLog "/var/log/httpd-error.log"
LogLevel warn
ServerSignature Off
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "/var/log/httpd-access.log" common
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/usr/local/www/cgi-bin/"
Alias /openwebmail/ "/usr/local/www/data/openwebmail/"
</IfModule>
Alias /wiki/ "/usr/local/share/moin/htdocs/"
ScriptAlias /mywiki "/usr/local/www/wiki/moin.cgi"
<Directory "/usr/local/share/moin/htdocs/">
Allow from all
</Directory>
<Directory /usr/local/www/cgi-bin>
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Options None
Require all granted
Order allow,deny
Allow from all
</Directory>
<Directory /usr/local/www/data/openwebmail>
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Options None
</Directory>
ScriptAlias /mailman/ "/usr/local/mailman/cgi-bin/"
Alias /pipermail/ "/usr/local/mailman/archives/public/"
<Directory /usr/local/mailman/cgi-bin>
AllowOverride None
Options None
</Directory>
<IfModule cgid_module>
</IfModule>
<Directory "/usr/local/www/cgi-bin">
AllowOverride None
Options Indexes FollowSymlinks MultiViews
Order allow,deny
Allow from all
</Directory>
<IfModule headers_module>
RequestHeader unset Proxy early
</IfModule>
<IfModule mod_alias>
Alias /icons/ "/usr/local/www/icons/"
<Directory "/usr/local/www/icons">
Options Indexes MultiViews
</Directory>
</IfModule>
<IfModule mod_autoindex>
IndexOptions FancyIndexing
IndexOptions NameWidth=*
IndexOptions VersionSort
ReadmeName README
HeaderName HEADER
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
</IfModule>
<IfModule mod_alias.c>
Alias /manual/ "/usr/local/share/doc/"
</IfModule>
<Directory "/usr/local/share/doc/apache">
Options Indexes FollowSymlinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory /site/home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
AccessFileName .htaccess
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
<IfModule mime_module>
TypesConfig etc/apache24/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
</IfModule>
<IfModule proxy_html_module>
Include etc/apache24/extra/proxy-html.conf
</IfModule>
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Include etc/apache24/Includes/*.conf
HostnameLookups On
----------
Cheers,
Julian
--
Julian Stacey, Computer Consultant, Systems Engineer, BSD Linux Unix, Munich
Brexit referendum #1 stole 3,700,000 Brits votes abroad, inc. 700,000 in EU.
Campaign lies, criminal funded; Markets, jobs & pound hit: New Ref. needed.
http://exitbrexit.uk
More information about the freebsd-apache
mailing list