SPUG: Apache Madness!

Aaron Salo aaron at activox.com
Mon Nov 18 22:11:30 CST 2002


from the command line, you are you.

from the webserver, you are nobody. or www. or some other non-privileged
user that cannot just have its way with a directory called BIN, I hope?

try this, if it doesn't work it will at least tell you why.

my $dir = 'F:/sea124/client/BIN/';
opendir(DIR, "$dir") or die "cannot open dir $dir - $!";
my @list = readdir(DIR) or die "cannot read dir = $!";
closedir(DIR);

foreach(@list) {print qq($_<br>\n);}



At 06:33 PM 11/18/2002 -0800, Brose, Eric wrote:
>Hello,
>
>I'm trying to retrieve the contents of a directory and display them to a
web page.
>
>I'm using windows 2000 with apache installed.  The directory I'm accessing
also happens to be across a mapped drive.  When I run the script from the
command line, all looks well, but the web server does not display my data!
I've played with this quite a lot with no luck.
>-----------------------------------------------------------
>This is a tiny script:
>#!c:/perl/bin/perl
>
>use strict;
>use CGI ':standard';
>print header();
>
>my $where;
>my @files;
>
>print "<b>fick</b>\n\n";
>while ($where = <F:/sea124/client/BIN/*.cfg>) {
>	push @files,$where;
>	}
>
>for (@files){
>print "$_<br>\n";
>}
>-----------------------------------------------------------
>
>
>Here's the command line output:
>C:\Program Files\Apache Group\Apache\cgi-bin\req>perl distribute.pl
>Content-Type: text/html; charset=ISO-8859-1
>
><b>fick</b>
>
>F:/sea124/client/BIN/cesiebel.cfg<br>
>F:/sea124/client/BIN/emailresp.cfg<br>
>F:/sea124/client/BIN/iloptcfg.cfg<br>
>F:/sea124/client/BIN/iss.cfg<br>
>F:/sea124/client/BIN/market.cfg<br>
>F:/sea124/client/BIN/pimmap.cfg<br>
>F:/sea124/client/BIN/pimsync.cfg<br>
>F:/sea124/client/BIN/scomm.cfg<br>
>
>----------------------------------------------------------------------------
>Here's the source from the web page:
>
><b>fick</b>
>
>--------------------------------------------------------------
>Why it no LIKE this?!!
>
>
>Thanks
>
>
>Eric Brose
>
>
>
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
>      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
>  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
> For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
>     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org
>


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org




More information about the spug-list mailing list