home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / WEBSERVE / PI3 / PI3WEB.EXE / Pi3Docs / Examples / Config / Devel.pi3 next >
Text File  |  1997-10-31  |  38KB  |  1,244 lines

  1. <HTML><TITLE>Devel.pi3</TITLE><BODY><PRE>#!Pi3
  2.  
  3. # ===
  4. #
  5. # Top level configuration file
  6. #
  7. #    ** IMPORTANT **
  8. #    If you do nothing else then do this:
  9. #
  10.  
  11. #... ##### Customize server settings
  12.  
  13. # Skip below to the definition of 'MainVirtualHostInformation', change
  14. # the settings for Hostname (*Mandatory* redirects will not work without
  15. # this!) and Administrator (optional).
  16. #
  17. # ===
  18.  
  19. # Include  standard IO and server stuff
  20. include ../Conf/IO.cnf
  21. include ../Conf/Server.cnf
  22. include ../Conf/Pi3API.cnf
  23.  
  24. # ---
  25. #
  26. # IO Object for main listening socket.
  27. #
  28. # ---
  29. <Object>
  30.     Name ServerIOObject
  31.     Class TCPIPIOClass
  32.     Type Passive
  33.  
  34. # A hostname must be specified for the Pi3Web HTTP server. The hostname
  35. # will be the used by the server to identify itself in URLs generated
  36. # for redirects and will also be used to lookup the IP address that this
  37. # server will listen on.
  38.     BindHost localhost
  39.  
  40. # A TCP port must be specified for this HTTP server. The TCP port
  41. # is the port that the HTTP will listen for requests on. This is
  42. # typically 80 for HTTP servers. 
  43. #
  44. # Note that UNIX operating systems normally require that the server
  45. # initially run as user 'root' to bind on ports between 0 and 1024
  46.     BindPort 80
  47.  
  48. # Timeout accepting connections. -1 specifies no timeout.
  49.     AcceptTimeout -1
  50.  
  51. # Specify timeout for sending data. -1 specifies no timeout. 
  52.  
  53.     RecvTimeout 60
  54.  
  55. # Specify timeout for receiving data. -1 specifies no timeout. 
  56.     SendTimeout 45
  57.     PeerIPVariable STRING:RemoteAddr
  58.     PeerHostNameVariable STRING:RemoteHost
  59.     LocalAddressVariable STRING:LocalAddr
  60.  
  61. # Flags
  62. #
  63. #   OwnDB - Object adds its own DB, rather than use the parents
  64. #               this is necessary to avoid collision of values placed in
  65. #               the DB between different connection. 
  66. #
  67. #   SetPeerAddress - IP address of remote peer with be put
  68. #               into the specified variable.
  69. #
  70. #   DNSReverseLookup - Use reverse DNS to get the hostname of the 
  71. #               peer and place it in the specified variable.
  72. #
  73. #   SetLocalAddress - Put local address in the specified variable.
  74.     Flags OwnDB|SetPeerAddress|DNSReverseLookup|SetLocalAddress
  75.  
  76. # Pointer to file with lockfile name, to avoid collisions on accept
  77. # with multiple processes
  78.     AcceptLockFile  "../Logs/lockfile.txt"
  79. </Object>
  80.  
  81. # ---
  82. #
  83. # Main virtual host object.
  84. #
  85. # ---
  86. <Object>
  87.     Name MainVirtualHostInformation
  88.     Class VirtualHostClass
  89.  
  90. # Administrator for the primary virtual host
  91.     Administrator webmaster@localhost
  92.  
  93. # Hostname that this server uses in redirects.
  94.     HostName localhost
  95.  
  96. # Port that the server uses in redirects.
  97. # Specify it only if it is not the standard port for the protocol in
  98. # use, i.e. 80 for HTTP and 443 for HTTPS
  99. #    ServerPort 80
  100.  
  101. </Object>
  102.  
  103. # ---
  104. #
  105. #    Thread dispatch object
  106. #
  107. #   This is an instance of MultiThreadedIOServerClass with appropriate
  108. #   parameters
  109. #
  110. # ---
  111. <Object>
  112.     Name ThreadPoolDispatcher
  113.     Class MultiThreadedIOServerClass
  114.  
  115. # The IOObject is the object that will be used for the listening socket
  116. # it can be a real IOObject (such as TCP/IP), as test IO object which 
  117. # feeds stub data into the server or a filter IO object which encrpts
  118. # or logs data passed through it.
  119. #
  120. #    Example test IO object:
  121.      IOObject TestIOObject
  122. #
  123. #    Log IO to file:
  124. #    IOObject <A HREF="/pidocs/Objects/IO.html#SnoopIO">SnoopIO</A> IOObject="ServerIOObject" OutFile="./snoop.dbg"
  125. #
  126. #   IOObject ServerIOObject
  127.  
  128. # Dispatch accepted IO connection to the HTTPLogicObject
  129.     LogicObject HTTPLogicObject
  130.  
  131. # Number of threads to use 
  132.     MaxThreads 10
  133.  
  134. # Number of requests to exit after
  135.     ExitAfter 1000
  136.  
  137. </Object>
  138.  
  139. # ---
  140. #
  141. # Main Pi3 object. 
  142. #
  143. # This is an instance of the UNIXDaemonClass to fork the server into
  144. # one monitor process and 'NumberOfProcesses' child processes. 
  145. #
  146. # The monitor process automatically starts a new child processes whenever
  147. # a child process exits.
  148. #
  149. # ---
  150. <Object>
  151.     Name Main
  152.     Class UNIXDaemonClass
  153.  
  154. # Actual class to accept new IO requests and dispatch them
  155.     ServerObject ThreadPoolDispatcher
  156.     PIDFile "../Logs/pid.log"
  157.     RLimitCpu Maximum
  158.  
  159. # User that child processes will run as. Server must run as root to 
  160. # be able to change to the specified user. A user id number can be
  161. # specified with #number. Server which start with root privileges should
  162. # change to a user id with lesser privileges for security reasons.
  163. #   User nobody
  164.  
  165. # Group that child processes will run as. Server must run as root to
  166. # be able to change to a different group. A group id number can be
  167. # specified with #number.
  168. #   Group #-1
  169.  
  170. # generate a server unique lockfile name and write it into
  171. # Logs/lockfile.txt
  172.     LockFileName "../Logs/lockfile.txt"
  173.  
  174. # Message to write just before the server is ready to start accepting
  175. # connections.
  176. # default
  177.     Message "Pi3Web HTTP Server Started"
  178.  
  179. # Specify the number of processes. 
  180.  
  181.     NumberOfProcesses 8
  182.  
  183. </Object>
  184.  
  185.  
  186. # ===
  187. #
  188. # Devel.pi3
  189. #
  190. #    Features of Pi3Web useful for web application development.
  191. #
  192. # ===
  193.  
  194. #
  195. # Load library definitions for classes used here.
  196. #
  197. include ../Conf/HTTP.cnf
  198. include ../Conf/Fcgi.cnf
  199. include ../Conf/Plugins.cnf
  200. include ../Conf/ISAPI.cnf
  201.  
  202. # ---
  203. #
  204. # TestIOObject
  205. #
  206. # Substitute in place of ServerIOObject 
  207. # This stub IO object then feeds canned input into the server as if
  208. # it came from the network.
  209. #
  210. # Leave it a day or two to run 10,000,000 and then examine the state
  211. # of the system and logfiles for errors.
  212. #
  213. # When a new server feature is added make a new .dat file and add
  214. # it here for the server to cycle through it.
  215. #
  216. # ---
  217. <Object>
  218.     Name TestIOObject
  219.     Class StubIOClass
  220.     HTTPEquiv "RemoteAddr: 172.23.23.1"
  221.     HTTPEquiv "RemoteHost: me.you.dom"
  222.     HTTPEquiv "LocalAddr: 127.0.0.1"
  223.     HTTPEquiv "SendTimeout: 45"
  224.     HTTPEquiv "RecvTimeout: 60"
  225.     ErrorAfter 100000
  226.  
  227.     # Simple tests
  228.     DataFile "../Tests/t1.dat"
  229.     DataFile "../Tests/t2.dat"
  230.     DataFile "../Tests/t3.dat"
  231.     DataFile "../Tests/t4.dat"
  232.     DataFile "../Tests/t5.dat"
  233.     DataFile "../Tests/t6.dat"
  234.     DataFile "../Tests/t7.dat"
  235.     DataFile "../Tests/t8.dat"
  236.     DataFile "../Tests/t9.dat"
  237.  
  238.     # Largely <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A>
  239.     DataFile "../Tests/t10.dat"
  240.     DataFile "../Tests/t11.dat"
  241.     DataFile "../Tests/t12.dat"
  242.     DataFile "../Tests/t13.dat"
  243.     DataFile "../Tests/t14.dat"
  244.     DataFile "../Tests/t15.dat"
  245.     DataFile "../Tests/t16.dat"
  246.     DataFile "../Tests/t17.dat"
  247.     DataFile "../Tests/t18.dat"
  248.     DataFile "../Tests/t19.dat"
  249.  
  250.     # <A HREF="/pidocs/Objects/Fcgi.html#FastCGI">FastCGI</A>
  251.     DataFile "../Tests/t31.dat"
  252.     
  253.     # Image maps
  254.     DataFile "../Tests/t41.dat"
  255.     DataFile "../Tests/t42.dat"
  256.     DataFile "../Tests/t43.dat"
  257.     DataFile "../Tests/t44.dat"
  258.     DataFile "../Tests/t45.dat"
  259.  
  260.     # SSI
  261.     DataFile "../Tests/t61.dat"
  262.  
  263.     # Pi3Expressions
  264.     DataFile "../Tests/t71.dat"
  265.  
  266.     # ISAPI
  267.     DataFile "../Tests/t81.dat"
  268.  
  269.     # Bad things
  270.     DataFile "../Tests/t100.dat"
  271. </Object>
  272.  
  273. # ---
  274. #
  275. # Documentation is handled as HTML regardless of file extension. Also,
  276. # files have headers and footers attached to make them pretty.
  277. #
  278. # ---
  279. <Object>
  280.     Name DocumentMapper
  281.     Class PathMapperClass
  282.     #
  283.     # leave calling card
  284.     #
  285.     <A HREF="/pidocs/Objects/HTTP.html#Action">Action</A> "&dbreplace(response,string,ObjectMap,Pi3Docs)"
  286. </Object>
  287.  
  288. # ---
  289. #
  290. # CGIMapper
  291. #
  292. #    Instance of PathMapperClass to Map <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A> URLs
  293. #
  294. #    <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A> Scripts set PATH_INFO. 
  295. #
  296. # ---
  297. <Object>
  298.     Name CGIMapper
  299.     Class PathMapperClass
  300.     CaseSensitive "No"
  301.     #
  302.     # Subdirectories below the mapping directory should be put in path info
  303.     #
  304.     PathInfo "Yes"
  305.     #
  306.     # Set the 'ObjectMap' variable in the response DB if this map is
  307.     # successful
  308.     #
  309.     <A HREF="/pidocs/Objects/HTTP.html#Action">Action</A> "&dbreplace(response,string,ObjectMap,Scripts)"
  310. </Object>
  311.  
  312. # ---
  313. #
  314. # WinCGIMapper and FCGIMapper
  315. #
  316. #     Like CGIMapper, except it leaves a different marker to cause
  317. #     a different object to handle the request.
  318. #
  319. # ---
  320. <Object>
  321.     Name WinCGIMapper
  322.     Class PathMapperClass
  323.     PathInfo "Yes"
  324.     <A HREF="/pidocs/Objects/HTTP.html#Action">Action</A> "&dbreplace(response,string,ObjectMap,WinScripts)"
  325. </Object>
  326. <Object>
  327.     Name FCGIMapper
  328.     Class PathMapperClass
  329.     PathInfo "Yes"
  330.     <A HREF="/pidocs/Objects/HTTP.html#Action">Action</A> "&dbreplace(response,string,ObjectMap,FastCGIScripts)"
  331. </Object>
  332.  
  333. # ---
  334. #
  335. # AdminMapper
  336. #
  337. # For protected spaces
  338. #
  339. # ---
  340. <Object>
  341.     Name AdminMapper
  342.     Class PathMapperClass
  343.  
  344.     # 
  345.     # Set the authentication realm so the <A HREF="/pidocs/Objects/HTTP.html#BasicAuth">BasicAuth</A> handler kicks in
  346.     <A HREF="/pidocs/Objects/HTTP.html#Action">Action</A> "&dbreplace(response,string,AuthenticationRealm,Admin)"
  347. </Object>
  348.  
  349. # ---
  350. #
  351. # AccessLogger
  352. #
  353. #    An instance of ExpressionLoggerClass configured to generate an access
  354. #    logfile
  355. #
  356. # ---
  357. <Object>
  358.     Name AccessLogger
  359.     Class ExpressionLoggerClass
  360.  
  361.     #
  362.     # Append
  363.     #
  364.     OpenMode "a"
  365.     #
  366.     # Line to log 
  367.     Expression "$A $h - [$t] \"$r\" $s $b$M"
  368. </Object>
  369.  
  370. # ---
  371. #
  372. # Start
  373. #
  374. #    Handle initial phases of requests, typically before we have enough
  375. #    information to select different execution paths
  376. #
  377. # ---
  378. <Object>
  379.     Name Start
  380.     Class FlexibleHandlerClass
  381.     Init <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  382.     Headers <A HREF="/pidocs/Objects/HTTP.html#ReadRequestHeaders">ReadRequestHeaders</A>
  383.  
  384.     #
  385.     # The handler 'VirtualHosts' is described below
  386.     #
  387.     HostMap VirtualHosts
  388.  
  389.     #
  390.     # Mapping virtual paths to example directory with 'DirListType' set
  391.     #
  392.     Mapping DirectoryMappings
  393.  
  394.     #
  395.     # Default mappings
  396.     #
  397.     Mapping <A HREF="/pidocs/Objects/HTTP.html#MapToErrorDocument">MapToErrorDocument</A> \
  398.         IgnoreStatus="0 200" \
  399.         DefaultMessage="/errors/unknown.htm" \
  400.         301="/errors/301.ssi" \
  401.         304="/errors/304.htm" \
  402.         400="/errors/400.htm" \
  403.         401="/errors/401.ssi" \
  404.         403="/errors/403.ssi" \
  405.         404="/errors/404.ssi" \
  406.         500="/errors/500.ssi" \
  407.         501="/errors/501.htm"
  408.     Mapping <A HREF="/pidocs/Objects/Plugins.html#UserDirectory">UserDirectory</A> UserDirectoryRoot="/home/" \
  409.         HTMLDirectory="/public_html"
  410.     Mapping CGIMapper From="/cgi-bin/" To="cgi-bin/"
  411.     Mapping WinCGIMapper From="/cgi-win/" To="cgi-win/"
  412.     Mapping FCGIMapper From="/cgi-fcgi/" To="cgi-fcgi/"
  413.     Mapping DocumentMapper From="/pidocs/" To="Pi3Docs/" 
  414.     Mapping <A HREF="/pidocs/Objects/HTTP.html#PathMapper">PathMapper</A> From="/errors/" To="Fragment/" 
  415.     Mapping <A HREF="/pidocs/Objects/HTTP.html#PathMapper">PathMapper</A> From="/icons/" To="Icons/" 
  416.     Mapping <A HREF="/pidocs/Objects/HTTP.html#PathMapper">PathMapper</A> From="/logs/" To="Logs/" 
  417.     Mapping AdminMapper From="/admin/" To="Logs/" 
  418.     Mapping <A HREF="/pidocs/Objects/HTTP.html#PathMapper">PathMapper</A> From="/Pi3Expressions/" To="**internal**/" \
  419.         Action="&dbreplace(response,string,ObjectMap,Pi3Expr)" \
  420.         PathInfo="Yes"
  421.     Mapping <A HREF="/pidocs/Objects/HTTP.html#PathMapper">PathMapper</A> From="/isapi/" To="Isapi/" \
  422.         Action="&dbreplace(response,string,ObjectMap,ISAPI)" \
  423.         PathInfo="Yes"
  424.  
  425.     #
  426.     # Mapping specific to Host2
  427.     #
  428.     Mapping Host2Mappings
  429.  
  430.     #
  431.     # Mapping specific to MainVirtualHostInformation
  432.     #
  433.     Mapping Host1Mappings
  434. </Object>
  435.  
  436. # ---
  437. #
  438. # Default
  439. #
  440. #    Handle requests that other handlers have passed up
  441. #
  442. # ---
  443. <Object>
  444.     Name Default
  445.     Class FlexibleHandlerClass
  446.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#DirectoryExists">DirectoryExists</A> IndexFile="index.html" IndexFile="index.htm"
  447.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="EF" RefuseStatus=404
  448.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="F" RefuseStatus=403
  449.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  450.     CheckAuth <A HREF="/pidocs/Objects/HTTP.html#BasicAuth">BasicAuth</A> Realm="Admin"
  451.     CheckAuth <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  452.     CheckAccess <A HREF="/pidocs/Objects/HTTP.html#AccessByFile">AccessByFile</A> RequirePermissions="R"
  453.  
  454.     #
  455.     # Cause a '501 Not Implemented' Message for requests that
  456.     # are not 'GET' or 'HEAD', i.e.
  457.     #    if !( Method=='GET' || Method=='HEAD' ) 
  458.     #    then
  459.     #        set status = 501
  460.     #    endif
  461.     #
  462.     CheckType Condition="¬(&or(&cmpi($m,GET),&cmpi($m,HEAD)))" \
  463.         <A HREF="/pidocs/Objects/HTTP.html#StatusCode">StatusCode</A> StatusCode="501"
  464.     CheckType <A HREF="/pidocs/Objects/HTTP.html#ConditionalGet">ConditionalGet</A>
  465.     CheckType <A HREF="/pidocs/Objects/HTTP.html#CheckForDirectory">CheckForDirectory</A> SetType="internal/x-directory"
  466.  
  467.     #
  468.     # Otherwise: Set the media type based on the file extension
  469.     #
  470.     CheckType <A HREF="/pidocs/Objects/HTTP.html#MIMETypeByExtension">MIMETypeByExtension</A> 
  471.  
  472.     #
  473.     # Return 'COMPLETED' so an internal error will not be raised
  474.     #
  475.     CheckType <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode="COMPLETED"
  476.  
  477.     #
  478.     # Most requests refer to a file, so put that first 
  479.     #
  480.     # Handle the request by sending a file if
  481.     #    - The Value of ObjectMap in the response DB is ""
  482.     #    AND
  483.     #    - The Media type of the resource does not match internal/* 
  484.     #
  485.     Handle Condition="&and(¬(&dblookup(response,string,ObjectMap)),\
  486. ¬(®exp('internal/*',$c)))" <A HREF="/pidocs/Objects/HTTP.html#SendFile">SendFile</A>
  487.     Handle Condition="&cmp($c,internal/x-directory)" DirectoryIndexes
  488.     Handle Condition="&cmp($c,internal/x-server-parsed-html)" <A HREF="/pidocs/Objects/HTTP.html#SendSSI">SendSSI</A> \
  489.         Exec=Yes ExecFileFixup="\
  490. /* exec file="" maps to Standard <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A> (Scripts) */\
  491. &dbreplace(response,string,ObjectMap,Scripts)\
  492. &dbreplace(response,rfc822,Content-Type,internal/x-cgi)"
  493.     Handle Condition="&cmp($c,internal/x-imagemap)" <A HREF="/pidocs/Objects/Plugins.html#ImageMap">ImageMap</A>
  494.     Handle <A HREF="/pidocs/Objects/HTTP.html#SendFile">SendFile</A>
  495.     Log AccessLogger File="Logs/access.txt"
  496.     Log <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  497.     Destroy <A HREF="/pidocs/Objects/HTTP.html#DeleteTemporaryFiles">DeleteTemporaryFiles</A>
  498. </Object>
  499.  
  500. # ---
  501. #
  502. # Documentation
  503. #
  504. #    Handler sequence for documentation.
  505. #
  506. # ---
  507. <Object>
  508.     Name Documentation
  509.     Class FlexibleHandlerClass
  510.  
  511.     #
  512.     # Only execute this sequence for the documentation (check for
  513.     # the appropriate marker).
  514.     #
  515.     # Don't handle special resource types (internal/...)
  516.     #
  517.     Condition "&and(&cmp(&dblookup(response,string,ObjectMap),Pi3Docs),\
  518. ¬(®exp('internal/*',$c)))"
  519.  
  520.     #
  521.     # Check if file is a directory
  522.     # 
  523.     CheckType <A HREF="/pidocs/Objects/HTTP.html#CheckForDirectory">CheckForDirectory</A> SetType="internal/x-directory"
  524.  
  525.     #
  526.     # Lookup media type by extension
  527.     #
  528.     CheckType <A HREF="/pidocs/Objects/HTTP.html#MIMETypeByExtension">MIMETypeByExtension</A>
  529.  
  530.     #
  531.     # Force all non-internal media types to 'text/html'
  532.     #
  533.     CheckType Condition="¬(®exp('internal/*',$c))" <A HREF="/pidocs/Objects/HTTP.html#Action">Action</A> \
  534.         Pi3Expression="&dbreplace(response,rfc822,Content-Type,text/html)"
  535.  
  536.     #
  537.     # Return 'COMPLETED' so as not to fall into other cases
  538.     #
  539.     CheckType <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode="COMPLETED"
  540.  
  541.     #
  542.     # For documentation, Send documentation with header and footer
  543.     #
  544.     Handle <A HREF="/pidocs/Objects/HTTP.html#SendFile">SendFile</A> HeaderPattern="<BODY BACKGROUND="/icons/\
  545. &if(&cmpi($o,MainVirtualHostInformation),Pi3Tile.gif,H2Tile.gif)"/*background depends on vhost*/\
  546. BGCOLOR="#FFFFFF">\n"
  547. </Object>
  548.  
  549. # ---
  550. #
  551. # FastCGIIOObject
  552. # IOObject for communicating with fast <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A> application servers. This
  553. # one uses the TCP/IP transport.
  554. #
  555. # ---
  556. <Object>
  557.     Name FastCGIIOObject
  558.     Class TCPIPIOClass
  559.     Type Active
  560.  
  561.     # Timeouts. -1 specifies no timeout.
  562.     RecvTimeout 20
  563.     SendTimeout 20
  564. </Object>
  565.  
  566. # ---
  567. # Scripts, WinScripts, ISAPI, FastCGIScripts, Pi3Expr
  568. #
  569. #    Handler sequences for resources which have mapped to these
  570. #     respective types
  571. #
  572. # ---
  573. <Object>
  574.     Name Scripts
  575.     Class FlexibleHandlerClass
  576.     Condition "&cmp(&dblookup(response,string,ObjectMap),Scripts)"
  577.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="EFD" RefuseStatus=404
  578.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="F" RefuseStatus=403
  579.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  580.     CheckAccess <A HREF="/pidocs/Objects/HTTP.html#AccessByFile">AccessByFile</A> RequirePermissions="X"
  581.     CheckType <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  582.     Handle StandardCGI
  583. </Object>
  584. <Object>
  585.     Name WinScripts
  586.     Class FlexibleHandlerClass
  587.     Condition "&cmp(&dblookup(response,string,ObjectMap),WinScripts)"
  588.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="EFD" RefuseStatus=404
  589.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="F" RefuseStatus=403
  590.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  591.     CheckAccess <A HREF="/pidocs/Objects/HTTP.html#AccessByFile">AccessByFile</A> RequirePermissions="X"
  592.     CheckType <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  593.     Handle WinCGI
  594. </Object>
  595. <Object>
  596.     Name ISAPI
  597.     Class FlexibleHandlerClass
  598.     Condition "&cmp(&dblookup(response,string,ObjectMap),ISAPI)"
  599.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="EFD" RefuseStatus=404
  600.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="F" RefuseStatus=403
  601.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  602.     CheckAccess <A HREF="/pidocs/Objects/HTTP.html#AccessByFile">AccessByFile</A> RequirePermissions="X"
  603.     CheckType <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  604.     Handle <A HREF="/pidocs/Objects/ISAPI.html#ISAPI20">ISAPI20</A>
  605. </Object>
  606. <Object>
  607.     Name FastCGIScripts
  608.     Class FlexibleHandlerClass
  609.     Condition "&cmp(&dblookup(response,string,ObjectMap),FastCGIScripts)"
  610.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="EFD" RefuseStatus=404
  611.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="F" RefuseStatus=403
  612.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode="COMPLETED"
  613.     CheckAccess <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode="COMPLETED"
  614.     CheckType <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode="COMPLETED"
  615.     Handle <A HREF="/pidocs/Objects/Fcgi.html#FastCGI">FastCGI</A> \
  616.         IOObject="FastCGIIOObject" \
  617.         Variable="AUTH_TYPE=$x" \
  618.         Variable="CONTENT_LENGTH=$Y" \
  619.         Variable="CONTENT_TYPE=$C" \
  620.         Variable="HTTPS=$g" \
  621.         Variable="&if($K,HTTPS_KEYSIZE=$K,)" \
  622.         Variable="&if($K,HTTPS_SECRETKEYSIZE=$G,)" \
  623.         Variable="PATH_INFO=$I" \
  624.         Variable="PATH_TRANSLATED=$Z" \
  625.         Variable="QUERY_STRING=$q" \
  626.         Variable="REMOTE_ADDR=$A" \
  627.         Variable="REMOTE_HOST=$h" \
  628.         Variable="REMOTE_IDENT=$i" \
  629.         Variable="REMOTE_USER=$u" \
  630.         Variable="REQUEST_METHOD=$m" \
  631.         Variable="SCRIPT_NAME=$z" \
  632.         Variable="SERVER_NAME=$v" \
  633.         Variable="SERVER_PORT=&if($p,$p,&if($K,443,80))" \
  634.         Variable="SERVER_PROTOCOL=$H" \
  635.         Variable="SERVER_SOFTWARE=$S"
  636. </Object>
  637. <Object>
  638.     Name Pi3Expr
  639.     Class FlexibleHandlerClass
  640.     Condition "&cmp(&dblookup(response,string,ObjectMap),Pi3Expr)"
  641.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode="COMPLETED"
  642.     CheckAccess <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode="COMPLETED"
  643.     CheckType <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  644.     Handle <A HREF="/pidocs/Objects/HTTP.html#SendPi3Expression">SendPi3Expression</A> HTTPEquiv="Content-Type: text/html" \
  645.         Pi3Expression="\
  646. /*                                             */\
  647. /*                                             */\
  648. /* A Large <A HREF="/pidocs/Objects/Pi3API.html#Pi3Expression">Pi3Expression</A> to send to the client */\
  649. /*              in one go                      */\
  650. /*                                             */\
  651. /*   This will generate a dynamic HTML page    */\
  652. /*                                             */\
  653. <TITLE>Pi3Expressions - DB Dump</TITLE>\
  654. <HTML><BODY BACKGROUND="/icons/Pi3Tile.gif">\
  655. <CENTER><H2>Pi3Expressions - DB Dump</H2>\
  656. <A NAME="index">$M\
  657. <UL>$M\
  658. <LI><A HREF="#connection">Connection DB</A>$M\
  659. <LI><A HREF="#request">Request DB</A>$M\
  660. <LI><A HREF="#response">Response DB</A>$M\
  661. <LI><A HREF="#host">Host DB</A>$M\
  662. </UL>$M\
  663. <HR>$M\
  664. <A NAME="connection">$M\
  665. <H3>Dump of Connection DB <I>dblookup(connection,...)</I></H3>$M\
  666. <TABLE BORDER=1 CELLPADDING=5><TH>Type<TH>Variable<TH>Value$M\
  667. &dblookup(connection,string,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  668. &dblookup(connection,rfc822,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  669. &dblookup(connection,opaque,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  670. </TABLE>\
  671. <A HREF="#index">Index</A>$M\
  672. <HR>$M\
  673. <A NAME="request">$M\
  674. <H3>Dump of Request DB <I>dblookup(request,...)</I></H3>$M\
  675. <TABLE BORDER=1 CELLPADDING=5><TH>Type<TH>Variable<TH>Value$M\
  676. &dblookup(request,string,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  677. &dblookup(request,rfc822,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  678. &dblookup(request,opaque,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  679. </TABLE>\
  680. <A HREF="#index">Index</A>$M\
  681. <HR>$M\
  682. <A NAME="response">$M\
  683. <H3>Dump of Response DB <I>dblookup(response,...)</I></H3>$M\
  684. <TABLE BORDER=1 CELLPADDING=5><TH>Type<TH>Variable<TH>Value$M\
  685. &dblookup(response,string,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  686. &dblookup(response,rfc822,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  687. &dblookup(response,opaque,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  688. </TABLE>\
  689. <A HREF="#index">Index</A>$M\
  690. <HR>$M\
  691. <A NAME="host">$M\
  692. <H3>Dump of Host DB <I>dblookup(host,...)</I></H3>$M\
  693. <TABLE BORDER=1 CELLPADDING=5><TH>Type<TH>Variable<TH>Value$M\
  694. &dblookup(host,string,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  695. &dblookup(host,rfc822,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  696. &dblookup(host,opaque,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  697. </TABLE>\
  698. <A HREF="#index">Index</A>$M\
  699. </CENTER><HR></BODY></HTML>"
  700.  
  701. </Object>
  702.  
  703. # ---
  704. #
  705. #    Virtual hosting handlers and configuration
  706. #
  707. # ---
  708.  
  709. #
  710. # Host2 Virtual host object
  711. <Object>
  712.     Name Host2
  713.     Class VirtualHostClass
  714.     Administrator mr_web@Host2.dom
  715.     HostName www.johnroy.com/host2
  716.     ServerPort 80
  717. </Object>
  718.  
  719. #
  720. # Virtual host mappings
  721. #
  722. <Object>
  723.     Name VirtualHosts
  724.     Class FlexibleHandlerClass
  725.  
  726.     #
  727.     # if the URL starts with '/host2/' assign to virtual host 2
  728.     #
  729.     HostMap <A HREF="/pidocs/Objects/HTTP.html#VirtualHostByURL">VirtualHostByURL</A> VirtualHostObject="Host2" URLPath="/host2/"
  730.  
  731.     #
  732.     # Introduce a mapping
  733.     Mapping Host2Mappings
  734. </Object>
  735.  
  736. #
  737. # Override some mappings for Host2 only
  738. #
  739. <Object>
  740.     Name Host2Mappings
  741.     Class FlexibleHandlerClass
  742.  
  743.     #
  744.     # These mappings only apply to Host2
  745.     #
  746.     Condition "&cmp($o,Host2)"
  747.  
  748.     #
  749.     # map to second document root
  750.     #
  751.     Mapping <A HREF="/pidocs/Objects/HTTP.html#PathMapper">PathMapper</A> From="/" To="WebRoot2/"
  752. </Object>
  753.  
  754. #
  755. # Host1 mappings
  756. #
  757. <Object>
  758.     Name Host1Mappings
  759.     Class FlexibleHandlerClass
  760.     #
  761.     # These mappings only apply to MainVirtualHostInformation
  762.     #
  763.     Condition "&cmp($o,MainVirtualHostInformation)"
  764.     #
  765.     # map to first document root
  766.     #
  767.     Mapping <A HREF="/pidocs/Objects/HTTP.html#PathMapper">PathMapper</A> From="/" To="WebRoot/"
  768. </Object>
  769.  
  770. # ---
  771. #
  772. # HTTPLogicObject
  773. #
  774. #     HTTP Logic object, dispatches requests to all other handlers
  775. #
  776. # ---
  777. <Object>
  778.     Name HTTPLogicObject
  779.     Class HTTPDispatcherClass
  780.     Handlers Start Scripts WinScripts FastCGIScripts Documentation Pi3Expr ISAPI Default
  781.     KeepOpen On
  782.     ServerRoot ./../
  783.     ServerStamp Pi3Web/0.9b4
  784.     DefaultHost MainVirtualHostInformation
  785.     MIMEFile "Fragment/Mime.typ"
  786.     DefaultMIMEType "application/octet-stream"
  787.     ErrorLogFile "Logs/error.txt"
  788.  
  789.     # Specifying a file for DebugLogFile effectively turns on debugging
  790. #    DebugLogFile "Logs/debug.txt"
  791.  
  792.     #
  793.     # The following to directives specify expressions to be logged
  794.     # before and after each handler execution respectively.
  795.     # The expression as given logs process/thread and handler context
  796.     # information indented to the nested handler level.
  797.     #
  798.     # Timing information is also given for performance tuning.
  799.     #
  800.     # This logging information is EXTREMELY verbose. Don't even
  801.     # think about using it in a production server
  802.     #
  803.     DebugBeforeHandler "[$P:$k] &align(,$X)&align(,$X) |--> $T \
  804. -------- &align($N,12) &align($R,12) $n \"$r\" $s"
  805.     DebugAfterHandler "[$P:$k] &align(,$X)&align(,$X) |<-- $T \
  806. &align($D,8) &align($N,12) &align($R,12) $n \"$r\" $s"
  807. </Object>
  808.  
  809. # ---
  810. #
  811. #    Directory listing handlers and configuration
  812. #
  813. # ---
  814. <Object>
  815.     Name DirectoryMappings
  816.     Class FlexibleHandlerClass
  817.  
  818.     #
  819.     # 1..Simple HTML
  820.     #
  821.     # simple HTML, no icons or descriptions
  822.     Mapping DocumentMapper From="/dir_SimpleHTML/" To="Pi3Docs/features/" \
  823.         Action="&dbreplace(response,string,DirListType,SimpleHTML)"
  824.  
  825.     #
  826.     # 2..Simple DOS like format with alternate name
  827.     # 
  828.     Mapping DocumentMapper From="/dir_DOS/" To="Pi3Docs/features/" \
  829.         Action="&dbreplace(response,string,DirListType,DOS)"
  830.  
  831.     #
  832.     # 3..Fixed pitch HTML with icons and descriptions
  833.     # plain HTML
  834.     Mapping DocumentMapper From="/dir_TableHTML/" \
  835.         To="Pi3Docs/features/" \
  836.         Action="&dbreplace(response,string,DirListType,TableHTML)"
  837.  
  838.     #
  839.     # 4..HTML with tables
  840.     #
  841.     # HTML with tables
  842.     Mapping DocumentMapper From="/dir_PlainHTML/" To="Pi3Docs/features/" \
  843.         Action="&dbreplace(response,string,DirListType,PlainHTML)"
  844.  
  845.     # 
  846.     # 5..Raw tab delimited text
  847.     #
  848.     # Tab delimited text
  849.     Mapping DocumentMapper From="/dir_TDT/" To="Pi3Docs/features/" \
  850.         Action="&dbreplace(response,string,DirListType,TDT)"
  851. </Object>
  852.  
  853. #
  854. # Directory Indexes
  855. #
  856. <Object>
  857.     Name DirectoryIndexes
  858.     Class FlexibleHandlerClass
  859.  
  860.     # 1..Simple HTML
  861.     Handle Condition="&cmp(&dblookup(response,string,DirListType),SimpleHTML)" \
  862.         SimpleHTML
  863.  
  864.     # 2..Simple DOS format
  865.     Handle Condition="&cmp(&dblookup(response,string,DirListType),DOS)" DOS
  866.  
  867.     # 3..Plain HTML
  868.     Handle Condition="&cmp(&dblookup(response,string,DirListType),PlainHTML)" \
  869.         PlainHTML 
  870.  
  871.     # 4..HTML with tables
  872.     Handle Condition="&cmp(&dblookup(response,string,DirListType),TableHTML)" \
  873.          TableHTML 
  874.  
  875.     # 5..Raw tab delimited text
  876.     Handle Condition="&cmp(&dblookup(response,string,DirListType),TDT)" TDT
  877.  
  878.     #
  879.     # The default index type used for examples other than the
  880.     # sample directory will be a table HTML index
  881.     #
  882.     Handle TableHTML
  883. </Object>
  884.  
  885. # ---
  886. #
  887. # Simple HTML
  888. #
  889. # ---
  890. <Object>
  891.     Name SimpleHTML
  892.     Class DirectoryIndexClass
  893.     HeaderPattern "<HTML><TITLE>Simple index of %p</TITLE>\
  894. <H2>Simple index of %p</H2>\n"
  895.     ListTop "\
  896. <PRE><B>\
  897. &align(Name,23) \
  898. &align(Size,6)  \
  899. &align(Last Modified,18)\
  900. \n<HR SIZE=1 NOSHADE></B>\n"
  901.     FilePattern "\
  902. <A HREF="%r">&align(&abbrev(%n,23,...)</A>,27) /*    link to file */\
  903. &align(%s,6)  /*                                    size */\
  904. &align(%l,18)/*                                        last modified date */\
  905. \n"
  906.     LastModifiedFormat "%d-%b-%y %H:%M"
  907.     Include "*"
  908.     SwapFileName ".. Parent Directory"
  909.     ListBottom "</PRE>\n"
  910.     FooterPattern "<HR SIZE=1 NOSHADE>\
  911. Contact the hostmaster <A HREF="mailto:$a"<I>$a</I></A>.\
  912. </HTML>"
  913.     HeaderFile "HEADER"
  914.     FooterFile "README"
  915.     Exclude "."
  916.     Exclude "~*"
  917.     Exclude ".desc"
  918.     Exclude "README"
  919.     Exclude "HEADER"
  920.     Options " Name | Size | RelPath "
  921. </Object>
  922.  
  923. # ---
  924. #
  925. # Simple DOS formatted index
  926. #
  927. # ---
  928. <Object>
  929.     Name DOS
  930.     Class DirectoryIndexClass
  931.     HeaderPattern "<HTML><TITLE>DOS style index of %p - </TITLE>\
  932. <H2>DOS style index of %p - </H2>\n\
  933. "
  934.     ListTop "<PRE>\
  935. &align(Last Modified,24,left)\
  936. &align(Size,14) \
  937. &align('(8,3) Name',12) \
  938. Name \n<HR SIZE=1 NOSHADE>"
  939.     FilePattern "\
  940. &align(%l,24)\
  941. &if(%b,&align('<DIR>',18,left),&align(%s,14,right)) \
  942. <A HREF="%r">&align(&abbrev(%a,12,...)</A>,16,left) \
  943. <A HREF="%r">%n</A> \n"
  944.     LastModifiedFormat "%d/%m/%y  %I:%M%p"
  945.     Include "*"
  946.     DescriptionFile ".desc"
  947.     ListBottom "</PRE>\n"
  948.     FooterPattern "<HR SIZE=1 NOSHADE>\
  949. Contact the hostmaster <A HREF="mailto:$a"<I>$a</I></A>.\
  950. </HTML>"
  951.     HeaderFile "HEADER"
  952.     FooterFile "README"
  953.     Exclude "."
  954.     Exclude "~*"
  955.     Exclude ".desc"
  956.     Exclude "README"
  957.     Exclude "HEADER"
  958.     Options " AltName | Name | FormatSize | RelPath "
  959. </Object>
  960.  
  961. # ---
  962. #
  963. # Plain HTML directory listing with icons
  964. #
  965. # ---
  966. <Object>
  967.     Name PlainHTML
  968.     Class DirectoryIndexClass
  969.     HeaderPattern "<HTML><TITLE>Plain HTML index of %p</TITLE>\
  970. <BODY BACKGROUND="/icons/\
  971. &if(&cmpi($o,MainVirtualHostInformation),Pi3Tile.gif,H2Tile.gif)"/*background depends on vhost*/\
  972. BGCOLOR="#FFFFFF">\
  973. <H2>Plain HTML index of %p</H2>\n"
  974.     ListTop "\
  975. <PRE>\
  976. <IMG SRC="/icons/blank.gif" BORDER=NONE ALT="  ">\
  977.  &align(Name,23) &align(Last Modified,18)\
  978. &align(Size,6)  Description\n<HR SIZE=1 NOSHADE>"
  979.     FilePattern "\
  980. <A HREF="%r"><IMG SRC="%i" BORDER=NONE ALT="[]"></A>/*icon is a link */\
  981.  <A HREF="%r">&align(&abbrev(%n,23,...)</A>,27) /*    link to file */\
  982. &align(%l,18)/*                                        last modified date */\
  983. &align(%s,6)  /*                                    size */\
  984. &if(%d,%d,<I>%c</I>)/*                                description, or MIME */\
  985. \n"
  986.     LastModifiedFormat "%d-%b-%y %H:%M"
  987.     Include "*"
  988.     MIMEIcon "text/html /icons/layout.gif"
  989.     MIMEIcon "text/x-code /icons/c.gif"
  990.     MIMEIcon "text/x-perl /icons/p.gif"
  991.     MIMEIcon "text/* /icons/text.gif"
  992.     MIMEIcon "internal/x-directory /icons/folder.gif"
  993.     MIMEIcon "audio/* /icons/sound2.gif"
  994.     MIMEIcon "image/* /icons/image2.gif"
  995.     MIMEIcon "application/x-uuencoded /icons/uuencoded.gif"
  996.     MIMEIcon "application/x-tar /icons/compressed.gif"
  997.     MIMEIcon "application/x-gzip /icons/compressed.gif"
  998.     MIMEIcon "application/x-sh /icons/script.gif"
  999.     MIMEIcon "application/* /icons/binary.gif"
  1000.     MIMEIcon "x-world/x-vrml /icons/burst.gif"
  1001.     MIMEIcon "*/* /icons/unknown.gif"
  1002.     DescriptionFile ".desc"
  1003.     SwapFileName ".. Parent Directory"
  1004.     ListBottom "</PRE>\n"
  1005.     FooterPattern "<HR SIZE=1 NOSHADE>\
  1006. Contact the hostmaster <A HREF="mailto:$a"<I>$a</I></A>.\
  1007. </BODY></HTML>"
  1008.     HeaderFile "HEADER"
  1009.     FooterFile "README"
  1010.     Exclude "."
  1011.     Exclude "~*"
  1012.     Exclude ".desc"
  1013.     Exclude "README"
  1014.     Exclude "HEADER"
  1015.     Options " Name | AbbrevSize | RelPath | Icon | MIMEType "
  1016. </Object>
  1017.  
  1018. # ---
  1019. #
  1020. # Directory listing with HTML tables
  1021. #
  1022. # ---
  1023. <Object>
  1024.     Name TableHTML
  1025.     Class DirectoryIndexClass
  1026.     HeaderPattern "<HTML><TITLE>Enhanced HTML index of %p</TITLE>\
  1027. <BODY BACKGROUND="/icons/\
  1028. &if(&cmpi($o,MainVirtualHostInformation),Pi3Tile.gif,H2Tile.gif)"/*background depends on vhost*/\
  1029. BGCOLOR="#FFFFFF">\
  1030. <H2>Enhanced HTML index of %p</H2>\n"
  1031.     ListTop "<CENTER><TABLE CELLSPACING=0 CELLPADDING=0 WIDTH=100'%'>\
  1032. <TR>\
  1033. <TH NOWARP ALIGN=LEFT>\
  1034. <IMG SRC="/icons/blank.gif" ALIGN=MIDDLE BORDER=NONE ALT="">\
  1035. <TH NOWRAP ALIGN=LEFT>Name<BR><HR SIZE=1 NOSHADE>\
  1036. <TH NOWRAP ALIGN=LEFT>Size<BR><HR SIZE=1 NOSHADE>\
  1037. <TH NOWRAP ALIGN=LEFT>Last Modified<BR><HR SIZE=1 NOSHADE>\
  1038. <TH NOWRAP ALIGN=LEFT>Description<BR><HR SIZE=1 NOSHADE>\n"
  1039.     FilePattern "<TR>\
  1040. <TD NOWRAP ALIGN=LEFT VALIGN=TOP>\
  1041. <A HREF="%r"><IMG SRC="%i" BORDER=NONE ALIGN=MIDDLE ALT=""></A>\
  1042. <TD NOWRAP ALIGN=LEFT VALIGN=TOP><A HREF="%r">&abbrev(%n,20,...)</A>\
  1043. <TD NOWRAP ALIGN=LEFT VALIGN=TOP>%s<TD>%l\
  1044. <TD NOWRAP ALIGN=LEFT VALIGN=TOP>&if(%d,%d,<I>%c</I>)\n"
  1045.     ListBottom "</TABLE></CENTER>\n"
  1046.     LastModifiedFormat "%d-%b-%y %H:%M"
  1047.     Include "*"
  1048.     MIMEIcon "text/html /icons/layout.gif"
  1049.     MIMEIcon "text/x-code /icons/c.gif"
  1050.     MIMEIcon "text/x-perl /icons/p.gif"
  1051.     MIMEIcon "text/* /icons/text.gif"
  1052.     MIMEIcon "internal/x-directory /icons/folder.gif"
  1053.     MIMEIcon "audio/* /icons/sound2.gif"
  1054.     MIMEIcon "image/* /icons/image2.gif"
  1055.     MIMEIcon "application/x-uuencoded /icons/uuencoded.gif"
  1056.     MIMEIcon "application/x-tar /icons/compressed.gif"
  1057.     MIMEIcon "application/x-gzip /icons/compressed.gif"
  1058.     MIMEIcon "application/x-sh /icons/script.gif"
  1059.     MIMEIcon "application/* /icons/binary.gif"
  1060.     MIMEIcon "x-world/x-vrml /icons/burst.gif"
  1061.     MIMEIcon "*/* /icons/unknown.gif"
  1062.     DescriptionFile ".desc"
  1063.     SwapFileName ".. Parent Directory"
  1064.     FooterPattern "<HR SIZE=1 NOSHADE>\
  1065. Contact the hostmaster <A HREF="mailto:$a"<I>$a</I></A>.\
  1066. </BODY></HTML>"
  1067.     HeaderFile "HEADER"
  1068.     FooterFile "README"
  1069.     Exclude "."
  1070.     Exclude "~*"
  1071.     Exclude ".desc"
  1072.     Exclude "README"
  1073.     Exclude "HEADER"
  1074.     Options " Name | AbbrevSize | RelPath | Icon | MIMEType "
  1075. </Object>
  1076.  
  1077. # ---
  1078. #
  1079. # Raw tab delimited directory index. For input into other
  1080. # applications. This data could be cut and pasted into a 
  1081. # spreadsheet application.
  1082. #
  1083. # ---
  1084. <Object>
  1085.     Name TDT
  1086.     Class DirectoryIndexClass
  1087.     FilePattern "%r\t%n\t%l\t%s\t%c\n"
  1088.     LastModifiedFormat "%d-%b-%y %H:%M"
  1089.     Include "*"
  1090.     Exclude "."
  1091.     Exclude "~*"
  1092.     Exclude ".desc"
  1093.     Exclude "README"
  1094.     Exclude "HEADER"
  1095.     HTTPEquiv "Content-Type: text/plain"
  1096.     Options " Name | Size | RelPath "
  1097. </Object>
  1098.  
  1099. # ---
  1100. #
  1101. # CGIFileIOObject
  1102. #     
  1103. #    IOObject used for communication between web browser and
  1104. #    server.
  1105. #
  1106. # ---
  1107. <Object>
  1108.     Name CGIFileIOObject
  1109.     Class PipeIOClass
  1110.     ReadTimeout -1
  1111.     WriteTimeout 10
  1112.     NoYield "Read"
  1113. </Object>
  1114.  
  1115. # ---
  1116. #
  1117. # StandardCGI
  1118. #
  1119. # Configuration for Standard <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A>
  1120. #
  1121. # ---
  1122. <Object>
  1123.     Name StandardCGI
  1124.     Class CGIClass
  1125.     
  1126.     # Specify the IO object use to communicate with the <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A> program
  1127.     FileIOObject CGIFileIOObject
  1128.  
  1129.     # Snoop IO objects can be instantiated in the IO chain with a line
  1130.     # like this. They log all IO trafic. This is useful for debugging.
  1131. #    FileIOObject SnoopIOObject IOObject="CGIFileIOObject" OutFile="cgi.dbg" 
  1132.  
  1133.     DefaultCommandLine "%p%q"
  1134.     CommandLineByExt .bat="cmd.exe /c %p%q"
  1135.     CommandLineByExt .cmd="cmd.exe /c %p%q"
  1136.     CommandLineByExt .pl="perl %p%q"
  1137.     IncludeParentsEnvironment Yes
  1138.     EnvironmentSize 8192
  1139.     
  1140.     # These are the environment variables that are sent to the
  1141.     # <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A> program
  1142.     Variable "AUTH_TYPE=$x"
  1143.     Variable "CONTENT_LENGTH=$Y"
  1144.     Variable "CONTENT_TYPE=$C"
  1145.     Variable "HTTPS=$g"
  1146.     Variable "&if($K,HTTPS_KEYSIZE=$K,)"
  1147.     Variable "&if($K,HTTPS_SECRETKEYSIZE=$G,)"
  1148.     Variable "GATEWAY_INTERFACE=CGI/1.1"
  1149.     Variable "PATH_INFO=$I"
  1150.     Variable "PATH_TRANSLATED=$Z"
  1151.     Variable "QUERY_STRING=$q"
  1152.     Variable "REMOTE_ADDR=$A"
  1153.     Variable "REMOTE_HOST=$h"
  1154.     Variable "REMOTE_IDENT=$i"
  1155.     Variable "REMOTE_USER=$u"
  1156.     Variable "REQUEST_METHOD=$m"
  1157.     Variable "SCRIPT_NAME=$z"
  1158.     Variable "SERVER_NAME=$v"
  1159.     Variable "SERVER_PORT=&if($p,$p,&if($K,443,80))"
  1160.     Variable "SERVER_PROTOCOL=$H"
  1161.     Variable "SERVER_SOFTWARE=$S"
  1162.     ExtraHeaders Yes
  1163.     ExtraHeadersPrefix "HTTP_"
  1164.     ExtraHeadersIgnore "Content-Type Content-Length"
  1165.     SendCRLF Yes
  1166. </Object>
  1167.  
  1168. # ---
  1169. #
  1170. # WinCGI
  1171. #
  1172. # Handle windows <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A>
  1173. #
  1174. # ---
  1175. <Object>
  1176.     Name WinCGI
  1177.     Class CGIClass
  1178.     FileIOObject CGIFileIOObject
  1179.     DefaultCommandLine "%p %d"
  1180.     IncludeParentsEnvironment Yes
  1181.     EnvironmentSize 8192
  1182.     Variable "AUTH_TYPE=$x"
  1183.     Variable "CONTENT_LENGTH=$Y"
  1184.     Variable "CONTENT_TYPE=$C"
  1185.     Variable "HTTPS=$g"
  1186.     Variable "&if($K,HTTPS_KEYSIZE=$K,)"
  1187.     Variable "&if($K,HTTPS_SECRETKEYSIZE=$G,)"
  1188.     Variable "GATEWAY_INTERFACE=CGI/1.1"
  1189.     Variable "PATH_INFO=$I"
  1190.     Variable "PATH_TRANSLATED=$Z"
  1191.     Variable "QUERY_STRING=$q"
  1192.     Variable "REMOTE_ADDR=$A"
  1193.     Variable "REMOTE_HOST=$h"
  1194.     Variable "REMOTE_IDENT=$i"
  1195.     Variable "REMOTE_USER=$u"
  1196.     Variable "REQUEST_METHOD=$m"
  1197.     Variable "SCRIPT_NAME=$z"
  1198.     Variable "SERVER_NAME=$v"
  1199.     Variable "SERVER_PORT=&if($p,$p,&if($K,443,80))"
  1200.     Variable "SERVER_PROTOCOL=$H"
  1201.     Variable "SERVER_SOFTWARE=$S"
  1202.     ExtraHeaders Yes
  1203.     ExtraHeadersPrefix "HTTP_"
  1204.     ExtraHeadersIgnore "Content-Type Content-Length"
  1205.  
  1206.     # Generate windows <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A> filenames by preappending the
  1207.     # process id to the unique identifier.
  1208.     DataFile "cgi-temp/$P_%u.ini"
  1209.     StdinFile "cgi-temp/$P_%u.in"
  1210.     StdoutFile "cgi-temp/$P_%u.out"
  1211.     DataBlock "\
  1212. [CGI]$M\
  1213. Request Protocol=$H$M\
  1214. Request Method=$m$M\
  1215. Physical Path=$f$M\
  1216. <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A> Version=CGI/1.1 (Win)$M\
  1217. Content Type=$C/* short for  &dblookup(request,rfc822,Content-Type)*/$M\
  1218. Content Length=$Y/* short for &dblookup(request,rfc822,Content-Length)*/$M\
  1219. $M\
  1220. [Accept]$M\
  1221. $M\
  1222. [System]$M\
  1223. Output File=%o$M\
  1224. Content File=%i$M\
  1225. $M\
  1226. [Accept]$M\
  1227. $M\
  1228. [Extra Headers]$M\
  1229. $M\
  1230. [Form Literal]$M\
  1231. $M\
  1232. [Form External]$M\
  1233. $M\
  1234. [Form File]$M\
  1235. $M\
  1236. [Form Huge]$M\
  1237. $M\
  1238. "
  1239.     SendCRLF Yes
  1240. </Object>
  1241.  
  1242. </PRE></BODY></HTML>