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$P(Bserver$B$N4IM}
$B0J2<$N%I%-%e%a%s%H$r;29M$K$7$^$7$?!#(B
http://andro.sfc.keio.ac.jp/cgi-bin/date
$B$3$l$O8=:_$N(Bandro.sfc.keio.ac.jp$B$H$$$&(Bserver$B$N;~4V$G$"$k!#(B
server$BB&$G(Bdate$B$r
shell script$B$NCf?H$O!"$h$&$9$k$K8+$F$o$+$k$H$*$j!"I8=`=PNO$K(B
$B$@$7$?$b$N$,(Bhtml$B$N%U%!%$%k$H$7$F=hM}$5$l$F!"(BMosaic$B$N2hLL$K$G(B
$B$F$/$k!#(B
$B$$$/$D$+Cm0U!#(B
$B$3$N(B2$B9T$rK:$l$F$O$J$i$J$$!#$3$l$rK:$l$k$H!"$G$F$3$J$$!#(B
$B$^$?!"(Bserver$BB&$G(Bscript$B$,L58B%k!<%W$K$O$$$k$H!"(Bclient$B$O%"%/%;(B
$B%9$7$?>uBV$G$H$^$C$F$7$^$&!#(B
$B$3$N(Bdate$B$H$$$&(Bscript$B$O!"(BNCSA httpd$B$K$D$$$F$-$?$b$N$G$"$k!#(B
/usr/local/etc/httpd/cgi-bin$B$H$$$&$N$,(Bdefault$B$N(Bcgi script$B$N(B
$BCV$+$l$k$H$3$m$G$"$k!#(B
$B$b$7$"$J$?$,(Bserver$B$N4IM}
$B$H!"
cgi-bin$B$K$D$$$F$O!"@_Dj%U%!%$%k(B
$B$GJQ$($i$l$k!#(B
$B$3$3$rJQ99$9$l$P(Bscript$B$NCV$->l=j$r<+M3$K7hDj$G$-$k!#$b$A$m$s!"(B
$B$3$N(Bdirectory$B0J30$N$H$3$m$K$*$$$F$"$k(Bscript$B$O
$B$3$l$G(Bserver$BB&$G$N(Bscript$B
$BKM$N(Badd-name.html$B$r%5%s%W%k$H$7$F8+$F$_$h$&!#(B
$BM>J,$J$H$3$m$O:o$C$F$"$k!#$=$l$>$l$N9`L\$r4JC1$K2r@b$9$k!#(B
$B$^$:(BFORM$B$H$$$&%?%0$G!"$"$kItJ,$r0O$`$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$:!"(B&$B$G6h@Z$k!#(B
= $B$G6h@Z$C$F!"(B
+ $B$r(B ' ' $B$KJQ49!#(B
%?? $B$r85$NJ8;zNs$KJQ49!#(B
cgi_tags $B$KO"A[G[Ns$N7A$G$$$l$F!"(Breturn$B!#(B
$B$3$3$G!"(B& < >$B$r
$B$@$$$?$$$3$N$/$i$$$o$+$l$P<+J,$G$b(BCGI$B$H(BFORM$B$N5!G=$rMxMQ$7$?(B
$B%Z!<%8$r:n$l$k$N$G$O$J$$$+$H;W$&!#F|K\$N(BWWW$B$G$b!"$3$l$i$N5!(B
$BG=$rMxMQ$7$?%Z!<%8$,A}$($k$H$&$l$7$$!#(B
$B:G8e$K!"$3$N%I%-%e%a%s%H$rFI$s$@?M$O!"$<$R(B$B$3$3(B$B$r%"%/%;%9$7$F!"KM$NK,Ld
$B$=$l$G$O!"(BHave a Happy Networking!
history:
==> /usr/local/etc/httpd/cgi-bin/date <==
#!/bin/sh
DATE=`which date`
echo Content-type: text/plain
echo
if [ -x $DATE ]; then
$DATE
else
echo Cannot find date command on this system.
fi
==> end <==
echo Content-type: text/plain
echo
http://$B$"$J$?$N(Bserver$BL>(B/cgi-bin/date
/usr/local/etc/httpd/conf/srm.conf
# ScriptAlias: This controls which directories contain server scripts.
# Format: ScriptAlias fakename realname
ScriptAlias /cgi-bin/ /usr/local/etc/httpd/cgi-bin/
FORM$B$N4JC1$J;H$$J}(B
Mosaic$B$N(Bver.1.0$B$N$3$m$O!"(BISINDEX$B$H$7$F
=== add-name.html ===
<FORM METHOD="POST" ACTION="/cgi-bin/add-name">
Please add your name to my visited person list.<P>
Please input your name: <INPUT NAME="name" SIZE=30> <P>
Please input your mail address: <INPUT NAME="address" SIZE=40> <P>
Please input your home page URL: <INPUT NAME="url" SIZE=40> <P>
If you don't have your home page, please keep it brank.<P>
After input these field, press this button:
<INPUT TYPE="submit" VALUE="ADD"> <P>
</FORM>
<FORM METHOD="POST" ACTION="/cgi-bin/add-name">
$B$h$C$F!"(BGET$B$OAw$l$k>pJs$NNL$K8B$j$,$"$k$,!"(BPOST$B$K$O$J$$!#$H(B
$B$$$&$3$H$G!"4pK\E*$K(BPOST$B$r;H$($P$$$$$h$&$@!#(B
<INPUT TYPE="submit" VALUE="ADD">
FORM+CGI$B$N4JC1$J;H$$J}(B
ISINDEX$B$N$3$m$N>pJs$NAw$i$l$k7A<0$O!"(B
http://andro.sfc.keio.ac.jp/cgi-bin/finger?eto
name=ETO+Kouichirou&[email protected]&url=http%3a%2f%2fandro.sfc.keio.ac.jp%2feto%2f
$BD9$5$,(BCONTENT_LENGTH$B$H$$$&4D6-JQ?t$GEO$5$l$k$N$G!"(BPOST$B$N>l9g!"(B
$B$=$ND9$5$N$V$s$@$1FI$_$H$k$h$&$K$9$k!#(Bshell$B$G!"(B
cat > $tmp
Content-type: text/html
&cgi'decode;
if ($ENV{'REQUEST_METHOD'} eq "POST"){
$n_read = sysread(STDIN, $args, $ENV{'CONTENT_LENGTH'});
} else {
$args = $ENV{'QUERY_STRING'};
}
@terms = split('&', $args);
foreach (@terms) {
($tag, $value) = split(/=/, $_, 2);
$value =~ s/\+/ /g;
$value =~ s/%(..)/pack("c", hex($1))/ge;
$tags{$tag} = $value; # tags is global
$cont = $cgi_tags{$tag};
$cont =~ s/&/&/g;
$cont =~ s/</</g;
$cont =~ s/>/>/g;
Date: 94/07/26
Please E-mail comments and questions to
ETO Kouichirou <[email protected]>