home *** CD-ROM | disk | FTP | other *** search
/ Magazyn WWW 1999 July / www_07_1999.iso / prez / amiga / ARexxWebServer.lha / arws / webserver.doc < prev    next >
Text File  |  1998-06-30  |  7KB  |  208 lines

  1. ARexxWebServer V2.0 (ARWS)
  2. By Casey Halverson
  3. Copyright 1996, 1997, and 1998, All Rights Reserved
  4.  
  5.  
  6. DISCLAIMER:
  7.  
  8. This software is AS IS with no warranty implied.  If you some how format your
  9. hard-drive or blow up your computer with this ARexx script, its not my fault.
  10. You may change all you want, but when transfering this software archive, be
  11. sure to keep it fully intact as the original.  Also, EMail me your latest and
  12. greatest, since I would love to see what you have done.  If it is good, i will
  13. include it as a sample in my next release.  Also, one last item, if you wish
  14. to include this in a CD-ROM collection (becides Aminet), please notify me.
  15. Also, I would love to hear if you have made use of this script.  
  16.  
  17. I think I have fixed the security problem.  By scanning for :'s and
  18. double //'s, this should keep people from retrieving files they shouldn't be.
  19. However, if this does not work out properly, I am still not responsible for
  20. what happens.
  21.  
  22.  
  23. INTRODUCTION:
  24.  
  25. Who needs a compiled program, when you can have much more fun in ARexx?  This
  26. is a web server for those who wish to have more control over their web server. 
  27. Another factor is size.  2,438 bytes is the size of version 2.0.  Also, I have
  28. included my orignal web server I first wrote, which is a mere 453 bytes.  One
  29. major point I would like to get across is simply there is no excuse for a
  30. 10 meg web server, or a 1 meg server, or even a 500k web server.  Web servers
  31. should be small and compact.  And thanks to the Amiga and ARexx, this has
  32. been made possible.  ARWS is not only a political statement, but also a very
  33. useful tool as well.  I use my Amiga, ARexx, the Internet, and a server with
  34. an ARWS "core" to control electronic devices at home, read and write my
  35. email remotely, display my system status, run a message board, and even a
  36. proxy server.  Hopefully maybe you can develop such innovations with the Amiga
  37. and ARexx, or if not, take the time to enjoy what it can offer.  One interesting
  38. note is this entire section (Introduction) is more then twice the size in bytes
  39. of ARWS Version 1.0 ;-)
  40.  
  41.  
  42. MAKING YOUR AMIGA KNOWN BY OBTAINING A FREE STATIC ADDRESS:
  43.  
  44. I urge you, if you wish to keep up your Amiga as an internet server, to 
  45. obtain an ml.org address.  Visit their website at http://www.ml.org, and
  46. download (one of the many) ml.org ip address updating programs availble on
  47. aminet.  Ml.org allows you to issue your current IP address to their servers,
  48. giving you a domain which points to your current address.  Such an address
  49. would be either <yourname>.ml.org or <yourname>.dyn.ml.org.  I use
  50. wot.dyn.ml.org and enjoy the service.  The best thing is that it is free,
  51. but donations for supporting their cause is always welcome.  
  52.  
  53. There are also other pay services, however, I owe ml.org a bit of
  54. advertisement for my long usage ;-)
  55.  
  56.  
  57. INSTALLING:
  58.  
  59. Installation should be pretty automatic, but here is information if you
  60. wish to do it manually.  You can put it wherever you want on the system,
  61. just remember the path name so you can configure it properly.
  62.  
  63.  
  64. * For AmiTCP:
  65.  
  66. Edit your amitcp:db/identd and type:
  67.  
  68. arws    stream    tcp dos bin - rx <path>webserver.rexx
  69.  
  70. Edit your amitcp:db/services and type:
  71.  
  72. http         80/tcp        http
  73.  
  74. * For Miami:
  75.  
  76. Open Miami, select database and then select "Identd".
  77.  
  78. Add the entry:
  79.  
  80. arws stream tcp dos bin - rx <path>webserver.rexx
  81.  
  82. Select "Services", and type the following:
  83.  
  84. http 80 tcp
  85.  
  86.  
  87. CONFIGURING:
  88.  
  89. Simply pull it up in a text editor, change the path="amitcp:www" to
  90. whatever you have your pages, or simply store them in amitcp:www since
  91. it does make sense.  You can change whatever you want below, but be sure
  92. you know what you are doing.  I always keep a backup copy of it before I
  93. start doing something totaly weird, because most of the time I will screw
  94. up and be totaly lost :-)  
  95.  
  96. One small note you should consider in changing the path.
  97. *NEVER* put a '/' after the directory (you can have a :).  This will
  98. cause problems.
  99.  
  100.  
  101. CGI-BIN OPERATION:
  102.  
  103. The cgi-bin is simply a way to execute other ARexx scripts.  When a *.cgi
  104. file is requested via http, and the cgi exists in the cgi-bin, the web
  105. server will spawn the script.
  106.  
  107. The cgi-bin also has a function which allows special tags to be placed in
  108. the HTML file, allowing an arexx command to execute at that very line.
  109. After the program completes, the HTML file continues to print.
  110.  
  111. I have included DFD's CGI script he wrote as an example of what can be
  112. done with this.
  113.  
  114. Please note that when creating an imbeded CGI tag, keep it on a line by
  115. it's self.  The parsing routine will not pick out any other imbeded tags
  116. on the same line.  However, text or HTML tags will show up just as normal.
  117.  
  118.  
  119. CGI INFORMATION:
  120.  
  121. There are two ways of executing a CGI script.  The first is embeded, the 
  122. second is stand alone.  With embeded CGI scripts, only the agruments in
  123. the embeded CGI script tag are given to the CGI script via CLI arguments.
  124.  
  125. Example of an embeded CGI script tag:
  126.  
  127. <! CGI="script.cgi args">
  128.  
  129. where script.cgi is the CGI script name, and args represent the arguements
  130. given to the CGI script.
  131.  
  132. With stand alone CGI scripts, the web server passes the entire requested
  133. URL  to the CGI script in CLI arguments.  
  134.  
  135.  
  136. CGI DEMO SCRIPTS:
  137.  
  138. counter.cgi -
  139.  
  140. This script is a counter.  The arguments are data+opt.
  141.  
  142. The data field is the name of the counter you wish to update and display.
  143.  
  144. The opt field can be blank, but if specified as a "1", it will place 
  145. either "st", "nd", "rd", and "th" after the number depending on the number
  146. value.
  147.  
  148. Before you intergrate counter.cgi into your html's, make sure you change
  149. the path set inside the counter.cgi file where it states path="".
  150.  
  151.  
  152. system-status.cgi -
  153.  
  154. This script simply displays your current amiga's system status.  It is
  155. automatically formated with the <PRE> tag and does not require any paths,
  156. configuration, or arguments.
  157.  
  158.  
  159. gadget.cgi  -
  160.  
  161. This CGI script uses my internet gadget hardware interface to control a 
  162. light.  By executing this script, it toggles the status of the light.  This
  163. script also displays in HTML the current light status.  It requires no
  164. paths, configuration, or arguments.  un-commenting a section allows the
  165. CGI script to display status via Internet Relay Chat, using the client AmIRC.
  166. It does require proper hardware and support software.  I am releasing this
  167. as a teaser to spark up interest.  If there is interest, I am thinking
  168. about releasing some sort of kit or software package which allows people
  169. to control such internet gadgets, not just limited to lights ;-)  Also,
  170. this script displays the current light level, one of the many other
  171. internet gadgets that I experiment with.  You can view these in action at
  172. http://wot.dyn.ml.org.  For those attending the AmiWest show in 1998, or
  173. if I teach any other Internet Gadget/Webcam seminars in the future, this
  174. will be one of the main subjects.
  175.  
  176.  
  177. CONTACTING:
  178.  
  179. If you like this program, please give me an EMail.  I would love to hear
  180. from you!  Also, if you made any neat little changes to the server program
  181. (IE: search engine, web game, etc), please send what you have.  
  182.  
  183. You may contact me in the following ways:
  184.  
  185. My computer setup as an internet server:
  186.  
  187. http://wot.dyn.ml.org
  188.  
  189. EMail:
  190.  
  191. cmdo@gte.net
  192.  
  193. Snail-Mail:
  194.  
  195. Casey Halverson
  196. 1517 105th Ave Ct E
  197. Puyallup, WA 98372
  198.  
  199. ATTN: RexxWebServer
  200.  
  201.  
  202. THANKS:
  203.  
  204. ... to Alan Lewis for noticing a little mistake made in the mime handling :-)
  205.  
  206. ... to all those who have found a use for ARWS and run this on their current
  207. system.
  208.