[TriLUG] ReadmeName

Kipp Spanbauer kippspan at gmail.com
Sat Sep 11 18:49:04 EDT 2004


All:

I am using Fedora Core 2 and Apache 2.0.50/PHP 4.3.4.  Before
upgrading from Red Hat Linux 9, I had in my httpd.conf file:

ReadmeName README.php
HeaderName HEADER.php

I have a README.php file that contains perl which allows a very simple
cgi perl script to upload a file (it's not very exciting, but it
works).

Why does it not work after upgrading to FC2?  

If I rename the file to README.html and adjust the httpd.conf file to
have "ReadmeName README.html", it works fine.

Below is my configure command for however FC2 is compiled with php and
the cgi script that is called by the README.php file for uploading the
file.

Thanks,
Kipp




Configure command:
./configure' '--host=i386-redhat-linux' '--build=i386-redhat-linux'
'--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr'
'--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin'
'--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include'
'--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var'
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--cache-file=../config.cache'
'--with-config-file-path=/etc'
'--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect'
'--disable-debug' '--enable-pic' '--disable-rpath'
'--enable-inline-optimization' '--with-bz2' '--with-db4=/usr'
'--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr'
'--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf'
'--without-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp'
'--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png'
'--with-pspell' '--with-regex=system' '--with-xml'
'--with-expat-dir=/usr' '--with-dom=shared,/usr'
'--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-xmlrpc=shared'
'--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU'
'--enable-bcmath' '--enable-exif' '--enable-ftp'
'--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets'
'--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars'
'--enable-trans-sid' '--enable-yp' '--enable-wddx'
'--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl'
'--with-kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr'
'--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared'
'--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr'
'--enable-memory-limit' '--enable-bcmath' '--enable-shmop'
'--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal'
'--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex'
'--with-apxs2=/usr/sbin/apxs'





File called by README.php:
uploadunsecure.cgi:
#!/usr/bin/perl -w
  use CGI;
  $query = new CGI;
  $dir = $query->param("dir");
$upload_dir = "/var/www/html/" . $dir;

  $filename = $query->param("filename");

  $filename =~ s/.*[\/\\](.*)/$1/;
if ( $filename =~ /index\.[htm|html|php|php3|shtml|phtml|cgi]/ ||
     $filename =~ /page_01.htm/ ) {
    $filename = '_' . $filename;
}

  $upload_filehandle = $query->upload("filename");
  open UPLOADFILE, ">$upload_dir/$filename";
  while ( <$upload_filehandle> )  {    print UPLOADFILE;  }
  close UPLOADFILE;
  print $query->header ( );  print <<START_HTML;
<HTML>
<HEAD>
<title>Tarhell.com</title>
START_HTML

    print '<meta http-equiv="Refresh" content="2;
URL=http://www.tarhell.com/' . $dir . '">';
print <<END_HTML;
</HEAD>
<TITLE>Thanks!</TITLE>
<body bgcolor="#FFFFFF" text="#333333">
<div align="center">
  <p> </p>
  <p><font face="Verdana, Arial, sans-serif" size="2">
        Thank you for submitting the file!
        <br>
        You are being redirected back to the upload directory.
        </p>
        <p>
END_HTML

    print 'If nothing happens, please <a
href="http://www.tarhell.com/' . $dir . '">click here</a>.';
print <<MORE_HTML;
        <p>
        </P>

        </font>
        </p>
</div>

</BODY>
</HTML>
MORE_HTML



More information about the TriLUG mailing list