You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by David Christensen <dp...@holgerdanske.com> on 2003/10/13 06:47:57 UTC

[users@httpd] CGI script runs under http, but browser tries to download under https

users@httpd.apache.org:

The CGI script run vs. download problem is back again.  I am using
Apache 1.3.26 on a local Debian 3.0r1 stable server to do HTML,
Perl/CGI, and MySQL development.


If I use Mozilla 1.4.1 Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
rv:1.4.1) Gecko/20031008 with caching disabled (0 MB cache, compare page
to cache every time I view the page) and browse to:

    http://192.168.254.2/~ramdra3/

which is a frame containing a call to a CGI script, the browser displays
the output of the CGI script.


If I change "http" to "https" and browse to:

    https://192.168.254.2/~ramdra3/

The browser wants to download the source code of the CGI script.


The same thing happens with IE 6.0.2800.1106.


The same thing happens with GNU Wget 1.8.2.


Various details follow.  Please provide incantations if you need to see
more.


Any suggestions?


TIA,

David
--



root@d3020g:~# apache -V
Server version: Apache/1.3.26 (Unix) Debian GNU/Linux
Server built:   Oct 26 2002 09:15:15
Server's Module Magic Number: 19990320:13
Server compiled with....
 -D EAPI
 -D HAVE_MMAP
 -D HAVE_SHMGET
 -D USE_SHMGET_SCOREBOARD
 -D USE_MMAP_FILES
 -D HAVE_FCNTL_SERIALIZED_ACCEPT
 -D HAVE_SYSVSEM_SERIALIZED_ACCEPT
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D HTTPD_ROOT="/usr"
 -D SUEXEC_BIN="/usr/lib/apache/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache.pid"
 -D DEFAULT_SCOREBOARD="/var/run/apache.scoreboard"
 -D DEFAULT_LOCKFILE="/var/run/apache.lock"
 -D DEFAULT_ERRORLOG="/var/log/apache/error.log"
 -D TYPES_CONFIG_FILE="/etc/mime.types"
 -D SERVER_CONFIG_FILE="/etc/apache/httpd.conf"
 -D ACCESS_CONFIG_FILE="/etc/apache/access.conf"
 -D RESOURCE_CONFIG_FILE="/etc/apache/srm.conf"



root@d3020g:~# cat /etc/apache/httpd.conf | grep -v '^[ ]*#' | grep -v
'^$'
ServerType standalone
ServerRoot /etc/apache
LockFile /var/lock/apache.lock
PidFile /var/run/apache.pid
ScoreBoardFile /var/run/apache.scoreboard
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
MaxRequestsPerChild 100
LoadModule config_log_module /usr/lib/apache/1.3/mod_log_config.so
LoadModule mime_magic_module /usr/lib/apache/1.3/mod_mime_magic.so
LoadModule mime_module /usr/lib/apache/1.3/mod_mime.so
LoadModule negotiation_module /usr/lib/apache/1.3/mod_negotiation.so
LoadModule status_module /usr/lib/apache/1.3/mod_status.so
LoadModule includes_module /usr/lib/apache/1.3/mod_include.so
LoadModule autoindex_module /usr/lib/apache/1.3/mod_autoindex.so
LoadModule dir_module /usr/lib/apache/1.3/mod_dir.so
LoadModule cgi_module /usr/lib/apache/1.3/mod_cgi.so
LoadModule userdir_module /usr/lib/apache/1.3/mod_userdir.so
LoadModule alias_module /usr/lib/apache/1.3/mod_alias.so
LoadModule rewrite_module /usr/lib/apache/1.3/mod_rewrite.so
LoadModule access_module /usr/lib/apache/1.3/mod_access.so
LoadModule auth_module /usr/lib/apache/1.3/mod_auth.so
LoadModule expires_module /usr/lib/apache/1.3/mod_expires.so
LoadModule unique_id_module /usr/lib/apache/1.3/mod_unique_id.so
LoadModule setenvif_module /usr/lib/apache/1.3/mod_setenvif.so
ExtendedStatus On
Port 80
User www-data
Group www-data
ServerAdmin webmaster@d3020g
ServerName 192.168.254.2
DocumentRoot /var/www
<Directory />
    Options SymLinksIfOwnerMatch
    AllowOverride None
</Directory>
<Directory /var/www/>
    Options Indexes Includes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
<IfModule mod_userdir.c>
    UserDir public_html
</IfModule>
<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>
    <Limit PUT DELETE PATCH PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
        Order deny,allow
        Deny from all
    </Limit>
</Directory>
<Directory /home/*/public_html/cgi-bin>
    Options ExecCGI
</Directory>
<IfModule mod_dir.c>
    DirectoryIndex index.html index.htm index.shtml index.cgi
</IfModule>
AccessFileName .htaccess
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>
UseCanonicalName On
TypesConfig /etc/mime.types
DefaultType text/plain
<IfModule mod_mime_magic.c>
    MIMEMagicFile share/magic
</IfModule>
HostnameLookups Off
ErrorLog /var/log/apache/error.log
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"
%T %v" full
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"
%P %T" debug
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog /var/log/apache/access.log combined
ServerSignature On
Alias /icons/ /usr/share/apache/icons/
<Directory /usr/share/apache/icons>
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory /usr/lib/cgi-bin/>
    AllowOverride None
    Options ExecCGI
    Order allow,deny
    Allow from all
</Directory>
<IfModule mod_autoindex.c>
    IndexOptions FancyIndexing NameWidth=*
    AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
    AddIconByType (TXT,/icons/text.gif) text/*
    AddIconByType (IMG,/icons/image2.gif) image/*
    AddIconByType (SND,/icons/sound2.gif) audio/*
    AddIconByType (VID,/icons/movie.gif) video/*
    AddIcon /icons/binary.gif .bin .exe
    AddIcon /icons/binhex.gif .hqx
    AddIcon /icons/tar.gif .tar
    AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
    AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
    AddIcon /icons/a.gif .ps .ai .eps
    AddIcon /icons/layout.gif .html .shtml .htm .pdf
    AddIcon /icons/text.gif .txt
    AddIcon /icons/c.gif .c
    AddIcon /icons/p.gif .pl .py
    AddIcon /icons/f.gif .for
    AddIcon /icons/dvi.gif .dvi
    AddIcon /icons/uuencoded.gif .uu
    AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
    AddIcon /icons/tex.gif .tex
    AddIcon /icons/bomb.gif core
    AddIcon /icons/deb.gif .deb
    AddIcon /icons/back.gif ..
    AddIcon /icons/hand.right.gif README
    AddIcon /icons/folder.gif ^^DIRECTORY^^
    AddIcon /icons/blank.gif ^^BLANKICON^^
    DefaultIcon /icons/unknown.gif
    ReadmeName README
    HeaderName HEADER
    IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
</IfModule>
<IfModule mod_mime.c>
    AddEncoding x-compress Z
    AddEncoding x-gzip gz tgz
    AddLanguage da .dk
    AddLanguage nl .nl
    AddLanguage en .en
    AddLanguage et .ee
    AddLanguage fr .fr
    AddLanguage de .de
    AddLanguage el .el
    AddLanguage it .it
    AddLanguage ja .ja
    AddCharset ISO-2022-JP .jis
    AddLanguage pl .po
    AddCharset ISO-8859-2 .iso-pl
    AddLanguage pt .pt
    AddLanguage pt-br .pt-br
    AddLanguage ltz .lu
    AddLanguage ca .ca
    AddLanguage es .es
    AddLanguage sv .se
    AddLanguage cz .cz
    <IfModule mod_negotiation.c>
        LanguagePriority en da nl et fr de el it ja pl pt pt-br ltz ca
es sv
    </IfModule>
    AddType application/x-tar .tgz
    AddType image/bmp .bmp
    AddType text/x-hdml .hdml
    AddHandler cgi-script pl
    AddType text/html .shtml
    AddHandler server-parsed .shtml
</IfModule>
AddDefaultCharset on
<IfModule mod_setenvif.c>
    BrowserMatch "Mozilla/2" nokeepalive
    BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0
force-response-1.0
    BrowserMatch "RealPlayer 4\.0" force-response-1.0
    BrowserMatch "Java/1\.0" force-response-1.0
    BrowserMatch "JDK/1\.0" force-response-1.0
</IfModule>
<IfModule mod_perl.c>
  Alias /perl/ /var/www/perl/
  <Location /perl>
    SetHandler perl-script
    PerlHandler Apache::Registry
    Options +ExecCGI
  </Location>
</IfModule>
Alias /doc/ /usr/share/doc/
<Location /doc>
  order deny,allow
  deny from all
  allow from 127.0.0.0/255.0.0.0
  Options Indexes FollowSymLinks MultiViews
</Location>
<IfModule mod_proxy.c>
</IfModule>
NameVirtualHost *
<VirtualHost *>
    DocumentRoot /var/www/
    ServerName 192.168.254.2
</VirtualHost>
<VirtualHost *>
    DocumentRoot /home/ramdra3/public_html/
    ServerName www.ramdragon.com
    ScriptAlias /cgi-bin/ /home/ramdra3/public_html/cgi-bin/
</VirtualHost>



ramdra3@d3020g:~$ ll public_html/
total 24
drwxr-xr-x    5 ramdra3  ramdra3      4096 Oct 12 20:46 ./
drwxr-xr-x   13 ramdra3  ramdra3      4096 Oct  9 22:46 ../
drwxr-xr-x    2 ramdra3  ramdra3      4096 Oct  8 22:14 CVS/
drwxr-xr-x    4 ramdra3  ramdra3      4096 Oct  8 22:51 cgi-bin/
drwxr-xr-x    3 ramdra3  ramdra3      4096 Oct  8 22:14 images/
-rwxr-xr-x    1 ramdra3  ramdra3       476 Oct  9 22:40 index.html*



ramdra3@d3020g:~$ cat public_html/index.html
<!-- $Id: index.html,v 1.1 2003/10/09 05:47:12 ramdra3 Exp $ -->
<html>
  <head>
    <title>
      RamDragon.com
    </title>
    <script>
      <!--
        if(top!=self)
        top.location.href=self.location.href;
      //--->
    </script>
  </head>
  <frameset rows="100%,*" frameborder=no border=0 framespacing=0>
    <frame src="cgi-bin/ramdragon.pl" marginwidth=0 marginheight=0 >
  </frameset>
  <noframes>
    Please use a browser that supports frames.
  </noframes>
</html>



ramdra3@d3020g:~$ ll public_html/cgi-bin/
total 24
drwxr-xr-x    4 ramdra3  ramdra3      4096 Oct  8 22:51 ./
drwxr-xr-x    5 ramdra3  ramdra3      4096 Oct 12 20:46 ../
drwxr-xr-x    2 ramdra3  ramdra3      4096 Oct  8 22:14 CVS/
-rwxr-xr-x    1 ramdra3  ramdra3       107 Oct  8 22:37 hello.pl*
drwxr-xr-x    3 ramdra3  ramdra3      4096 Oct  8 22:51 images/
-rwxr-xr-x    1 ramdra3  ramdra3       244 Oct  9 22:40 ramdragon.pl*



ramdra3@d3020g:~$ cat public_html/cgi-bin/ramdragon.pl
#! /usr/bin/perl
# $Id: ramdragon.pl,v 1.1 2003/10/09 05:48:15 ramdra3 Exp $
use warnings;
use strict;
BEGIN {
    $ENV{HOME} = "/home/ramdra3";
    unshift @INC, "$ENV{HOME}/lib/perl";
}
use RamDragon;
my $app = RamDragon->new();
$app->run();


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org