You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by ml...@apache.org on 2001/03/21 23:12:35 UTC

cvs commit: tcl-site/mod_tcl apache_pb.gif mod_tcl.gif mod_tcl.html

mlink       01/03/21 14:12:35

  Added:       mod_tcl  apache_pb.gif mod_tcl.gif mod_tcl.html
  Log:
  initial install
  
  Revision  Changes    Path
  1.1                  tcl-site/mod_tcl/apache_pb.gif
  
  	<<Binary file>>
  
  
  1.1                  tcl-site/mod_tcl/mod_tcl.gif
  
  	<<Binary file>>
  
  
  1.1                  tcl-site/mod_tcl/mod_tcl.html
  
  Index: mod_tcl.html
  ===================================================================
  <HTML>
  <BODY BGCOLOR="#F0F0F0">
  <TITLE>The Apache/TCL Integration Project</TITLE>
  
  <TABLE BORDER=0 WIDTH=100%>
  	<TR>
  		<TD ALIGN=LEFT VALIGN=CENTER><IMG SRC="mod_tcl.gif" BORDER=0></TD>
  		<TD ALIGN=RIGHT VALIGN=CENTER><IMG SRC="apache_pb.gif" BORDER=0></TD>
  	</TR>
  </TABLE>
  
  <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%>
  	<TR>
  		<TD BGCOLOR="#303030">
  			<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1 WIDTH=100%>
  				<TR BGCOLOR="#E0E0E0">
  					<TD>
  						<TABLE CELLPADDING=0 CELLSPACING=3 BORDER=0 WIDTH=100%>
  							<TR>
  								<TD ALIGN=LEFT>
  									<FONT FACE=Verdana SIZE=-1>
  										<A HREF="http:://tcl.apache.org">tcl.apache.org</A>
  									</FONT>
  								</TD>
  								<TD ALIGN=CENTER>
  									<FONT FACE=Verdana SIZE=-1>
  										<A HREF="http:://www.apache.org">apache.org</A>
  									</FONT>
  								</TD>
  								<TD ALIGN=RIGHT>
  									<FONT FACE=Verdana SIZE=-1>
  										<A HREF="http:://www.fractal.net/mod_tcl.tm">fractal.net</A>
  									</FONT>
  								</TD>
  							</TR>
  						</TABLE>
  					</TD>
  				</TR>
  			</TABLE>
  		</TD>
  	</TR>
  </TABLE>
  
  <BR>
  
  <FONT FACE=Verdana>
  
  <CENTER>
  	<B>The Apache/TCL Integration Project</B>
  </CENTER>
  
  <BR>
  
  <P>
  The Apache/TCL integration project brings together the full power of the TCL  programming language and the Apache HTTP server.
  </P>
  
  <P>
  With mod_tcl it is possible to write <A HREF="http://www.apache.org/">Apache</A> modules entirely in <A HREF="http://www.scriptics.com">TCL</A>. In addition, the persistent interpreter embedded in the server avoids the overhead of starting an external interpreter and the penalty of TCL start-up time.
  </P>
  
  Table of Contents:<BR>
  <UL>
  	<LI><A HREF="#download">Download</A>
  	<LI><A HREF="#install">Install</A>
  	<LI><A HREF="#configure">Configuration</A>
  	<LI><A HREF="#documentation">Documentation</A>
  	<LI><A HREF="#road_map">Road Map</A>
  <!--	<LI><A HREF="#execution_model">Execution Model</A> -->
  	<LI><A HREF="#bugs">BUGS/Issues</A>
  </UL>
  
  <HR NOSHADE>
  <A NAME="download">
  <B>Download</B><BR>
  <P>
  Download of source is available through anonymous cvs at apache.org.  .tar.gz snapshot packages will posted at regular intervals until development as completed at which time release packages will be posted.  <A HREF="www.fractal.net">fractal.net</A> runs the latest development of mod_tcl, you may want to check there for what the latest development version is.
  </P>
  <TT>cvs -d:pserver:anoncvs@www.apache.org:/home/cvspublic checkout tcl-modtcl</TT>
  
  <HR NOSHADE>
  <A NAME="install">
  <B>Install</B><BR>
  <P>
  First you will need to download a copy of mod_tcl.  Depending on where your distribution came from (cvs, .tgz, etc.) your directory will be named different.  I will assume that the directory is named <TT>mod_tcl</TT> for the purpose of this installation procedure.  You will also need a copy of <TT>autoconf</TT> which is available from any GNU distribution.
  </P>
  
  <P>
  Next, place the <TT>mod_tcl</TT> directory into Apache's modules directory.  For example if using Apache 2.0.14 this would be placed in <TT>httpd-2_0_14/modules/mod_tcl</TT>.  Change directory to <TT>httpd-2_0_14</TT> and run the command <TT>autoconf</TT> and then <TT>autoheader</TT>.  You may now procedure with a <TT>make</TT>.
  </P>
  
  <P>
  It is possible to compile mod_tcl as a shared object by passing arguments to the configuration script of Apache.  Use the switch <TT>--enable-mods-shared=tcl</TT> to enable mod_tcl to be built as a shared object.
  </P>
  
  <P>
  In summary the follow procedure was described above.
  <PRE>
  % tar -zxf mod_tcl.tar.gz
  % mv mod_tcl httpd-2_0_14/modules/.
  % cd httpd-2_0_14
  % autoconf
  % autoheader
  % ./configure
  % make
  </PRE>
  </P>
  
  <HR NOSHADE>
  <A NAME="configure">
  <B>Configuration</B><BR>
  <P>
  The configuration directives for mod_tcl should be configured inside of a &lt;Directory&gt; or &lt;Location&gt;.  The &lt;Tcl&gt; fields should be declared outside of a &lt;Directory&gt; or &lt;Location&gt; because the &lt;Tcl&gt; directives add logic to the global namespace.
  </P>
  
  <PRE>
  Determine if the module should be active
  @param 1 On or Off
  Tcl
  
  Set an array variable or a scalar variable
  @param 1 Array variable if param 3 is non-null, otherwise a scalar variable
  @param 2 Name of an array element if param 3 is non-null, otherwise value to set scalar
  @param 3 Value to set array element to
  Tcl_Var
  
  Append to a list
  @param 1 List variable to append to
  @param 2 Value to append
  Tcl_ListVar
  
  Add a content handler to be executed
  @param 1 The name of a procedure that is to be called when a content handler is called
  Tcl_ContentHandler
  
  Add a post read request hook
  @param 1 The name of a procedure that is to be called when a read request hook is called
  Tcl_Hook_Post_Read_Request
  
  Add a translate name hook
  @param 1 The name of a procedure that is to be called when a translate name hook is called
  Tcl_Hook_Translate_Name
  
  Add a header parser hook
  @param 1 The name of a procedure that is to be called when a header parser hook is called
  Tcl_Hook_Header_Parser
  
  Add an access checker hook
  @param 1 The name of a procedure that is to be called when an access checker hook is called
  Tcl_Hook_Access_Checker
  
  Add a check user id hook
  @param 1 The name of a procedure that is to be called when a check user id hook is called
  Tcl_Hook_Check_User_ID
  
  Add an auth checker hook
  @param 1 The name of a procedure that is to be called when an auth checker hook is called
  Tcl_Hook_Auth_Checker
  
  Add a type checker hook
  @param 1 The name of a procedure that is to be called when a type checker hook is called
  Tcl_Hook_Type_Checker
  
  Add a fixups hook
  @param 1 The name of a procedure that is to be called when a fixups hook is called
  Tcl_Hook_Fixups
  
  Add a log transaction hook
  @param 1 The name of a procedure that is to be called when a log transaction hook is called
  Tcl_Hook_Log_Transaction
  
  Add raw TCL to the interpeter
  @param 1 A TCL script that will be executed in the interpreter
  &lt;Tcl&gt;
  
  End adding raw TCL to the interpreter
  &lt;/Tcl&gt;
  </PRE>
  
  <HR NOSHADE>
  <A NAME="documenation">
  <B>Documentation</B><BR>
  <P>
  Here is some preliminary documentation which really could be made prettier.  Important things to note are, all the constants and commands are made available in the ::apache namespace.  Therefore you must either import this namespace or use namespace scope operators to use the constants and commands.
  </P>
  
  <PRE>
  Constants Provided
  ------------------
  
  DECLINED
  DONE
  OK
  	
  M_POST
  M_GET
  M_PUT
  M_DELETE
  M_CONNECT
  M_OPTIONS
  M_TRACE
  M_PATCH
  M_PROPFIND
  M_PROPPATCH
  M_MKCOL
  M_COPY
  M_MOVE
  M_LOCK
  M_UNLOCK
  M_INVALID
  	
  HTTP_CONTINUE
  HTTP_SWITCHING_PROTOCOLS
  HTTP_PROCESSING
  HTTP_OK
  HTTP_CREATED
  HTTP_ACCEPTED
  HTTP_NON_AUTHORITATIVE
  HTTP_NO_CONTENT
  HTTP_RESET_CONTENT
  HTTP_PARTIAL_CONTENT
  HTTP_MULTI_STATUS
  HTTP_MULTIPLE_CHOICES
  HTTP_MOVED_PERMANENTLY
  HTTP_MOVED_TEMPORARILY
  HTTP_SEE_OTHER
  HTTP_NOT_MODIFIED
  HTTP_USE_PROXY
  HTTP_TEMPORARY_REDIRECT
  HTTP_BAD_REQUEST
  HTTP_UNAUTHORIZED
  HTTP_PAYMENT_REQUIRED
  HTTP_FORBIDDEN
  HTTP_NOT_FOUND
  HTTP_METHOD_NOT_ALLOWED
  HTTP_NOT_ACCEPTABLE
  HTTP_PROXY_AUTHENTICATION_REQUIRED
  HTTP_REQUEST_TIME_OUT
  HTTP_CONFLICT
  HTTP_GONE
  HTTP_LENGTH_REQUIRED
  HTTP_PRECONDITION_FAILED
  HTTP_REQUEST_ENTITY_TOO_LARGE
  HTTP_REQUEST_URI_TOO_LARGE
  HTTP_UNSUPPORTED_MEDIA_TYPE
  HTTP_RANGE_NOT_SATISFIABLE
  HTTP_EXPECTATION_FAILED
  HTTP_UNPROCESSABLE_ENTITY
  HTTP_LOCKED
  HTTP_FAILED_DEPENDENCY
  HTTP_INTERNAL_SERVER_ERROR
  HTTP_NOT_IMPLEMENTED
  HTTP_BAD_GATEWAY
  HTTP_SERVICE_UNAVAILABLE
  HTTP_GATEWAY_TIME_OUT
  HTTP_VERSION_NOT_SUPPORTED
  HTTP_VARIANT_ALSO_VARIES
  HTTP_INSUFFICIENT_STORAGE
  HTTP_NOT_EXTENDED
  	
  REMOTE_HOST
  REMOTE_NAME
  REMOTE_NOLOOKUP
  REMOTE_DOUBLE_REV
  	
  APLOG_EMERG
  APLOG_ALERT
  APLOG_CRIT
  APLOG_ERR
  APLOG_WARNING
  APLOG_NOTICE
  APLOG_INFO
  APLOG_DEBUG
  APLOG_NOERRNO
  
  REQUEST_NO_BODY
  REQUEST_CHUNKED_ERROR
  REQUEST_CHUNKED_DECHUNK
  
  Commands
  --------
  
  Abort request
  @param 1 A string with the reason of abortion
  @deffunc abort 1
  abort
  
  Read posted data and set the array pram
  @deffunc read_post
  read_post
  
  Generate a random integer
  @return An integer
  @deffunc random
  random
  
  Seed random number generation
  @param 1 An integer to seed random number generation
  @deffunc srandom 1
  srandom
  
  Encode data to base64
  @param 1 Data to be encoded
  @return Base64 string of converted data
  @deffunc base64_encode 1
  base64_encode
  
  Decode data from base64
  @param 1 Base64 string to be converted to data
  @return Data that was converted from base64
  @deffunc base64_decode
  base64_decode
  
  Call ap_allow_options
  @return An integer with the mask of options
  @deffunc ap_allow_options
  ap_allow_options
  
  Call ap_allow_overrides
  @return An integer
  @deffunc ap_allow_overrides
  ap_allow_overrides
  
  Call ap_default_type
  @return A string
  @deffunc ap_default_type
  ap_default_type
  
  Call ap_document_root
  @return A string
  @deffunc ap_document_root
  ap_document_root
  
  Call ap_get_remote_host
  @param 1 An integer specifying the type of lookup
  @return A string
  @deffunc ap_get_remote_host 1
  ap_get_remote_host
  
  Call ap_get_remote_logname
  @return A string
  @deffunc ap_get_remote_logname
  ap_get_remote_logname
  
  Call ap_construct_url
  @param 1 A uri
  @return A string
  @deffunc ap_construct_url 1
  ap_construct_url
  
  Call ap_get_server_name
  @return A string
  @deffunc ap_get_server_name
  ap_get_server_name
  
  Call ap_get_limit_req_body
  @return An integer
  @deffunc ap_get_limit_req_body
  ap_get_limit_req_body
  
  Call ap_get_limit_xml_body
  @return An integer
  @deffunc ap_get_limit_xml_body
  ap_get_limit_xml_body
  
  Call ap_custom_response
  @param 1 An integer
  @param 2 A string
  @deffunc ap_custom_response 1 2
  ap_custom_response
  
  Call ap_exists_config_define
  @param 1 A string
  @return An integer
  @deffunc ap_exists_config_define 1
  ap_exists_config_define
  
  Call ap_auth_type
  @return A string
  @deffunc ap_auth_type
  ap_auth_type
  
  Call ap_auth_name
  @return A string
  @deffunc ap_auth_name
  ap_auth_name
  
  Call ap_satisfies
  @return An integer
  @deffunc ap_satisfies
  ap_satisfies
  
  Call ap_requires
  @return A list { {integer, string} ... }
  @deffunc ap_requires
  ap_requires
  
  Call ap_log_error
  @param 1 An integer specifying log level
  @param 2 An integer specifying the status
  @param 3 A string specifying the error
  @deffunc ap_log_error 1 2 3
  ap_log_error
  
  Call ap_send_http_header
  @deffunc ap_send_http_header
  ap_send_http_header
  
  Call ap_send_http_trace
  @return An integer
  @deffunc ap_send_http_trace
  ap_send_http_trace
  
  Call ap_send_http_options
  @return An integer
  @deffunc ap_send_http_options
  ap_send_http_options
  
  Call ap_finalize_request_protocol
  @deffunc ap_finalize_request_protocol
  ap_finalize_request_protocol
  
  Call ap_send_error_response
  @param 1 An integer with recursion level
  @deffunc ap_send_error_response
  ap_send_error_response
  
  Call ap_set_content_length
  @param 1 An integer specifying length
  @deffunc ap_set_content_length 1
  ap_set_content_length
  
  Call ap_set_keepalive
  @return An integer
  @deffunc ap_set_keepalive
  ap_set_keepalive
  
  Call ap_rationalize_mtime
  @param 1 An integer specifying mtime
  @return An integer
  @deffunc ap_rationalize_mtime 1
  ap_rationalize_mtime
  
  Call ap_make_etag
  @param 1 An integer specifying force_weak
  @return A string
  @deffunc ap_make_etag 1
  ap_make_etag
  
  Call ap_set_etag
  @deffunc ap_set_etag
  ap_set_etag
  
  Call ap_set_last_modified
  @deffunc ap_set_last_modified
  ap_set_last_modified
  
  Call ap_meets_conditions
  @return An integer
  @deffunc ap_meets_conditions
  ap_meets_conditions
  
  Call ap_rputs
  @param 1 Either -nonewline or a string to write
  @param 2 if param 1 is -nonewline then a string to write
  @deffunc ap_rputs 1 2
  ap_rputs
  
  Call ap_rwrite
  @param 1 Data to write
  @deffunc ap_rwrite 1
  ap_rwrite
  
  Call ap_rflush
  @deffunc ap_rflush
  ap_rflush
  
  Call ap_get_status_line
  @param 1 An integer specifying status
  @return A string
  @deffunc ap_get_status_line 1
  ap_get_status_line
  
  Call ap_setup_client_block
  @param 1 An integer specifying read policy
  @return An integer
  @deffunc ap_setup_client_block 1
  ap_setup_client_block
  
  Call ap_get_client_block, sets variable R with data
  @param 1 An integer specifying the number of bytes to read
  @return An integer specifying the actual number of bytes read
  @deffunc ap_get_client_block 1
  ap_get_client_block
  
  Call ap_discard_request_body
  @return An integer
  @deffunc ap_discard_request_body
  ap_discard_request_body
  
  Call ap_note_auth_failure
  @deffunc ap_note_auth_failure
  ap_note_auth_failure
  
  Call ap_note_basic_auth_failure
  @deffunc ap_note_basic_auth_failure
  ap_note_basic_auth_failure
  
  Call ap_note_digest_auth_failure
  @deffunc ap_note_digest_auth_failure
  ap_note_digest_auth_failure
  
  Call ap_get_basic_auth_pw, sets R with password
  @return An integer
  @deffunc ap_get_basic_auth_pw
  ap_get_basic_auth_pw
  
  Call ap_parse_uri
  @param 1 A string specifying a uri
  @deffunc ap_parse_uri 1
  ap_parse_uri
  
  Call ap_method_number_of
  @param 1 A string with a method name
  @return An integer specifying the method number
  @deffunc ap_method_number_of 1
  ap_method_number_of
  
  Call ap_method_name_of
  @param 1 An integer specifying a method number
  @return A string specifying a method name
  @deffunc ap_method_name_of 1
  ap_method_name_of
  
  Call ap_internal_redirect
  @param 1 A string specifying a uri to redirect to
  @deffunc ap_internal_redirect 1
  ap_internal_redirect
  
  Call ap_internal_redirect_handler
  @param 1 A string specifying a uri to redirect to
  @deffunc ap_internal_redirect_handler 1
  ap_internal_redirect_handler
  
  Call ap_some_auth_required
  @return An integer
  @deffunc ap_some_auth_required
  ap_some_auth_required
  
  Call ap_update_mtime
  @param 1 An integer specifying a dependancy
  @deffunc ap_update_mtime 1
  ap_update_mtime
  
  Call ap_allow_methods
  @param 1 An integer specifying a reset
  @param 2 A string specifying methods
  @deffunc ap_allow_methods 1 2
  ap_allow_methods
  
  Call ap_get_server_version
  @return A string
  @deffunc ap_get_server_version
  ap_get_server_version
  
  Call ap_add_version_component
  @param 1 A string specifying a version component to add
  @deffunc ap_add_version_component 1
  ap_add_version_component
  
  Call ap_get_server_built
  @return A string
  @deffunc ap_get_server_built
  ap_get_server_built
  
  Call ap_create_environment, sets array env
  @deffunc ap_create_environment
  ap_create_environment
  
  Reads variables from request_rec structure
  @param 1 variable or "connection" or "server"
  @param 2 if param 1 "connection" or "server" then a variable to read
  @return The variable read, could be an integer, string, or list
  @deffunc r 1 2
  r
  
  Sets variables in request_rec structure
  @param 1 variable or "connection" or "server"
  @param 2 if param 1 "connection" or "server" then variable
  @param x variable list of data to be written
  @deffunc r_set 1 2 ...
  r_set
  
  Ouput text/html
  @param 1 A script of text to output
  @deffunc output 1
  output
  </PRE>
  
  <HR NOSHADE>
  <A NAME="road_map">
  <B>Road Map</B><BR>
  <PRE>
  Changes in 1.0d7
  --------------------------------------------------------------------------------
  - Fixed &lt;Tcl&gt;...&lt;/Tcl&gt;, these should be placed outside of &lt;Directory&gt;/&lt;Location&gt;
  directives.  Everything in &lt;Tcl&gt;...&lt;/Tcl&gt; is added to a global variable and then
  made local to the namespace of the file, this is due to several problems with
  handling configuration, mainly that exection would either result in a "this
  directive doesn't belong here" or a problem with the configuration not being
  built yet as in an EXEC_ON_READ.
  - Fixed a bug in ap_create_environment.
  
  Changes in 1.0d6
  --------------------------------------------------------------------------------
  
  - ap_send_http_header no longer does anything so the command just returns TCL_OK
  which essentially makes it null, I'll probably get rid of it later.
  - made changes in league with Apache 2.0.14.  Handlers were moved around etc.
  
  Changes in 1.0d5
  --------------------------------------------------------------------------------
  
  - Configuration checks for mmap() and will use malloc(),read(),free() in that
  order to replace mmap() procedures.
  - Constants and commands are now placed in the ::apache namespace, so you must
  import that namespace into your scripts.
  - A test script is included with the distribution for testing and example
  purposes.  test_script.tm
  
  TODO
  --------------------------------------------------------------------------------
  
  1. Add configuration documentation to README, add documentation regarding `r'
  and `r_set' commands.
  DONE 2. Possible addition of option to build shared object (.so) library.  (It
  appears Apache 2.0 has a configuration directive for this --enable-shared, but
  it appears to be not implemented yet...).
  3. A couple of hooks are broken (Apache bug?) the DECLINE causes the server to
  exit on signal 11 (SEGV).
  4. Add non-standard hooks?
  5. Add filters?
  6. libapreq (doesn't appear to be ported to 2.0 completley yet...)
  7. Decide what goals need to be acheived for release 1.0
  8. Make necessary changes along with Apache 2.0 revisions.
  9. Look into TCL threads.  A preliminary investigation to enabling TCL threads
  caused SEGVs randomly...?
  
  Map
  --------------------------------------------------------------------------------
  
  - 1.0d0 -| Inital port from mod_tcl* 0.26, single file split into 4
           | (Apache 2.0a9)
           |
  - 1.0d1 -| removal of nasties, update of configuration
           |
  - 1.0d2 -| addition of some API commands
           |
  - 1.0d3 -| more of API exposed, new config option, inital checkin to CVS
           |
  - 1.0d4 -| Documentation, 90% of API exposed
           |
  - 1.0d5 -| constants commands in ::apache namespace, mmap checking, test
           | script
           |
  - 1.0d6 -| ap_send_http_header deprecated, updated to be peachy with
           | Apache 2.0.14
           |
  % 1.0d7 %| we're still here, just a pre-release
           |
  - 1.0d8 -|
           |
  - 1.0d9 -|
           |
  - 1.0.0 -|
  </PRE>
  
  <HR NOSHADE>
  <A NAME="bugs">
  <B>Bugs</B><BR>
  <P>
  Currently bug reports can be mailed to <A HREF="mailto:mlink@apache.org">mlink@apache.org</A>.
  </P>
  
  <HR>
  
  <TABLE BORDER=0 WIDTH=100%>
  	<TR>
  		<TD ALIGN=RIGHT>
  			<FONT SIZE=-1>FEh</FONT>
  		</TD>
  	</TR>
  </TABLE>
  
  </FONT>
  
  </BODY>
  </HTML>