From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <015d01c22ed3$fcc596e0$6501a8c0@KIKE> From: "matt" To: <9fans@cse.psu.edu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_015A_01C22EDC.5D6BE4B0" Subject: [9fans] httpd utilities / scripts Date: Fri, 19 Jul 2002 04:25:51 +0100 Topicbox-Message-UUID: d1bbe802-eaca-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. ------=_NextPart_000_015A_01C22EDC.5D6BE4B0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit I've been playing with httpd this evening and done what I think is a useful script. What it does is take the command line options and HTTP headers and put them all in environment variables. I did this to facilitate shell scripted web pages. It works by adding : rfork E /bin/ip/httpd/populate_environment.rc $* to the top of any web serving scripts and then the HTTP Headers etc. can be accessed through /env the example script uses html_encode.sed, which is a very low quality cut and pasted html entity encoder (supplied) I'm also including url_encode.awk which is nothing to do with this but useful all the same For as long as I am on this IP address you can see it in action at http://pc1-nott2-3-cust35.not.cable.ntl.com/magic/http_info.rc suggestions / criticisms welcome Matt ------=_NextPart_000_015A_01C22EDC.5D6BE4B0 Content-Type: multipart/mixed; boundary="upas-hfrzxfyxbvubwzdqnztdapxqaa" Content-Disposition: inline This is a multi-part message in MIME format. --upas-hfrzxfyxbvubwzdqnztdapxqaa Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit The following attachment had content that we can't prove to be harmless. To avoid possible automatic execution, we changed the content headers. The original header was: Content-Type: application/octet-stream; name="html_encode.sed" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="html_encode.sed" --upas-hfrzxfyxbvubwzdqnztdapxqaa Content-Type: application/octet-stream Content-Disposition: attachment; filename="html_encode.sed.suspect" Content-Transfer-Encoding: quoted-printable s/&/&/g=0A= s/"/"/g=0A= s//\>/g=0A= s/=E2=80=9E/\ä/g=0A= s/=C5=BD/\Ä/g=0A= s/=E2=80=9D/\ö/g=0A= s/=E2=84=A2/\Ö/g=0A= s/=C2=81/\ü/g=0A= s/=C5=A1/\Ü/g=0A= s/=C3=A1/\ß/g=0A= --upas-hfrzxfyxbvubwzdqnztdapxqaa-- ------=_NextPart_000_015A_01C22EDC.5D6BE4B0 Content-Type: application/octet-stream; name="http_info.rc" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="http_info.rc" #!/bin/rc=0A= # this is a demo of populate_environment.rc=0A= # both files need to go in wherever your httpd/magic directory is=0A= #=0A= # DEPENDENCY : to make the output nicer I've used html_encode.sed=0A= # which is a pretty lame sed script for turning ascii into html entities=0A= # binary data still gets through, it only subs about 6 elements, I need = a better one=0A= # You can happily remove it, just watch out for a < in your POST requests=0A= #=0A= # matt@proweb.co.uk 19 July 2002=0A= =0A= # IMPORTANT, without the rfork the environment would be shared by all = httpd threads=0A= # if that ruins your day you need to need to do some proper programming=0A= =0A= echo HTTP/1.1 200 FOUND=0A= echo Date: `{date}=0A= echo Server: plan9=0A= echo Content-Type: text/html=0A= echo =0A= =0A= rfork E=0A= /bin/ip/httpd/populate_environment.rc $*=0A= # that's it=0A= # the rest of this code just outputs an example=0A= =0A= echo 'EnviroThe environment variables set by = this request :'=0A= for (e in `{ls /env/HTTP_*}) {=0A= echo -n ''=0A= }=0A= echo '
' $e ''=0A= cat $e | sed -f /bin/ip/httpd/html_encode.sed | awk ' { print $0 = "
\n" } '=0A= echo '
'=0A= =0A= ------=_NextPart_000_015A_01C22EDC.5D6BE4B0 Content-Type: application/octet-stream; name="populate_environment.rc" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="populate_environment.rc" #!/bin/rc=0A= =0A= # this script loads the environment with the parameters of the HTTP = request=0A= # to facilitate shell scripted web serving=0A= # matt@proweb.co.uk 19 July 2002=0A= #=0A= while(~ $1 -*) {=0A= switch($1) {=0A= case -d=0A= shift=0A= echo $1 > /env/HTTP_Domain=0A= case -w=0A= shift=0A= echo $1 > /env/HTTP_Document_Root=0A= case -r=0A= shift=0A= echo $1> /env/HTTP_Remote_IP=0A= case -N=0A= shift=0A= echo $1 > /env/HTTP_Netdir=0A= case -b=0A= shift=0A= echo $1 | sed 's/^r //' > /env/HTTP_Raw=0A= case -R=0A= shift=0A= echo $1 | awk '{print $1}' > /env/HTTP_Method=0A= echo $1 | awk '{print $2}' > /env/HTTP_Query_String=0A= echo $1 | awk '{print $3}' > /env/HTTP_Version=0A= }=0A= shift=0A= }=0A= =0A= eval `{awk '=0A= BEGIN { =0A= body=3D0;=0A= }=0A= =0A= { =0A= i =3D index($0, ": ");=0A= if (i > 0) {=0A= env =3D substr($0, 1, i-1);=0A= val =3D substr($0, i+2);=0A= val =3D substr(val, 1, length(val) -1);=0A= gsub("''", "''''", val);=0A= printf("echo ''%s'' > /env/HTTP_%s;", val , env);=0A= } else {=0A= exit=0A= }=0A= =0A= }=0A= =0A= ' /env/HTTP_Raw}=0A= =0A= ------=_NextPart_000_015A_01C22EDC.5D6BE4B0 Content-Type: application/octet-stream; name="url_encode.awk" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="url_encode.awk" BEGIN {=0A= # We assume an awk implementation that is just plain dumb.=0A= # We will convert an character to its ASCII value with the=0A= # table ord[], and produce two-digit hexadecimal output=0A= # without the printf("%02X") feature.=0A= =0A= urlencode_EOL =3D "%0A" # "end of line" string (encoded)=0A= split ("1 2 3 4 5 6 7 8 9 A B C D E F", urlencode_hextab, " ")=0A= urlencode_hextab [0] =3D 0=0A= for ( urlencode_i=3D1; urlencode_i<=3D255; ++urlencode_i ) ord [ = sprintf ("%c", urlencode_i) "" ] =3Durlencode_i + 0=0A= urlencode_EncodeEOL =3D 1=0A= urlencode_encoded_line =3D ""=0A= }=0A= =0A= function url_encode_string(s) {=0A= encoded_string =3D ""=0A= for ( i=3D1; i<=3Dlength (s); ++i ) {=0A= encoded_string =3D encoded_string url_encode_char(substr ($0, i, 1))=0A= }=0A= return encoded_string=0A= }=0A= =0A= function url_encode_char(c) {=0A= if ( c ~ /[a-zA-Z0-9.-]/ ) { # safe character=0A= return c=0A= }=0A= if ( c =3D=3D " " ) {=0A= return "+" # special handling=0A= }=0A= # unsafe character, encode it as a two-digit hex-number=0A= lo =3D ord [c] % 16=0A= hi =3D int (ord [c] / 16);=0A= return "%" urlencode_hextab [hi] urlencode_hextab [lo]=0A= }=0A= =0A= {=0A= print url_encode_string($0)=0A= } ------=_NextPart_000_015A_01C22EDC.5D6BE4B0-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <017401c22ed5$e4bd05e0$6501a8c0@KIKE> From: "matt" To: <9fans@cse.psu.edu> References: <015d01c22ed3$fcc596e0$6501a8c0@KIKE> Subject: Re: [9fans] httpd utilities / scripts MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Date: Fri, 19 Jul 2002 04:39:30 +0100 Topicbox-Message-UUID: d1c23ad6-eaca-11e9-9e20-41e7f4b1d025 :) I was just lying in bed and remembered that there's an eval in that script which I was going to take out once the code was working tomorrow m From mboxrd@z Thu Jan 1 00:00:00 1970 From: "William S." To: 9fans@cse.psu.edu Subject: Re: [9fans] httpd utilities / scripts Message-ID: <20020719074253.GB51270@xs4all.nl> References: <015d01c22ed3$fcc596e0$6501a8c0@KIKE> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <015d01c22ed3$fcc596e0$6501a8c0@KIKE> User-Agent: Mutt/1.4i Date: Fri, 19 Jul 2002 09:42:53 +0200 Topicbox-Message-UUID: d1f149c0-eaca-11e9-9e20-41e7f4b1d025 Is httpd ported to Plan9? Is that what you are using? Just curious. Right now I have been doing things with php under Slackware but would prefer Plan9. On Fri, Jul 19, 2002 at 04:25:51AM +0100, matt wrote: > I've been playing with httpd this evening and done what I think is a useful > script. > -- Bill Amsterdam, NL From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <019401c22f04$eb570ac0$6501a8c0@KIKE> From: "matt" To: <9fans@cse.psu.edu> References: <015d01c22ed3$fcc596e0$6501a8c0@KIKE> <20020719074253.GB51270@xs4all.nl> Subject: Re: [9fans] httpd utilities / scripts MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Date: Fri, 19 Jul 2002 10:16:07 +0100 Topicbox-Message-UUID: d21050e0-eaca-11e9-9e20-41e7f4b1d025 > Is httpd ported to Plan9? Is that what you are using? > Just curious. Right now I have been doing things with > php under Slackware but would prefer Plan9. no, ip/httpd is it's own thing not Apache, no PHP here man 8 httpd or http://plan9.bell-labs.com/magic/man2html/8/httpd From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: text/plain MIME-Version: 1.0 (NeXT Mail 3.3ciscupdate v148.2.1) From: arisawa@ar.aichi-u.ac.jp To: 9fans@cse.psu.edu Subject: Re: [9fans] httpd utilities / scripts References: <015d01c22ed3$fcc596e0$6501a8c0@KIKE> <20020719074253.GB51270@xs4all.nl> <019401c22f04$eb570ac0$6501a8c0@KIKE> Message-Id: <20020719094233.A6DFC1998C@mail.cse.psu.edu> Date: Fri, 19 Jul 2002 18:42:25 +0900 Topicbox-Message-UUID: d20a73c8-eaca-11e9-9e20-41e7f4b1d025 >> Is httpd ported to Plan9? Is that what you are using? >> Just curious. Right now I have been doing things with >> php under Slackware but would prefer Plan9. > >no, ip/httpd is it's own thing not Apache, no PHP here >man 8 httpd >or >http://plan9.bell-labs.com/magic/man2html/8/httpd You have another option: Look http://plan9.aichi-u.ac.jp/pegasus/eman-1.0/ I am afraid that document is poor. Writing English is hard work for me. To download: http://plan9.aichi-u.ac.jp/netlib/ From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <002e01c22f43$122a6dc0$0100a8c0@335400> From: To: <9fans@cse.psu.edu> References: <015d01c22ed3$fcc596e0$6501a8c0@KIKE> <017401c22ed5$e4bd05e0$6501a8c0@KIKE> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Subject: [9fans] UTF-8 support with Mothra Date: Fri, 19 Jul 2002 18:41:01 +0200 Topicbox-Message-UUID: d24270de-eaca-11e9-9e20-41e7f4b1d025 Will mothra support UTF-8 soon ? From mboxrd@z Thu Jan 1 00:00:00 1970 From: "William S." To: 9fans@cse.psu.edu Subject: Re: [9fans] httpd utilities / scripts Message-ID: <20020719170821.GA72996@xs4all.nl> References: <015d01c22ed3$fcc596e0$6501a8c0@KIKE> <20020719074253.GB51270@xs4all.nl> <019401c22f04$eb570ac0$6501a8c0@KIKE> <20020719094233.A6DFC1998C@mail.cse.psu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020719094233.A6DFC1998C@mail.cse.psu.edu> User-Agent: Mutt/1.4i Date: Fri, 19 Jul 2002 19:08:21 +0200 Topicbox-Message-UUID: d2c02146-eaca-11e9-9e20-41e7f4b1d025 Your English looks and reads clear to me. Nice job setting it up. It will take me a while to take it all in. My reason for using php and Sablotron is to present web pages dynamically and keep content (XML) separate from style (XSL). Here is a link to a web site I have set up to experiment and learn with. Sorry that this does not directly pertain to Plan9 now but as I said, if I can find a way to accomplish the same thing with Plan9 I will give it a go. http://213.84.71.105/ On Fri, Jul 19, 2002 at 06:42:25PM +0900, arisawa@ar.aichi-u.ac.jp wrote: > >> Is httpd ported to Plan9? Is that what you are using? > >> Just curious. Right now I have been doing things with > >> php under Slackware but would prefer Plan9. > > > >no, ip/httpd is it's own thing not Apache, no PHP here > >man 8 httpd > >or > >http://plan9.bell-labs.com/magic/man2html/8/httpd > > You have another option: > Look http://plan9.aichi-u.ac.jp/pegasus/eman-1.0/ > I am afraid that document is poor. > Writing English is hard work for me. > > To download: http://plan9.aichi-u.ac.jp/netlib/ -- Bill Amsterdam, NL From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Howard Trickey" To: <9fans@cse.psu.edu> Message-ID: <004201c22f4b$6b5aca40$bf356887@bl.belllabs.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit In-Reply-To: <002e01c22f43$122a6dc0$0100a8c0@335400> Subject: [9fans] The "i" browser Date: Fri, 19 Jul 2002 13:40:48 -0400 Topicbox-Message-UUID: d2c69940-eaca-11e9-9e20-41e7f4b1d025 I did a port of the inferno browser (charon) to plan 9, and called it "i". Unfortunately, other obligations have prevented me from getting all of the bugs out. Does anyone out there want to take up the guantlet and finish the job? I put the sources in the public source tree, under contrib/i , and would be happy to correspond with, and lightly collaborate with, anyone willing to solidify the port. The current state is that it often works, but there is some kind of bug in the table layout code (and doubtless, other bugs). And perhaps the biggest problem, for a modern browser, is that it doesn't do javascript at all. The port was done before Javascript support got added to charon. - Howard Trickey howard@research.bell-labs.com From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu From: Ben Message-ID: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit References: <002e01c22f43$122a6dc0$0100a8c0@335400>, <004201c22f4b$6b5aca40$bf356887@bl.belllabs.com> Subject: Re: [9fans] The "i" browser Date: Mon, 29 Jul 2002 16:00:56 +0000 Topicbox-Message-UUID: d5201bf8-eaca-11e9-9e20-41e7f4b1d025 howard@research.bell-labs.com (Howard Trickey) wrote in message news:<004201c22f4b$6b5aca40$bf356887@bl.belllabs.com>... > I did a port of the inferno browser (charon) to > plan 9, and called it "i". Unfortunately, other > obligations have prevented me from getting all > of the bugs out. > > Does anyone out there want to take up the guantlet > and finish the job? I put the sources in > the public source tree, under contrib/i , and > would be happy to correspond with, and lightly > collaborate with, anyone willing to solidify the port. > > The current state is that it often works, but > there is some kind of bug in the table layout code > (and doubtless, other bugs). And perhaps the biggest > problem, for a modern browser, is that it doesn't > do javascript at all. The port was done before > Javascript support got added to charon. > > - Howard Trickey > howard@research.bell-labs.com I'm very interested. I've you've read any of my other posts, you'll have noticed that I'm looking for a good browser under Plan 9. Unfortunately, I can't access the public source tree, as I can't dial out (for now). (Any latest development on the Lucent WinModem drivers?) Anyway, would you be so kind as to e-mail me a copy of the sources? Thanks much! Ben Followup-To: Distribution: Organization: University of Bath Computing Services, UK Keywords: Cc: -- Dennis Davis, BUCS, University of Bath, Bath, BA2 7AY, UK D.H.Davis@bath.ac.uk