Difference between revisions of "Anatomy of a request"

From EPrints Documentation
Jump to: navigation, search
Line 1: Line 1:
Below is a description of how EPrints and Apache handle an incoming request.
+
This is a description of how EPrints and Apache handle an incoming request.
Understanding this flow helps understand how an Access Control layer can be added to the system.  
+
Understanding this flow helps understand how an Access Control layer can be added to the system.
 +
 
 +
I will assume that you know how to locate a perl module file from the module name (e.g. <code>EPrints::Apache::Rewrite</code> will probably be <code>~/perl_lib/EPrints/Apache/Rewrite.pm</code>, although this is not always the case!).
 +
 
 +
Below are relevant parts of config files and perl modules that are used with when processing a request:
 +
*Apache core config <code>~/cfg/apache.conf</code>
 +
<source lang="apache">
 +
 
 +
PerlSwitches -I/home/eprints/eprints-3.3.12/perl_lib
 +
PerlModule EPrints
 +
PerlPostConfigHandler +EPrints::post_config_handler
 +
 
 +
</source>
 +
The post_config_handler does some sanity checks on the EPrints setup (e.g. is Apache listening to the ports that the repositories are configured to work under)
 +
See: http://perl.apache.org/docs/2.0/user/handlers/server.html#C_PerlPostConfigHandler_ for more info about the post_config_handler
 +
*Apache repository config <code>~/cfg/apache/ARCHIVEID.conf</code>
 +
<source lang="apache">
 +
<VirtualHost *:80>
 +
...
 +
  PerlTransHandler +EPrints::Apache::Rewrite
 +
 
 +
</VirtualHost>
 +
</source>
 +
 
 +
This leads us to the backbone of EPrints - the Rewrite module - where URL_REWRITE_* triggers are called; content negotiation can happen, as well as many other wonderous things!
 +
*<code>EPrints::Apache::Rewrite</code> module
 +
TODO: Explain flow of Rewrite - triggers - cgi - content negotiation - CRUD - ???
 +
 
  
 
[[Category:EPrints 3.3.12]]
 
[[Category:EPrints 3.3.12]]
 
{{AccessControl}}
 
{{AccessControl}}

Revision as of 13:54, 13 October 2014

This is a description of how EPrints and Apache handle an incoming request. Understanding this flow helps understand how an Access Control layer can be added to the system.

I will assume that you know how to locate a perl module file from the module name (e.g. EPrints::Apache::Rewrite will probably be ~/perl_lib/EPrints/Apache/Rewrite.pm, although this is not always the case!).

Below are relevant parts of config files and perl modules that are used with when processing a request:

  • Apache core config ~/cfg/apache.conf
PerlSwitches -I/home/eprints/eprints-3.3.12/perl_lib
PerlModule EPrints
PerlPostConfigHandler +EPrints::post_config_handler

The post_config_handler does some sanity checks on the EPrints setup (e.g. is Apache listening to the ports that the repositories are configured to work under) See: http://perl.apache.org/docs/2.0/user/handlers/server.html#C_PerlPostConfigHandler_ for more info about the post_config_handler

  • Apache repository config ~/cfg/apache/ARCHIVEID.conf
<VirtualHost *:80>
...
  PerlTransHandler +EPrints::Apache::Rewrite

</VirtualHost>

This leads us to the backbone of EPrints - the Rewrite module - where URL_REWRITE_* triggers are called; content negotiation can happen, as well as many other wonderous things!

  • EPrints::Apache::Rewrite module

TODO: Explain flow of Rewrite - triggers - cgi - content negotiation - CRUD - ???

Access Control Layer