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

  1. <HTML><TITLE>Features.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. #
  189. # Features.pi3
  190. #
  191. #    Showcase features of Pi3Web server. Use this configuration
  192. #    only for personal or workgroup use. Its not optimal
  193. #    for use on the public internet. Here's why:
  194. #
  195. #        - Performance is slower because of all the extra
  196. #    handlers that are added in and the funky things that they
  197. #    do.
  198. #
  199. #        - Bigger and more complex is less secure against
  200. #    attack than smaller and featureless. The server created
  201. #    by this configuration is bigger and more complex.
  202. #
  203. # ===
  204.  
  205.  
  206. #
  207. # Load library definitions for classes used here.
  208. #
  209. include ../Conf/HTTP.cnf
  210. include ../Conf/Fcgi.cnf
  211. include ../Conf/Plugins.cnf
  212. include ../Conf/ISAPI.cnf
  213.  
  214. # ---
  215. #
  216. # Documentation is handled as HTML regardless of file extension. Also,
  217. # files have headers and footers attached to make them pretty.
  218. #
  219. # ---
  220. <Object>
  221.     Name DocumentMapper
  222.     Class PathMapperClass
  223.     #
  224.     # leave calling card
  225.     #
  226.     <A HREF="/pidocs/Objects/HTTP.html#Action">Action</A> "&dbreplace(response,string,ObjectMap,Pi3Docs)"
  227. </Object>
  228.  
  229. # ---
  230. #
  231. # CGIMapper
  232. #
  233. #    Instance of PathMapperClass to Map <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A> URLs
  234. #
  235. #    <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A> Scripts set PATH_INFO. 
  236. #
  237. # ---
  238. <Object>
  239.     Name CGIMapper
  240.     Class PathMapperClass
  241.     CaseSensitive "No"
  242.     #
  243.     # Subdirectories below the mapping directory should be put in path info
  244.     #
  245.     PathInfo "Yes"
  246.     #
  247.     # Set the 'ObjectMap' variable in the response DB if this map is
  248.     # successful
  249.     #
  250.     <A HREF="/pidocs/Objects/HTTP.html#Action">Action</A> "&dbreplace(response,string,ObjectMap,Scripts)"
  251. </Object>
  252.  
  253. # ---
  254. #
  255. # WinCGIMapper and FCGIMapper
  256. #
  257. #     Like CGIMapper, except it leaves a different marker to cause
  258. #     a different object to handle the request.
  259. #
  260. # ---
  261. <Object>
  262.     Name WinCGIMapper
  263.     Class PathMapperClass
  264.     PathInfo "Yes"
  265.     <A HREF="/pidocs/Objects/HTTP.html#Action">Action</A> "&dbreplace(response,string,ObjectMap,WinScripts)"
  266. </Object>
  267. <Object>
  268.     Name FCGIMapper
  269.     Class PathMapperClass
  270.     PathInfo "Yes"
  271.     <A HREF="/pidocs/Objects/HTTP.html#Action">Action</A> "&dbreplace(response,string,ObjectMap,FastCGIScripts)"
  272. </Object>
  273.  
  274. # ---
  275. #
  276. # AdminMapper
  277. #
  278. # For protected spaces
  279. #
  280. # ---
  281. <Object>
  282.     Name AdminMapper
  283.     Class PathMapperClass
  284.  
  285.     #
  286.     # Set the authentication realm so the <A HREF="/pidocs/Objects/HTTP.html#BasicAuth">BasicAuth</A> handler kicks in
  287.     <A HREF="/pidocs/Objects/HTTP.html#Action">Action</A> "&dbreplace(response,string,AuthenticationRealm,Admin)"
  288. </Object>
  289.  
  290. # ---
  291. #
  292. # AccessLogger
  293. #
  294. #    An instance of ExpressionLoggerClass configured to generate an 
  295. #    logfile
  296. #
  297. # ---
  298. <Object>
  299.     Name AccessLogger
  300.     Class ExpressionLoggerClass
  301.  
  302.     #
  303.     # Append
  304.     #
  305.     OpenMode "a"
  306.     #
  307.     # Line to log 
  308.     Expression "$A $h - [$t] \"$r\" $s $b$M"
  309. </Object>
  310.  
  311. # ---
  312. #
  313. # Start
  314. #
  315. #    Handle initial phases of requests, typically before we have enough
  316. #    information to select different execution paths
  317. #
  318. # ---
  319. <Object>
  320.     Name Start
  321.     Class FlexibleHandlerClass
  322.     Init <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  323.     Headers <A HREF="/pidocs/Objects/HTTP.html#ReadRequestHeaders">ReadRequestHeaders</A>
  324.  
  325.     #
  326.     # The handler 'VirtualHosts' is described below
  327.     #
  328.     HostMap VirtualHosts
  329.  
  330.     #
  331.     # Mapping virtual paths to example directory with 'DirListType' set
  332.     #
  333.     Mapping DirectoryMappings
  334.  
  335.     #
  336.     # Default mappings
  337.     #
  338.     Mapping <A HREF="/pidocs/Objects/HTTP.html#MapToErrorDocument">MapToErrorDocument</A> \
  339.         IgnoreStatus="0 200" \
  340.         DefaultMessage="/errors/unknown.htm" \
  341.         301="/errors/301.ssi" \
  342.         304="/errors/304.htm" \
  343.         400="/errors/400.htm" \
  344.         401="/errors/401.ssi" \
  345.         403="/errors/403.ssi" \
  346.         404="/errors/404.ssi" \
  347.         500="/errors/500.ssi" \
  348.         501="/errors/501.htm"
  349.     Mapping <A HREF="/pidocs/Objects/Plugins.html#UserDirectory">UserDirectory</A> UserDirectoryRoot="/home/" \
  350.         HTMLDirectory="/public_html"
  351.     Mapping CGIMapper From="/cgi-bin/" To="cgi-bin/"
  352.     Mapping WinCGIMapper From="/cgi-win/" To="cgi-win/"
  353.     Mapping FCGIMapper From="/cgi-fcgi/" To="cgi-fcgi/"
  354.     Mapping DocumentMapper From="/pidocs/" To="Pi3Docs/" 
  355.     Mapping <A HREF="/pidocs/Objects/HTTP.html#PathMapper">PathMapper</A> From="/errors/" To="Fragment/" 
  356.     Mapping <A HREF="/pidocs/Objects/HTTP.html#PathMapper">PathMapper</A> From="/icons/" To="Icons/" 
  357.  
  358. # mapping to view logfiles disabled
  359. #    Mapping <A HREF="/pidocs/Objects/HTTP.html#PathMapper">PathMapper</A> From="/logs/" To="Logs/" 
  360.  
  361.     Mapping AdminMapper From="/admin/" To="Logs/" 
  362.     Mapping <A HREF="/pidocs/Objects/HTTP.html#PathMapper">PathMapper</A> From="/Pi3Expressions/" To="**internal**/" \
  363.         Action="&dbreplace(response,string,ObjectMap,Pi3Expr)" \
  364.         PathInfo="Yes"
  365.     Mapping <A HREF="/pidocs/Objects/HTTP.html#PathMapper">PathMapper</A> From="/isapi/" To="Isapi/" \
  366.         Action="&dbreplace(response,string,ObjectMap,ISAPI)" \
  367.         PathInfo="Yes"
  368.  
  369.     #
  370.     # Mapping specific to Host2
  371.     #
  372.     Mapping Host2Mappings
  373.  
  374.     #
  375.     # Mapping specific to MainVirtualHostInformation
  376.     #
  377.     Mapping Host1Mappings
  378. </Object>
  379.  
  380. # ---
  381. #
  382. # Default
  383. #
  384. #    Handle requests that other handlers have passed up
  385. #
  386. # ---
  387. <Object>
  388.     Name Default
  389.     Class FlexibleHandlerClass
  390.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#DirectoryExists">DirectoryExists</A> IndexFile="index.html" IndexFile="index.htm"
  391.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="EF" RefuseStatus=404
  392.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="F" RefuseStatus=403
  393.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  394.     CheckAuth <A HREF="/pidocs/Objects/HTTP.html#BasicAuth">BasicAuth</A> Realm="Admin"
  395.     CheckAuth <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  396.     CheckAccess <A HREF="/pidocs/Objects/HTTP.html#AccessByFile">AccessByFile</A> RequirePermissions="R"
  397.  
  398.     #
  399.     # Cause a '501 Not Implemented' Message for requests that
  400.     # are not 'GET' or 'HEAD', i.e.
  401.     #    if !( Method=='GET' || Method=='HEAD' ) 
  402.     #    then
  403.     #        set status = 501
  404.     #    endif
  405.     #
  406.     CheckType Condition="¬(&or(&cmpi($m,GET),&cmpi($m,HEAD)))" \
  407.         <A HREF="/pidocs/Objects/HTTP.html#StatusCode">StatusCode</A> StatusCode="501"
  408.     CheckType <A HREF="/pidocs/Objects/HTTP.html#ConditionalGet">ConditionalGet</A>
  409.     CheckType <A HREF="/pidocs/Objects/HTTP.html#CheckForDirectory">CheckForDirectory</A> SetType="internal/x-directory"
  410.  
  411.     #
  412.     # Otherwise: Set the media type based on the file extension
  413.     #
  414.     CheckType <A HREF="/pidocs/Objects/HTTP.html#MIMETypeByExtension">MIMETypeByExtension</A> 
  415.  
  416.     #
  417.     # Return 'COMPLETED' so an internal error will not be raised
  418.     #
  419.     CheckType <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode="COMPLETED"
  420.  
  421.     #
  422.     # Most requests refer to a file, so put that first 
  423.     #
  424.     # Handle the request by sending a file if
  425.     #    - The Value of ObjectMap in the response DB is ""
  426.     #    AND
  427.     #    - The Media type of the resource does not match internal/* 
  428.     #
  429.     Handle Condition="&and(¬(&dblookup(response,string,ObjectMap)),\
  430. ¬(®exp('internal/*',$c)))" <A HREF="/pidocs/Objects/HTTP.html#SendFile">SendFile</A>
  431.     Handle Condition="&cmp($c,internal/x-directory)" DirectoryIndexes
  432.     Handle Condition="&cmp($c,internal/x-server-parsed-html)" <A HREF="/pidocs/Objects/HTTP.html#SendSSI">SendSSI</A> \
  433.         Exec=Yes ExecFileFixup="\
  434. /* exec file="" maps to Standard <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A> (Scripts) */\
  435. &dbreplace(response,string,ObjectMap,Scripts)\
  436. &dbreplace(response,rfc822,Content-Type,internal/x-cgi)"
  437.     Handle Condition="&cmp($c,internal/x-imagemap)" <A HREF="/pidocs/Objects/Plugins.html#ImageMap">ImageMap</A>
  438.     Handle <A HREF="/pidocs/Objects/HTTP.html#SendFile">SendFile</A>
  439.     Log AccessLogger File="Logs/access.txt"
  440.     Log <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  441.     Destroy <A HREF="/pidocs/Objects/HTTP.html#DeleteTemporaryFiles">DeleteTemporaryFiles</A>
  442. </Object>
  443.  
  444. # ---
  445. #
  446. # Documentation
  447. #
  448. #    Handler sequence for documentation.
  449. #
  450. # ---
  451. <Object>
  452.     Name Documentation
  453.     Class FlexibleHandlerClass
  454.  
  455.     #
  456.     # Only execute this sequence for the documentation (check for
  457.     # the appropriate marker).
  458.     #
  459.     # Don't handle special resource types (internal/...)
  460.     #
  461.     Condition "&and(&cmp(&dblookup(response,string,ObjectMap),Pi3Docs),\
  462. ¬(®exp('internal/*',$c)))"
  463.  
  464.     #
  465.     # Check if file is a directory
  466.     # 
  467.     CheckType <A HREF="/pidocs/Objects/HTTP.html#CheckForDirectory">CheckForDirectory</A> SetType="internal/x-directory"
  468.  
  469.     #
  470.     # Lookup media type by extension
  471.     #
  472.     CheckType <A HREF="/pidocs/Objects/HTTP.html#MIMETypeByExtension">MIMETypeByExtension</A>
  473.  
  474.     #
  475.     # Force all non-internal media types to 'text/html'
  476.     #
  477.     CheckType Condition="¬(®exp('internal/*',$c))" <A HREF="/pidocs/Objects/HTTP.html#Action">Action</A> \
  478.         Pi3Expression="&dbreplace(response,rfc822,Content-Type,text/html)"
  479.  
  480.     #
  481.     # Return 'COMPLETED' so as not to fall into other cases
  482.     #
  483.     CheckType <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode="COMPLETED"
  484.  
  485.     #
  486.     # For documentation, Send documentation with header and footer
  487.     #
  488.     Handle <A HREF="/pidocs/Objects/HTTP.html#SendFile">SendFile</A> HeaderPattern="<BODY BACKGROUND="/icons/\
  489. &if(&cmpi($o,MainVirtualHostInformation),Pi3Tile.gif,H2Tile.gif)"/*background depends on vhost*/\
  490. BGCOLOR="#FFFFFF">\n"
  491. </Object>
  492.  
  493. # ---
  494. #
  495. # FastCGIIOObject
  496. # IOObject for communicating with fast <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A> application servers. This
  497. # one uses the TCP/IP transport.
  498. #
  499. # ---
  500. <Object>
  501.     Name FastCGIIOObject
  502.     Class TCPIPIOClass
  503.     Type Active
  504.  
  505.     # Timeouts. -1 specifies no timeout.
  506.     RecvTimeout 20
  507.     SendTimeout 20
  508. </Object>
  509.  
  510. # ---
  511. # Scripts, WinScripts, ISAPI, FastCGIScripts, Pi3Expr
  512. #
  513. #    Handler sequences for resources which have mapped to these
  514. #     respective types
  515. #
  516. # ---
  517. <Object>
  518.     Name Scripts
  519.     Class FlexibleHandlerClass
  520.     Condition "&cmp(&dblookup(response,string,ObjectMap),Scripts)"
  521.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="EFD" RefuseStatus=404
  522.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="F" RefuseStatus=403
  523.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  524.     CheckAccess <A HREF="/pidocs/Objects/HTTP.html#AccessByFile">AccessByFile</A> RequirePermissions="X"
  525.     CheckType <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  526.     Handle StandardCGI
  527. </Object>
  528. <Object>
  529.     Name WinScripts
  530.     Class FlexibleHandlerClass
  531.     Condition "&cmp(&dblookup(response,string,ObjectMap),WinScripts)"
  532.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="EFD" RefuseStatus=404
  533.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="F" RefuseStatus=403
  534.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  535.     CheckAccess <A HREF="/pidocs/Objects/HTTP.html#AccessByFile">AccessByFile</A> RequirePermissions="X"
  536.     CheckType <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  537.     Handle WinCGI
  538. </Object>
  539. <Object>
  540.     Name ISAPI
  541.     Class FlexibleHandlerClass
  542.     Condition "&cmp(&dblookup(response,string,ObjectMap),ISAPI)"
  543.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="EFD" RefuseStatus=404
  544.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="F" RefuseStatus=403
  545.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  546.     CheckAccess <A HREF="/pidocs/Objects/HTTP.html#AccessByFile">AccessByFile</A> RequirePermissions="X"
  547.     CheckType <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  548.     Handle <A HREF="/pidocs/Objects/ISAPI.html#ISAPI20">ISAPI20</A>
  549. </Object>
  550. <Object>
  551.     Name FastCGIScripts
  552.     Class FlexibleHandlerClass
  553.     Condition "&cmp(&dblookup(response,string,ObjectMap),FastCGIScripts)"
  554.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="EFD" RefuseStatus=404
  555.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#RefuseFileByMask">RefuseFileByMask</A> AllowFileMask="F" RefuseStatus=403
  556.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  557.     CheckAccess <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode="COMPLETED"
  558.     CheckType <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode="COMPLETED"
  559.     Handle <A HREF="/pidocs/Objects/Fcgi.html#FastCGI">FastCGI</A> \
  560.         IOObject="FastCGIIOObject" \
  561.         Variable="AUTH_TYPE=$x" \
  562.         Variable="CONTENT_LENGTH=$Y" \
  563.         Variable="CONTENT_TYPE=$C" \
  564.         Variable="HTTPS=$g" \
  565.         Variable="&if($K,HTTPS_KEYSIZE=$K,)" \
  566.         Variable="&if($K,HTTPS_SECRETKEYSIZE=$G,)" \
  567.         Variable="PATH_INFO=$I" \
  568.         Variable="PATH_TRANSLATED=$Z" \
  569.         Variable="QUERY_STRING=$q" \
  570.         Variable="REMOTE_ADDR=$A" \
  571.         Variable="REMOTE_HOST=$h" \
  572.         Variable="REMOTE_IDENT=$i" \
  573.         Variable="REMOTE_USER=$u" \
  574.         Variable="REQUEST_METHOD=$m" \
  575.         Variable="SCRIPT_NAME=$z" \
  576.         Variable="SERVER_NAME=$v" \
  577.         Variable="SERVER_PORT=&if($p,$p,&if($K,443,80))" \
  578.         Variable="SERVER_PROTOCOL=$H" \
  579.         Variable="SERVER_SOFTWARE=$S"
  580. </Object>
  581. <Object>
  582.     Name Pi3Expr
  583.     Class FlexibleHandlerClass
  584.     Condition "&cmp(&dblookup(response,string,ObjectMap),Pi3Expr)"
  585.     CheckPath <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode="COMPLETED"
  586.     CheckAccess <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode="COMPLETED"
  587.     CheckType <A HREF="/pidocs/Objects/HTTP.html#ReturnCode">ReturnCode</A> ReturnCode=COMPLETED
  588.     Handle <A HREF="/pidocs/Objects/HTTP.html#SendPi3Expression">SendPi3Expression</A> HTTPEquiv="Content-Type: text/html" \
  589.         Pi3Expression="\
  590. /*                                             */\
  591. /*                                             */\
  592. /* A Large <A HREF="/pidocs/Objects/Pi3API.html#Pi3Expression">Pi3Expression</A> to send to the client */\
  593. /*              in one go                      */\
  594. /*                                             */\
  595. /*   This will generate a dynamic HTML page    */\
  596. /*                                             */\
  597. <TITLE>Pi3Expressions - DB Dump</TITLE>\
  598. <HTML><BODY BACKGROUND="/icons/Pi3Tile.gif">\
  599. <CENTER><H2>Pi3Expressions - DB Dump</H2>\
  600. <A NAME="index">$M\
  601. <UL>$M\
  602. <LI><A HREF="#connection">Connection DB</A>$M\
  603. <LI><A HREF="#request">Request DB</A>$M\
  604. <LI><A HREF="#response">Response DB</A>$M\
  605. <LI><A HREF="#host">Host DB</A>$M\
  606. </UL>$M\
  607. <HR>$M\
  608. <A NAME="connection">$M\
  609. <H3>Dump of Connection DB <I>dblookup(connection,...)</I></H3>$M\
  610. <TABLE BORDER=1 CELLPADDING=5><TH>Type<TH>Variable<TH>Value$M\
  611. &dblookup(connection,string,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  612. &dblookup(connection,rfc822,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  613. &dblookup(connection,opaque,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  614. </TABLE>\
  615. <A HREF="#index">Index</A>$M\
  616. <HR>$M\
  617. <A NAME="request">$M\
  618. <H3>Dump of Request DB <I>dblookup(request,...)</I></H3>$M\
  619. <TABLE BORDER=1 CELLPADDING=5><TH>Type<TH>Variable<TH>Value$M\
  620. &dblookup(request,string,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  621. &dblookup(request,rfc822,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  622. &dblookup(request,opaque,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  623. </TABLE>\
  624. <A HREF="#index">Index</A>$M\
  625. <HR>$M\
  626. <A NAME="response">$M\
  627. <H3>Dump of Response DB <I>dblookup(response,...)</I></H3>$M\
  628. <TABLE BORDER=1 CELLPADDING=5><TH>Type<TH>Variable<TH>Value$M\
  629. &dblookup(response,string,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  630. &dblookup(response,rfc822,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  631. &dblookup(response,opaque,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  632. </TABLE>\
  633. <A HREF="#index">Index</A>$M\
  634. <HR>$M\
  635. <A NAME="host">$M\
  636. <H3>Dump of Host DB <I>dblookup(host,...)</I></H3>$M\
  637. <TABLE BORDER=1 CELLPADDING=5><TH>Type<TH>Variable<TH>Value$M\
  638. &dblookup(host,string,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  639. &dblookup(host,rfc822,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  640. &dblookup(host,opaque,,,<TR><TD><B>&_(2)</B><TD>&_(1)<TD>&_()$M)\
  641. </TABLE>\
  642. <A HREF="#index">Index</A>$M\
  643. </CENTER><HR></BODY></HTML>"
  644.  
  645. </Object>
  646.  
  647. # ---
  648. #
  649. #    Virtual hosting handlers and configuration
  650. #
  651. # ---
  652.  
  653. #
  654. # Host2 Virtual host object
  655. <Object>
  656.     Name Host2
  657.     Class VirtualHostClass
  658.     Administrator mr_web@Host2.dom
  659.     HostName www.johnroy.com/host2
  660.     ServerPort 80
  661. </Object>
  662.  
  663. #
  664. # Virtual host mappings
  665. #
  666. <Object>
  667.     Name VirtualHosts
  668.     Class FlexibleHandlerClass
  669.  
  670.     #
  671.     # if the URL starts with '/host2/' assign to virtual host 2
  672.     #
  673.     HostMap <A HREF="/pidocs/Objects/HTTP.html#VirtualHostByURL">VirtualHostByURL</A> VirtualHostObject="Host2" URLPath="/host2/"
  674.  
  675.     #
  676.     # Introduce a mapping
  677.     Mapping Host2Mappings
  678. </Object>
  679.  
  680. #
  681. # Override some mappings for Host2 only
  682. #
  683. <Object>
  684.     Name Host2Mappings
  685.     Class FlexibleHandlerClass
  686.  
  687.     #
  688.     # These mappings only apply to Host2
  689.     #
  690.     Condition "&cmp($o,Host2)"
  691.  
  692.     #
  693.     # map to second document root
  694.     #
  695.     Mapping <A HREF="/pidocs/Objects/HTTP.html#PathMapper">PathMapper</A> From="/" To="WebRoot2/"
  696. </Object>
  697.  
  698. #
  699. # Host1 mappings
  700. #
  701. <Object>
  702.     Name Host1Mappings
  703.     Class FlexibleHandlerClass
  704.     #
  705.     # These mappings only apply to MainVirtualHostInformation
  706.     #
  707.     Condition "&cmp($o,MainVirtualHostInformation)"
  708.     #
  709.     # map to first document root
  710.     #
  711.     Mapping <A HREF="/pidocs/Objects/HTTP.html#PathMapper">PathMapper</A> From="/" To="WebRoot/"
  712. </Object>
  713.  
  714. # ---
  715. #
  716. # HTTPLogicObject
  717. #
  718. #     HTTP Logic object, dispatches requests to all other handlers
  719. #
  720. # ---
  721. <Object>
  722.     Name HTTPLogicObject
  723.     Class HTTPDispatcherClass
  724.     Handlers Start Scripts WinScripts FastCGIScripts Documentation Pi3Expr ISAPI Default
  725.     KeepOpen On
  726.     ServerRoot ./../
  727.     ServerStamp Pi3Web/0.9b4
  728.     DefaultHost MainVirtualHostInformation
  729.     MIMEFile "Fragment/Mime.typ"
  730.     DefaultMIMEType "application/octet-stream"
  731.     ErrorLogFile "Logs/error.txt"
  732.  
  733.     # Specifying a file for DebugLogFile effectively turns on debugging
  734. #    DebugLogFile "Logs/debug.txt"
  735.  
  736.     #
  737.     # The following to directives specify expressions to be logged
  738.     # before and after each handler execution respectively.
  739.     # The expression as given logs process/thread and handler context
  740.     # information indented to the nested handler level.
  741.     #
  742.     # Timing information is also given for performance tuning.
  743.     #
  744.     # This logging information is EXTREMELY verbose. Don't even
  745.     # think about using it in a production server
  746.     #
  747.     DebugBeforeHandler "[$P:$k] &align(,$X)&align(,$X) |--> $T \
  748. -------- &align($N,12) &align($R,12) $n \"$r\" $s"
  749.     DebugAfterHandler "[$P:$k] &align(,$X)&align(,$X) |<-- $T \
  750. &align($D,8) &align($N,12) &align($R,12) $n \"$r\" $s"
  751. </Object>
  752.  
  753. # ---
  754. #
  755. #    Directory listing handlers and configuration
  756. #
  757. # ---
  758. <Object>
  759.     Name DirectoryMappings
  760.     Class FlexibleHandlerClass
  761.  
  762.     #
  763.     # 1..Simple HTML
  764.     #
  765.     # simple HTML, no icons or descriptions
  766.     Mapping DocumentMapper From="/dir_SimpleHTML/" To="Pi3Docs/features/" \
  767.         Action="&dbreplace(response,string,DirListType,SimpleHTML)"
  768.  
  769.     #
  770.     # 2..Simple DOS like format with alternate name
  771.     # 
  772.     Mapping DocumentMapper From="/dir_DOS/" To="Pi3Docs/features/" \
  773.         Action="&dbreplace(response,string,DirListType,DOS)"
  774.  
  775.     #
  776.     # 3..Fixed pitch HTML with icons and descriptions
  777.     # plain HTML
  778.     Mapping DocumentMapper From="/dir_TableHTML/" \
  779.         To="Pi3Docs/features/" \
  780.         Action="&dbreplace(response,string,DirListType,TableHTML)"
  781.  
  782.     #
  783.     # 4..HTML with tables
  784.     #
  785.     # HTML with tables
  786.     Mapping DocumentMapper From="/dir_PlainHTML/" To="Pi3Docs/features/" \
  787.         Action="&dbreplace(response,string,DirListType,PlainHTML)"
  788.  
  789.     # 
  790.     # 5..Raw tab delimited text
  791.     #
  792.     # Tab delimited text
  793.     Mapping DocumentMapper From="/dir_TDT/" To="Pi3Docs/features/" \
  794.         Action="&dbreplace(response,string,DirListType,TDT)"
  795. </Object>
  796.  
  797. #
  798. # Directory Indexes
  799. #
  800. <Object>
  801.     Name DirectoryIndexes
  802.     Class FlexibleHandlerClass
  803.  
  804.     # 1..Simple HTML
  805.     Handle Condition="&cmp(&dblookup(response,string,DirListType),SimpleHTML)" \
  806.         SimpleHTML
  807.  
  808.     # 2..Simple DOS format
  809.     Handle Condition="&cmp(&dblookup(response,string,DirListType),DOS)" DOS
  810.  
  811.     # 3..Plain HTML
  812.     Handle Condition="&cmp(&dblookup(response,string,DirListType),PlainHTML)" \
  813.         PlainHTML 
  814.  
  815.     # 4..HTML with tables
  816.     Handle Condition="&cmp(&dblookup(response,string,DirListType),TableHTML)" \
  817.          TableHTML 
  818.  
  819.     # 5..Raw tab delimited text
  820.     Handle Condition="&cmp(&dblookup(response,string,DirListType),TDT)" TDT
  821.  
  822.     #
  823.     # The default index type used for examples other than the
  824.     # sample directory will be a table HTML index
  825.     #
  826.     Handle TableHTML
  827. </Object>
  828.  
  829. # ---
  830. #
  831. # Simple HTML
  832. #
  833. # ---
  834. <Object>
  835.     Name SimpleHTML
  836.     Class DirectoryIndexClass
  837.     HeaderPattern "<HTML><TITLE>Simple index of %p</TITLE>\
  838. <H2>Simple index of %p</H2>\n"
  839.     ListTop "\
  840. <PRE><B>\
  841. &align(Name,23) \
  842. &align(Size,6)  \
  843. &align(Last Modified,18)\
  844. \n<HR SIZE=1 NOSHADE></B>\n"
  845.     FilePattern "\
  846. <A HREF="%r">&align(&abbrev(%n,23,...)</A>,27) /*    link to file */\
  847. &align(%s,6)  /*                                    size */\
  848. &align(%l,18)/*                                        last modified date */\
  849. \n"
  850.     LastModifiedFormat "%d-%b-%y %H:%M"
  851.     Include "*"
  852.     SwapFileName ".. Parent Directory"
  853.     ListBottom "</PRE>\n"
  854.     FooterPattern "<HR SIZE=1 NOSHADE>\
  855. Contact the hostmaster <A HREF="mailto:$a"<I>$a</I></A>.\
  856. </HTML>"
  857.     HeaderFile "HEADER"
  858.     FooterFile "README"
  859.     Exclude "."
  860.     Exclude "~*"
  861.     Exclude ".desc"
  862.     Exclude "README"
  863.     Exclude "HEADER"
  864.     Options " Name | Size | RelPath "
  865. </Object>
  866.  
  867. # ---
  868. #
  869. # Simple DOS formatted index
  870. #
  871. # ---
  872. <Object>
  873.     Name DOS
  874.     Class DirectoryIndexClass
  875.     HeaderPattern "<HTML><TITLE>DOS style index of %p - </TITLE>\
  876. <H2>DOS style index of %p - </H2>\n\
  877. "
  878.     ListTop "<PRE>\
  879. &align(Last Modified,24,left)\
  880. &align(Size,14) \
  881. &align('(8,3) Name',12) \
  882. Name \n<HR SIZE=1 NOSHADE>"
  883.     FilePattern "\
  884. &align(%l,24)\
  885. &if(%b,&align('<DIR>',18,left),&align(%s,14,right)) \
  886. <A HREF="%r">&align(&abbrev(%a,12,...)</A>,16,left) \
  887. <A HREF="%r">%n</A> \n"
  888.     LastModifiedFormat "%d/%m/%y  %I:%M%p"
  889.     Include "*"
  890.     DescriptionFile ".desc"
  891.     ListBottom "</PRE>\n"
  892.     FooterPattern "<HR SIZE=1 NOSHADE>\
  893. Contact the hostmaster <A HREF="mailto:$a"<I>$a</I></A>.\
  894. </HTML>"
  895.     HeaderFile "HEADER"
  896.     FooterFile "README"
  897.     Exclude "."
  898.     Exclude "~*"
  899.     Exclude ".desc"
  900.     Exclude "README"
  901.     Exclude "HEADER"
  902.     Options " AltName | Name | FormatSize | RelPath "
  903. </Object>
  904.  
  905. # ---
  906. #
  907. # Plain HTML directory listing with icons
  908. #
  909. # ---
  910. <Object>
  911.     Name PlainHTML
  912.     Class DirectoryIndexClass
  913.     HeaderPattern "<HTML><TITLE>Plain HTML index of %p</TITLE>\
  914. <BODY BACKGROUND="/icons/\
  915. &if(&cmpi($o,MainVirtualHostInformation),Pi3Tile.gif,H2Tile.gif)"/*background depends on vhost*/\
  916. BGCOLOR="#FFFFFF">\
  917. <H2>Plain HTML index of %p</H2>\n"
  918.     ListTop "\
  919. <PRE>\
  920. <IMG SRC="/icons/blank.gif" BORDER=NONE ALT="  ">\
  921.  &align(Name,23) &align(Last Modified,18)\
  922. &align(Size,6)  Description\n<HR SIZE=1 NOSHADE>"
  923.     FilePattern "\
  924. <A HREF="%r"><IMG SRC="%i" BORDER=NONE ALT="[]"></A>/*icon is a link */\
  925.  <A HREF="%r">&align(&abbrev(%n,23,...)</A>,27) /*    link to file */\
  926. &align(%l,18)/*                                        last modified date */\
  927. &align(%s,6)  /*                                    size */\
  928. &if(%d,%d,<I>%c</I>)/*                                description, or MIME */\
  929. \n"
  930.     LastModifiedFormat "%d-%b-%y %H:%M"
  931.     Include "*"
  932.     MIMEIcon "text/html /icons/layout.gif"
  933.     MIMEIcon "text/x-code /icons/c.gif"
  934.     MIMEIcon "text/x-perl /icons/p.gif"
  935.     MIMEIcon "text/* /icons/text.gif"
  936.     MIMEIcon "internal/x-directory /icons/folder.gif"
  937.     MIMEIcon "audio/* /icons/sound2.gif"
  938.     MIMEIcon "image/* /icons/image2.gif"
  939.     MIMEIcon "application/x-uuencoded /icons/uuencoded.gif"
  940.     MIMEIcon "application/x-tar /icons/compressed.gif"
  941.     MIMEIcon "application/x-gzip /icons/compressed.gif"
  942.     MIMEIcon "application/x-sh /icons/script.gif"
  943.     MIMEIcon "application/* /icons/binary.gif"
  944.     MIMEIcon "x-world/x-vrml /icons/burst.gif"
  945.     MIMEIcon "*/* /icons/unknown.gif"
  946.     DescriptionFile ".desc"
  947.     SwapFileName ".. Parent Directory"
  948.     ListBottom "</PRE>\n"
  949.     FooterPattern "<HR SIZE=1 NOSHADE>\
  950. Contact the hostmaster <A HREF="mailto:$a"<I>$a</I></A>.\
  951. </BODY></HTML>"
  952.     HeaderFile "HEADER"
  953.     FooterFile "README"
  954.     Exclude "."
  955.     Exclude "~*"
  956.     Exclude ".desc"
  957.     Exclude "README"
  958.     Exclude "HEADER"
  959.     Options " Name | AbbrevSize | RelPath | Icon | MIMEType "
  960. </Object>
  961.  
  962. # ---
  963. #
  964. # Directory listing with HTML tables
  965. #
  966. # ---
  967. <Object>
  968.     Name TableHTML
  969.     Class DirectoryIndexClass
  970.     HeaderPattern "<HTML><TITLE>Enhanced HTML index of %p</TITLE>\
  971. <BODY BACKGROUND="/icons/\
  972. &if(&cmpi($o,MainVirtualHostInformation),Pi3Tile.gif,H2Tile.gif)"/*background depends on vhost*/\
  973. BGCOLOR="#FFFFFF">\
  974. <H2>Enhanced HTML index of %p</H2>\n"
  975.     ListTop "<CENTER><TABLE CELLSPACING=0 CELLPADDING=0 WIDTH=100'%'>\
  976. <TR>\
  977. <TH NOWARP ALIGN=LEFT>\
  978. <IMG SRC="/icons/blank.gif" ALIGN=MIDDLE BORDER=NONE ALT="">\
  979. <TH NOWRAP ALIGN=LEFT>Name<BR><HR SIZE=1 NOSHADE>\
  980. <TH NOWRAP ALIGN=LEFT>Size<BR><HR SIZE=1 NOSHADE>\
  981. <TH NOWRAP ALIGN=LEFT>Last Modified<BR><HR SIZE=1 NOSHADE>\
  982. <TH NOWRAP ALIGN=LEFT>Description<BR><HR SIZE=1 NOSHADE>\n"
  983.     FilePattern "<TR>\
  984. <TD NOWRAP ALIGN=LEFT VALIGN=TOP>\
  985. <A HREF="%r"><IMG SRC="%i" BORDER=NONE ALIGN=MIDDLE ALT=""></A>\
  986. <TD NOWRAP ALIGN=LEFT VALIGN=TOP><A HREF="%r">&abbrev(%n,20,...)</A>\
  987. <TD NOWRAP ALIGN=LEFT VALIGN=TOP>%s<TD>%l\
  988. <TD NOWRAP ALIGN=LEFT VALIGN=TOP>&if(%d,%d,<I>%c</I>)\n"
  989.     ListBottom "</TABLE></CENTER>\n"
  990.     LastModifiedFormat "%d-%b-%y %H:%M"
  991.     Include "*"
  992.     MIMEIcon "text/html /icons/layout.gif"
  993.     MIMEIcon "text/x-code /icons/c.gif"
  994.     MIMEIcon "text/x-perl /icons/p.gif"
  995.     MIMEIcon "text/* /icons/text.gif"
  996.     MIMEIcon "internal/x-directory /icons/folder.gif"
  997.     MIMEIcon "audio/* /icons/sound2.gif"
  998.     MIMEIcon "image/* /icons/image2.gif"
  999.     MIMEIcon "application/x-uuencoded /icons/uuencoded.gif"
  1000.     MIMEIcon "application/x-tar /icons/compressed.gif"
  1001.     MIMEIcon "application/x-gzip /icons/compressed.gif"
  1002.     MIMEIcon "application/x-sh /icons/script.gif"
  1003.     MIMEIcon "application/* /icons/binary.gif"
  1004.     MIMEIcon "x-world/x-vrml /icons/burst.gif"
  1005.     MIMEIcon "*/* /icons/unknown.gif"
  1006.     DescriptionFile ".desc"
  1007.     SwapFileName ".. Parent Directory"
  1008.     FooterPattern "<HR SIZE=1 NOSHADE>\
  1009. Contact the hostmaster <A HREF="mailto:$a"<I>$a</I></A>.\
  1010. </BODY></HTML>"
  1011.     HeaderFile "HEADER"
  1012.     FooterFile "README"
  1013.     Exclude "."
  1014.     Exclude "~*"
  1015.     Exclude ".desc"
  1016.     Exclude "README"
  1017.     Exclude "HEADER"
  1018.     Options " Name | AbbrevSize | RelPath | Icon | MIMEType "
  1019. </Object>
  1020.  
  1021. # ---
  1022. #
  1023. # Raw tab delimited directory index. For input into other
  1024. # applications. This data could be cut and pasted into a 
  1025. # spreadsheet application.
  1026. #
  1027. # ---
  1028. <Object>
  1029.     Name TDT
  1030.     Class DirectoryIndexClass
  1031.     FilePattern "%r\t%n\t%l\t%s\t%c\n"
  1032.     LastModifiedFormat "%d-%b-%y %H:%M"
  1033.     Include "*"
  1034.     Exclude "."
  1035.     Exclude "~*"
  1036.     Exclude ".desc"
  1037.     Exclude "README"
  1038.     Exclude "HEADER"
  1039.     HTTPEquiv "Content-Type: text/plain"
  1040.     Options " Name | Size | RelPath "
  1041. </Object>
  1042.  
  1043. # ---
  1044. #
  1045. # CGIFileIOObject
  1046. #     
  1047. #    IOObject used for communication between web browser and
  1048. #    server.
  1049. #
  1050. # ---
  1051. <Object>
  1052.     Name CGIFileIOObject
  1053.     Class PipeIOClass
  1054.     ReadTimeout -1
  1055.     WriteTimeout 10
  1056.     NoYield "Read"
  1057. </Object>
  1058.  
  1059. # ---
  1060. #
  1061. # StandardCGI
  1062. #
  1063. # Configuration for Standard <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A>
  1064. #
  1065. # ---
  1066. <Object>
  1067.     Name StandardCGI
  1068.     Class CGIClass
  1069.     
  1070.     # Specify the IO object use to communicate with the <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A> program
  1071.     FileIOObject CGIFileIOObject
  1072.  
  1073.     # Snoop IO objects can be instantiated in the IO chain with a line
  1074.     # like this. They log all IO trafic. This is useful for debugging.
  1075. #    FileIOObject SnoopIOObject IOObject="CGIFileIOObject" OutFile="cgi.dbg" 
  1076.  
  1077.     DefaultCommandLine "%p%q"
  1078.     CommandLineByExt .bat="cmd.exe /c %p%q"
  1079.     CommandLineByExt .cmd="cmd.exe /c %p%q"
  1080.     CommandLineByExt .pl="perl %p%q"
  1081.     IncludeParentsEnvironment Yes
  1082.     EnvironmentSize 8192
  1083.     
  1084.     # These are the environment variables that are sent to the
  1085.     # <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A> program
  1086.     Variable "AUTH_TYPE=$x"
  1087.     Variable "CONTENT_LENGTH=$Y"
  1088.     Variable "CONTENT_TYPE=$C"
  1089.     Variable "HTTPS=$g"
  1090.     Variable "&if($K,HTTPS_KEYSIZE=$K,)"
  1091.     Variable "&if($K,HTTPS_SECRETKEYSIZE=$G,)"
  1092.     Variable "GATEWAY_INTERFACE=CGI/1.1"
  1093.     Variable "PATH_INFO=$I"
  1094.     Variable "PATH_TRANSLATED=$Z"
  1095.     Variable "QUERY_STRING=$q"
  1096.     Variable "REMOTE_ADDR=$A"
  1097.     Variable "REMOTE_HOST=$h"
  1098.     Variable "REMOTE_IDENT=$i"
  1099.     Variable "REMOTE_USER=$u"
  1100.     Variable "REQUEST_METHOD=$m"
  1101.     Variable "SCRIPT_NAME=$z"
  1102.     Variable "SERVER_NAME=$v"
  1103.     Variable "SERVER_PORT=&if($p,$p,&if($K,443,80))"
  1104.     Variable "SERVER_PROTOCOL=$H"
  1105.     Variable "SERVER_SOFTWARE=$S"
  1106.     ExtraHeaders Yes
  1107.     ExtraHeadersPrefix "HTTP_"
  1108.     ExtraHeadersIgnore "Content-Type Content-Length"
  1109.     SendCRLF Yes
  1110. </Object>
  1111.  
  1112. # ---
  1113. #
  1114. # WinCGI
  1115. #
  1116. # Handle windows <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A>
  1117. #
  1118. # ---
  1119. <Object>
  1120.     Name WinCGI
  1121.     Class CGIClass
  1122.     FileIOObject CGIFileIOObject
  1123.     DefaultCommandLine "%p %d"
  1124.     IncludeParentsEnvironment Yes
  1125.     EnvironmentSize 8192
  1126.     Variable "AUTH_TYPE=$x"
  1127.     Variable "CONTENT_LENGTH=$Y"
  1128.     Variable "CONTENT_TYPE=$C"
  1129.     Variable "HTTPS=$g"
  1130.     Variable "&if($K,HTTPS_KEYSIZE=$K,)"
  1131.     Variable "&if($K,HTTPS_SECRETKEYSIZE=$G,)"
  1132.     Variable "GATEWAY_INTERFACE=CGI/1.1"
  1133.     Variable "PATH_INFO=$I"
  1134.     Variable "PATH_TRANSLATED=$Z"
  1135.     Variable "QUERY_STRING=$q"
  1136.     Variable "REMOTE_ADDR=$A"
  1137.     Variable "REMOTE_HOST=$h"
  1138.     Variable "REMOTE_IDENT=$i"
  1139.     Variable "REMOTE_USER=$u"
  1140.     Variable "REQUEST_METHOD=$m"
  1141.     Variable "SCRIPT_NAME=$z"
  1142.     Variable "SERVER_NAME=$v"
  1143.     Variable "SERVER_PORT=&if($p,$p,&if($K,443,80))"
  1144.     Variable "SERVER_PROTOCOL=$H"
  1145.     Variable "SERVER_SOFTWARE=$S"
  1146.     ExtraHeaders Yes
  1147.     ExtraHeadersPrefix "HTTP_"
  1148.     ExtraHeadersIgnore "Content-Type Content-Length"
  1149.  
  1150.     # Generate windows <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A> filenames by preappending the
  1151.     # process id to the unique identifier.
  1152.     DataFile "cgi-temp/$P_%u.ini"
  1153.     StdinFile "cgi-temp/$P_%u.in"
  1154.     StdoutFile "cgi-temp/$P_%u.out"
  1155.     DataBlock "\
  1156. [CGI]$M\
  1157. Request Protocol=$H$M\
  1158. Request Method=$m$M\
  1159. Physical Path=$f$M\
  1160. <A HREF="/pidocs/Objects/HTTP.html#CGI">CGI</A> Version=CGI/1.1 (Win)$M\
  1161. Content Type=$C/* short for  &dblookup(request,rfc822,Content-Type)*/$M\
  1162. Content Length=$Y/* short for &dblookup(request,rfc822,Content-Length)*/$M\
  1163. $M\
  1164. [Accept]$M\
  1165. $M\
  1166. [System]$M\
  1167. Output File=%o$M\
  1168. Content File=%i$M\
  1169. $M\
  1170. [Accept]$M\
  1171. $M\
  1172. [Extra Headers]$M\
  1173. $M\
  1174. [Form Literal]$M\
  1175. $M\
  1176. [Form External]$M\
  1177. $M\
  1178. [Form File]$M\
  1179. $M\
  1180. [Form Huge]$M\
  1181. $M\
  1182. "
  1183.     SendCRLF Yes
  1184. </Object>
  1185.  
  1186. </PRE></BODY></HTML>