[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[users@httpd] Server port/signature is incorrect in directory index listing

When I set HeaderName or ReadmeName (directives from mod_autoindex,
see [1]) to a SSI-enabled HTML file or a CGI program and then try to
display the server signature, the port number shown is incorrect
(always port 80).

If either the SSI file or the CGI program is retrieved separately,
they print this:

  SERVER_PORT      = 4567
  SERVER_SIGNATURE = <address>Apache/2.4.34 (Unix) PHP/7.2.9 Server at
localhost Port 4567</address>

But if their output is rendered with HeaderName or ReadmeName in a
directory listing, then it prints this:

  SERVER_PORT      = 80
  SERVER_SIGNATURE = <address>Apache/2.4.34 (Unix) PHP/7.2.9 Server at
localhost Port 80</address>

Note the different port numbers. I was expecting the same output. Can
anyone reproduce this behaviour? Would you confirm it's a bug?

[1] http://httpd.apache.org/docs/2.4/mod/mod_autoindex.html#headername

The files I used to test are these:

==> .htaccess <==

Options +ExecCGI

AddHandler cgi-script .cgi
AddType text/html .cgi

# Either one of the lines:
ReadmeName server-port.cgi
ReadmeName server-port.shtml

==> server-port.cgi <==


echo -en 'Content-Type: text/plain\n\n'


==> server-port.shtml <==

SERVER_PORT      = <!--#echo var="SERVER_PORT"-->

To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx