Annotation of loncom/html/adm/help/tex/Guts_Apache.tex, revision 1.1
1.1 ! bowersj2 1: The standard mode in which the Apache web server is used is that a
! 2: URL corresponds to some static file on the file system, which then
! 3: more or less gets sent out as-is. Slight deviations from that simple
! 4: principle are however already the directory listing function, virtual
! 5: servers, and the cgi-bin directory. In the latter case, Apache executes
! 6: the file in a new process and provides both the input to the process
! 7: in the environment, and routes the output to the client. Other deviations
! 8: are the error messages.
! 9:
! 10: In a more general view, URLs to Apache are URIs (Uniform Resource
! 11: Identifiers), which may are may not correspond to a physical file,
! 12: which in turn may or may not be sent out as-is.
! 13:
! 14: As a request for a URI gets sent to the Apache server, it goes through
! 15: several phases. At each phase ({}``stage'') along the process, handler
! 16: modules can be defined to deal with the request. Details about these
! 17: phases are given in {}``Writing Apache Modules with Perl and C''
! 18: from O'Reilly (the {}``Eagle book'') in Chapter 3 (page 60).
! 19:
! 20: These handler modules are not like cgi-scripts executed in a separate
! 21: process, but are dynamically linked into the Apache child processes
! 22: themselves - they run inside of Apache. The mod\_perl mechanism in
! 23: addition links the Perl interpreter into the Apache child process.
! 24: Modules are pre-interpreted ({}``compiled'') by the Perl interpreter
! 25: when they are first loaded, and the pre-interpreted code stays permanently
! 26: in the memory allocated to that Apache child process. The result is
! 27: a significant speed-up, and through the flexible mechanism of module
! 28: registration and different stages of the process, a high degree of
! 29: customizability.
! 30:
! 31: LON-CAPA does \emph{not} use Apache::Registry, and so in addition
! 32: avoids the unnecessary overhead of emulating a cgi-environment within
! 33: the handlers. Instead, it makes direct use of the Apache Perl API
! 34: (Chapter 9, Eagle book).
! 35:
! 36: If you intend to add new capabilities to LON-CAPA that require new
! 37: handlers, as opposed to tweaking current ones, we recommend buying
! 38: a copy of {}``Writing Apache Modules with Perl and C''; it is not
! 39: strictly necessary but it is the clearest description of what is going
! 40: on in the Apache server, and without it you will be challenged to
! 41: understand everything that is occurring in the server.
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>