Application Server and Virtuell Websites
Content generation takes place within application servers, each having a unique application server name. Applications are executed on a client request through the HTTP server via the CGI interface (Common Gateway Interface).
Client request -> HTTPD -> CGI -> Application -> HTTPD -> Client
Depending on the actual CGI interfaces of the HTTP server CGI, FCGI, SCGI and DCGI are supported. Applications can use the Maxscape library via the Server API and the provided run-time objects to access and manage server data and work with the content database. They are executed within the content generation main loop. The code can be plugged in via the related module files or stored in the content database.
The unique application server name denotes all parts that are used to implement a website. Each application server has it's own:
- Unique Name
- Standardized Directory Structure
- Configuration
- Application Server Daemons
- Content Database Instance
- Application Modules
- Application Callbacks
- Content Management Interfaces
Application Server Daemons
An application server consists of one or more daemon processes. An application daemon contains the run-time server object definitions and implements the daemon's main loop. Application code is executed within these processes
An application lives in an application process daemon that communicates with the HTTP server via the chosen CGI interface, whereas the actual CGI interface is transparent to the application code. Each CGI interface requires its own main loop script.There is no generic main loop fuction provided by the library, so far.
Main FCGI Script of an Application Process with Apache
# File: /maxscape/server/'application server name'/docs/www.fcg
...
my $Process = Maxscape::Process->new;
$Process->initialise;
my $Request;
my $Response;
my $FCGI_Request = FCGI::Request();
while ($FCGI_Request->Accept >= 0)
{
$Request = Maxscape::HTTP::Request->new;
$Response = $Process->execute ($Request);
print $Response->HeaderAsString, $Response->Content;
$Process->postProcess;
$Process->cleanup;
}
Mainloop SCGI Script for an Application Process with Maxdaemon
# File: /maxscape/server/'application server name'/docs/www.scgi
...
my $Process = Maxscape::Process->new (ProcessType => 'SCGI');
$Process->initialise();
my $Request;
my $Response;
my $Client;
my $SCGI_Interface = Maxdaemon::Daemon::SCGI_Client->new;
while ($Client = $SCGI_Interface->accept)
{
$Request = Maxscape::HTTP::Request->new;
$Response = $Process->execute ($Request, $Client);
print $Response->HeaderAsString, $Response->ContentAsString;
$Process->postProcess;
$Process->cleanup;
}
Runtime System Objects
The runtime system's application server mainloop script creates several objects to provide a server programming interface for dynamic content generation within applications. These objects can be evaluated or executed in elements, templates and other data stored in the content database or in the application modules, directly or plugged in via the application plugin mechanism.
Server and application objects, function calls and variables can be embedded or executed within the database content or in the application server modules.
Application Modules Plugin
Application functions, callbacks and modules can be plugged into the system at several stages of the content generation process via the plugin mechanism.
| Next ∙ Previous ∙ Top ∙ Join ∙ Contact | © Maxscape |
