AOLserver

# AOLserver Features

$Header: /cvsroot/aolserver/aolserver.com/docs/intro/features.html,v 1.1 2002/03/07 19:15:35 kriston Exp $

## What is AOLserver?

AOLserver is a World Wide Web server that provides access control and database connections and runs on multiple UNIX platforms. AOLserver can access SQL databases including Sybase, SOLID, Postgres, and some third-party database drivers.

AOLserver is extendable with both C and Tcl APIs that expose core functions and provide primitives for accessing the database. AOLserver also provides optional CGI support, although the C and Tcl APIs are more powerful, offer superior performance, and are easier to use.

You can configure multiple servers within one AOLserver configuration file, and then specify which server to run when you run AOLserver. AOLserver also uses a multi-threaded design on all supported platforms. You can configure the number of threads each server can use.

AOLserver offers direct connections to SQL databases such as SOLID and Postgres , plus an external database connection to Sybase. Third-party database drivers are provided for Oracle, Informix, and Interbase. You can even configure AOLserver to have connections to multiple databases and specify which databases are available to each server.

AOLserver also includes server administration capabilities. An access control system allows you to specify separate permissions for each combination of URL and HTTP method (GET, PUT, or POST). You can also specify users and groups who are allowed access to AOLserver.

## Features

AOLserver Administration Features

Access Control:

AOLserver's access control system allows you to define users, assign users to groups, and set permissions for users, groups, and hosts.

When defining permissions for the AOLserver, you can specify lists of users to allow or disallow, lists of groups to allow or disallow, and hosts (specified either by host name or IP address) to allow or disallow for each method/URL combination..

Multi-homing:

AOLserver allows you to run multiple servers on one host by attaching them to different port and/or IP address combinations.

See the "Configuration for Multiple IP Addresses" section for information on configuring AOLserver for multi-homing.

Database Services Features

AOLserver manages pools of open connections to databases. These pools let AOLserver quickly service simultaneous database requests (without continuously opening and closing the database), and to prevent a large number of HTTP requests from overloading the system. Both the Tcl and C APIs provide access to these database pools.

Programming Interface Features

Tcl Interface:

AOLserver can be extended using the Tcl scripting language. AOLserver provides a powerful Tcl API containing a full array of functions and primitives that give you access to all of AOLserver's core functionality and SQL databases. Tcl functions are available to interact with the connection, implement scheduled procedures, maintain state, access the sockets and threads interfaces, roll access logs, maintain permissions, access the database, and much more.

You can create scripts in a private Tcl library for each server, or in a library shared by multiple servers. Since Tcl is embedded in AOLserver, a separate process is not required to run a Tcl script, making Tcl extensions much more efficient than CGI-based extensions.

AOLserver Dynamic Pages (ADPs)

ADPs allow you to embed Tcl scripts directly into HTML pages. The script(s) are interpreted dynamically when the page is accessed.

C Interface:

AOLserver can also be extended with the C API. The C API lets you write your own logging routines, access control system, communications drivers, or database drivers. It provides all the necessary functions and structures you need to access AOLserver's core functionality and the database.

To use the C API, you compile your C module into a Unix shared library. AOLserver will dynamically load the module and call your initialization function.

CGI Support, Including CGI File Type Activation:

AOLserver provides full CGI support. Because running a CGI program requires a separate process to be created, it is less efficient than extending AOLserver with Tcl or C.

You can configure AOLserver to look for CGI programs in a specific directory, or you can store CGI programs near the HTML files and refer to them using the .cgi file type. Any file with the .cgi extension will be interpreted as a CGI program by AOLserver. You can configure AOLserver to activate the .cgi file type in specific directories or groups of directories.

### High Performance

Fast and efficient handling of simultaneous connections through a combination of multi-threading, in-memory caching, and single-threaded asynchronous I/O. AOLserver has an advanced multithreaded architecture. Multithreading features include:

- Fast response without having to fork for each connection.

- Multiple, simultaneous servicing of connections.

- Ability to keep state in the address space of the single AOLserver process - no need to maintain slow and messy external files!

- Simple programming model where each request is handled in its own thread, freeing the programmer from the worry of a long running request blocking the server.

- Fully configurable minimum and maximum number of threads on a per-virtual server basis. Threads are transparently added when demand rises and then slowly exit as demand falls.

- The Tcl interface is fully multi-threaded aware - no special steps are required to ensure proper concurrent script evaluation.

- The nsthread platform-independent C API for multithreaded programming which includes:
  - Functions to create and wait for new threads
  - Mutex, critical section, semaphore, and event objects to protect shared resources
  - Thread local storage for maintaining per-thread data

- The nsthread interface allows the AOLserver programmer to write new C functions which use advanced multithreaded locking and synchronization techniques independent of the host platform. In fact, the AOLserver is written entirely using the nsthread interface - no platform specific multithreading code is used anywhere in the AOLserver or in any AOLserver module. No other Web server provides this level of multithreaded programming support!

- AOLserver performs in-memory caching of pages and scripts, and single-threaded asynchronous I/O for returning static content.

### Tcl Scripting

Quickly add dynamic content to your website:

- Integrated multi-threaded interpreter runs scripts in parallel in one process with complete access to server state
- AOLserver Dynamic Pages (ADP's) allow embedding of Tcl scripts in HTML pages
- Rich, easy-to-use scripting language loaded with new AOLserver-specific extensions for building web applications
- Ability to add your own C commands to the language

AOLserver includes the Tcl (Tool Command Language) scripting language as an integral part of its architecture:

- The Tcl interface allows you to quickly build custom Web applications without C code or messy CGIs.

- The Tcl interface is multithreaded, allowing more than one Tcl script to operate in one or more virtual servers simultaneously.

- Built-in Tcl scripts operate up to 10 times faster than comparable Perl-based CGIs.

- The Tcl interface can be extended to include your own custom Tcl commands written as Tcl procedures or as C primitives.

- AOLserver extends Tcl to include commands for accessing one more open databases without writing any C code or executing slow external CGIs.

- The Tcl interface includes useful commands for accessing HTML form data and information about the active connection.

- The Tcl interface provides a command for opening a TCP/IP socket which can be used to implement a quick HTTP transaction to another Web server or send Email using SMTP (a procedure for sending email is included).

- Resources allocated during evaluation of a Tcl script (e.g., open database handles, open files, Ns_Set data) are automatically garbage collected after the script returns, freeing the script developer of these tedious tasks.

- Tcl scripts can be in the pages directory along with the HTML pages and images or in a special Tcl library directory:
  - Scripts in the pages directory are evaluated on each transaction which is ideal for quick script development.
  - Scripts in the library directories are evaluated at startup time for fast response without having to open and read the script file.

- AOLserver includes an HTML-forms based interface for creating and updating Tcl scripts which are located in the Tcl library directory. Also included is a simple HTML form for ad-hoc evaluation of a Tcl script typed directly into a text area box.

- Tcl, unlike Java, has been in use by a large user community for years (join the comp.lang.tcl newsgroup) and is well documented by the creator of Tcl, John Ousterhout of Sun Microsystems.

- AOLserver Dynamic Pages (ADP's) are HTML pages that are parsed and run on the server when the page is accessed -- ADPs contain HTML tags and Tcl scripts. ADPs are ideal in situations where you want to generate part or all of a specific page dynamically.

### Complete C API

  Write custom dynamically loaded modules for:
  - Handling requests
  - Translating URLs
  - Logging
  - Database access
  - Thread creation and synchronization
  - And much more!
  The AOLserver includes a complete C API. Using the C API you can write:
  - Custom request functions to handle HTTP request to an URL or a complete hierarchy of URLs.

  - Custom URL-to-file translation routines to convert an HTTP URL to a file in the local filesystem. This can be used to map URLs to one or more filesystem directories as required for maintenance or load balancing.

  - New Tcl commands for use in your Tcl scripts. AOLserver provides initialization functions to ensure your command is available in all the Tcl interpreters in a virtual server Tcl interpreter pool.

  - Database drivers to interface AOLserver to your own DBMS.

  - Communications drivers so AOLserver can implement HTTP over a new underlying protocol:
    - The included nssock module implements HTTP over regular TCP/IP sockets just like other basic Web servers such as NCSA, CERN, or WebSite.

    - The included nsssl module implements HTTP over SSL (Secure Sockets Layer) TCP/IP sockets just like other secure, commerce capable, Web servers.

    - The includednsunix module implements HTTP using Unix Domain Sockets and TCP sockets. These protocols are ideal for implementing a proxy and is used by the included virtual host redirector "nsvhr."

    - New drivers can be added as HTTP support is required on other underlying protocols (e.g., Named Pipes or IPX). AOLserver supports Unix Domain Sockets with the included "nsunix" driver.

  - Filter functions which run at any stage of each HTTP request. A filter can be used to implement logging - in fact, this is how the nslog Common Log Format logging module works.

  - A scheduled procedure which runs at regular intervals. A scheduled procedure can be used in conjunction with a filter function to implement a statistics gathering system.

  No other Web server C API is as complete and powerful as the AOLserver C API!

  ### SQL Database Services

  Powerful and easy access to a variety of SQL databases. Driver source for Sybase and Solid are included with others available from third parties.

  AOLserver includes loads of features to help you connect your website to SQL databases:

  - Provides a platform independent interface to SQL relational databases.

  - Connects to underlying database servers through plug-in database drivers:

    - Included are drivers for Sybase, Solid, and Postgres.

    - The AOLserver Community has also contributed drivers for Informix, Oracle, Interbase, and MySQL.

  - AOLserver maintains one or more pools with one or more open database connections. By maintaining open connections, HTTP requests have instant access to the database instead of incurring the expensive startup time of a CGI-based solution.

  - Requests are queued in first in, first out order to ensure efficient and fair use of database resources.

  - Database operations are available through both the C and Tcl API's.

  ### Secure Sockets Layer

  SSL enables network encryption for e-commerce applications.

  ### Hierarchical Access Control

  Restrict access to all or part of your Web through lists of users, groups, and/or client address.