t*****t 发帖数: 72 | 1 有如下一段cgi程序:
################################
#!/usr/bin/perl -wT
use strict;
use CGI;
my $q = new CGI;
my $remote_addr = $q->remote_addr;
print $q->header(),$q->start_html("test");
print "IP:$remote_addr\n";
print $q->end_html;
open (RECORD,">> /home/www/cgi-bin/log.txt") or die "can't open file:$!";
print RECORD "IP:$remote_addr\n";
close(RECORD);
##################################################################
从www浏览器上直接运行这个.cgi文件(http://address/cgi-bin/a.cgi)
,可以在网页上显示结果,但是无法生成 log.txt 文件,把 | M******t 发帖数: 309 | 2 create the log file and make it world writable...
Consult your System Admin, ask if they can provide a secured
solution other than this. for example adding Apache user nobody into some gr
oup...
【在 t*****t 的大作中提到】 : 有如下一段cgi程序: : ################################ : #!/usr/bin/perl -wT : use strict; : use CGI; : my $q = new CGI; : my $remote_addr = $q->remote_addr; : print $q->header(),$q->start_html("test"); : print "IP:$remote_addr\n"; : print $q->end_html;
| t*****t 发帖数: 72 | 3 thanks, the first one works. BTW. if I have the root of the server
how I can change the apache configuration file. Or is there any
webpages that can point me to the solution. Many thanks..
【在 M******t 的大作中提到】 : create the log file and make it world writable... : Consult your System Admin, ask if they can provide a secured : solution other than this. for example adding Apache user nobody into some gr : oup...
|
|