Operations Documentation Non-Programmer's Guide General Information WCMS Operation Chat Specialized Interfaces Software Development & Scripting

Visit the

  • Developer Center,
  • WebX Harbor, and the
  • Web Crossing Conference
    to find a wealth of WebX info and a community of WebX experts on the Web!
  • Specialized Interfaces

    Distributed servers, FastCGI, NSAPI, and ISAPI

    Table of Contents

    Overview
    Distributed Web Crossing servers
    Redundant database architecture
    Configuring redundant servers
    Operations with redundant servers
    Shared user directory
    Configuring Standard FastCGI
    Configuring Web Crossing for FastCGI
    Configuring Apache for FastCGI
    Configuring NSAPI FastCGI
    Configuring Windows NT for NSAPI FastCGI
    Configuring Unix Platforms for NSAPI FastCGI
    Custom Options
    Configuring ISAPI
    Copying WebX.dll to the right location
    Editing NT Registry Settings
    Restart IIS
    Direct Access Command Syntax
    Direct Access Status Responses
    Direct Access Command Directory
    Return to Sysop Documentation


    » Overview

    Web Crossing provides specialized protocols for creating a cluster of Web Crossing servers, for direct access to the Web Crossing database by another application, and alternative interfaces for some platforms and operating systems that offer better performance than the standard CGI interface. This section of the documentation deals with configuration issues for these specialized protocols.

    » Distributed Web Crossing servers

    Web Crossing allows you to run multiple cooperating Web Crossing servers. These cooperating servers can

  • provide real-time redundancy to make sure you can always respond to user requests and that you never lose your discussion database;
  • greatly increase throughput and responsiveness;
  • share a single user directory among multiple virtual Web Crossing sites.

    » Direct Access Protocol

    Web Crossing supports direct access to the database from another application via a special protocol. This protocol is designed to be extended by using macros you provide in the webx.tpl environment (see the MACRO command). You can invoke any of these macros through this interface, and they can take action as appropriate, including the return of data in a convenient format.

    » FastCGI, NSAPI, and ISAPI

    Web Crossing supports the FastCGI, NSAPI, and ISAPI protocols, which avoid the overhead required to spawn a separate CGI process (webx-cgi on Unix, webx.exe on WindowsNT) each time a user accesses Web Crossing. The FastCGI interface uses the industry standard FastCGI protocol, while the NSAPI and ISAPI interfaces are designed specifically for Netscape and Microsoft Internet Information servers respectively.

    » Redundant database architecture

    To serve the same database from multiple servers, Web Crossing uses a source-mirror architecture with a single source/master and one or more mirrors/servants.


    Redundant database with 2 mirrors

    All of the servers, including the source, can be used to process user requests. In very high-volume sites, the source may be dedicated to synchronizing the various mirror databases.

    Each mirror may run as a separate process on the same machine as the source, or on its own machine. Each server, source or mirror, keeps its own copy of the discussion database. TCP/IP connections from the source to each mirror are used to synchronize all of the databases.

    The mapping of a user request to a particular Web Crossing server is done outside of Web Crossing. For example, you could use DNS rotation to have domain-name lookups rotate among the various servers, or hardware such as Cisco's LocalDirector to transparently assign each request to an available server.

    Because each server keeps its own copy of the database, most requests can be served locally, without accessing the source database. Requests that change the database, such as checking subscriptions or changing user preferences, are passed to the source and then from the source to the other mirrors. Requests that create a new database object, such as posting a message or creating a new discussion, are passed to the source to have the object's unique ID assigned centrally, and are then passed by the source to all mirrors.

    Scaling and Load Issues

    In terms of volume, multiple redundant servers can grow to 10-15x the capacity of a single process before the source server is saturated. This is because we typically see about 20 page views to 1 post, and at 10-15x the throughput of one process, the source server is completely occupied with post synchronization.

    On modern dual-processor Unix machines, a single process can serve 250,000 to 1,000,000 page views per "day" over a 10-hour duty cycle. The duty cycle takes into account that server load varies dramatically during a 24 hour period, and figures for purposes of determining load capacity that the server is running full-out for 10 hours, idle for the rest.

    So on modern dual-processor Unix machines, this means you can serve between 2.5 million and 15 million page views per day with multiple redundant servers, depending on typical post sizes, ratio of page-views to posts, and how much customization you do on the site.

    » Configuring redundant servers

    You configure redundant servers through the Distributed servers sysop control panel. This panel allows you to specify TCP/IP ports and source/mirror relationships for all of your servers.

    With 5T/20T/50T/200T/Enterprise licenses, one license certificate is valid for the entire cluster of redundant servers. With older Standard or Platinum licenses, each redundant server must have its own license certificate.

    » Operations with redundant servers

    The normal operations required to maintain a site are to install a new mirror server, take down a mirror server, move the source server to one of the mirrors, and make a backup copy of the discussion database. This section also discusses handling unscheduled server outages.

  • Add a new mirror server.

  • Take down a mirror server.

  • Move the source server to one of the mirrors.

  • Make a backup copy of the database.

  • Handle unexpected server outages.

    » Shared user directory

    Web Crossing allows you to share a common user directory among multiple different conferences.

    You can use this to have a common user community across multiple sites, or to break a single large conference down into smaller pieces so that it can scale to much larger volume.

    In this mode, all of the servers share the same member directory information, so that login certificates and preference settings are propagated throughout the cooperating servers.

    Scaling with split areas is essentially unlimited, because you can keep splitting the site into smaller pieces as desired.

    You configure shared directory service through the Distributed servers sysop control panel.

    » Combined redundancy and shared user directory

    You can run in both modes: each separate area of the site can run multiple redundant servers, all connected together to form a very large cooperating site.


    » FastCGI

    NSAPI module that is available from Web Crossing, Inc.

    FastCGI must be used when running Web Crossing on a different host than the Web server.

    » Configuring Web Crossing for FastCGI

    Use the standard CGI script to access Web Crossing, log in as sysop, go to the Control Panel's General Settings page, and scroll down to the FastCGI section.

  • Check the Allow FastCGI Connections checkbox.

  • In the Web Crossing FastCGI Port textbox, enter 8879 (or any available port on the machine on which Web Crossing is running).

  • In the Allowed Web Server IP Address textbox, enter 127.0.0.1 if the Web Crossing server is running on the same host as the Web server. If it is running on a different host, enter the IP address of the Web server's host.

    Web Crossing will then be accessible via both FastCGI and the standard CGI script.

    » Configuring Apache for FastCGI

    Apache does not include FastCGI support by default and must be built with the FastCGI module, available from http://www.fastcgi.com/servers/apache/.

    FastCGI is enabled by configuring Apache to map a file on the Web server to the Web Crossing FastCGI service:

  • Create an empty executable file in your Web server CGI directory:
       cd [your CGI dir]
    
       touch WebX.fcgi
    
       chmod a+x WebX.fcgi

  • Add the following lines to the Apache srm.conf file:
       # FastCGI connections to Web Crossing
    
       ExternalAppClass /[absolute path of your CGI dir]/WebX.fcgi -host 127.0.0.1:8879
    
       <Location /[your CGI dir]/WebX.fcgi>
    
       SetHandler fastcgi-script
    
       </Location>
    Use a file system path for the ExternalAppClass directive, and a URL path for the Location directive.

    This ExternalAppClass directive maps WebX.fcgi to a Web Crossing server running on the same host as Apache. To map to a Web Crossing server on a different host, give the host's IP address in place of 127.0.0.1. You must use the same port number (8879 here) as that specified on the Web Crossing General Settings page. The Location and SetHandler directives tell Apache to find and use the FastCGI service for requests for WebX.fcgi.

  • Restart your Apache server to activate the new configuration, and test access to Web Crossing via the WebX.fcgi file, for example: http://www.yoursite.com/cgi-bin/WebX.fcgi


    » NSAPI

    The Web Crossing NSAPI to FastCGI interface is a custom Netscape Application Programming Interface program which allows for the use of FastCGI responder type applications with Netscape Web Servers.

    This FastCGI interface connects to a FastCGI compliant application through TCP/IP. It then forwards all of the appropriate server information from a request to the FastCGI application and then correctly formats the response, sending it back to the browser. This NSAPI/FastCGI interface will work with most FastCGI compliant applications

    Once installed, all access to your Web Crossing Server will be exactly as it was except that all access is now being provided by the FastCGI interface.

    NOTE: This NSAPI Service acts also as a "Filter" and will only run for the URL that has the "Script" name specified in the obj.conf file at the end of the URI.

    » Configuring NSAPI FastCGI

    Installation of the FastCGI interface involves four separate steps:

    1. Copying the FastCGI application to the appropriate directory
    2. Editing the configuration files for your particular Netscape Server using a simple text editor
    3. Apply and restart the Netscape server to reflect the changes in the configuration files and to allow loading of the shared program, FastCgi.
    4. Editing the General Settings in the Web Crossing sysop control panel to allow FastCgi access.

    » Windows NT Configuration

    The Windows NT installation consists of a single ".dll" file called "FastCgi.dll" and this help file.

    1. Copy the file "FastCgi.dll" your Netscape Server's bin directory, e.g. "<server root>/bin/httpd/FastCgi.dll". This is typically located in "c:\netscape\server\bin\httpd\*".
    2. Modify your server's obj.conf file to reflect the following changes. This file is usually located in the directory "c:\netscape\server\<NameOfYourServer>\config\obj.conf".
    3. obj.conf Modifications:

      At the beginning of obj.conf in the Init section, add the following line::
      Init fn=load-modules shlib=FastCGI.dll funcs=fastcgi

      Inside an object in obj.conf add the following to the BEGINNING of the other Service directives:
      Service method=(GET|HEAD|POST) type=* fn=fastcgi IP=xxx.yyy.zzz.www Port=3000 Script=/WebX

      The IP parameter must be the IP address of the machine that is running the Web Crossing Server.
      The Port parameter must be the port number that is set in the Web Crossing Sysop control panel, FastCGI settings.
      The Script parameter is the script that you are currently using to access Web Crossing.
      NOTE: This file MUST exist in the correct place on your server, even if the file is empty, as this bypasses the internal Netscapes checks to see if a file exists prior to executing the Service directives.

    4. Restart your Netscape server to reflect the changes to the obj.conf and to allow the loading of the shared FastCgi.dll program. You might also need to "Apply" the changes through the administration portion of your server.
    5. Edit the General Settings of the Web Crossing sysop control panel to reflect the port that you chose in step 2.

    » Unix Platform NSAPI Installation

    The Unix installation consists of a single ".so" file called "fastcgi.so" and this help file.

    1. Copy the file "fastcgi.so" your Netscape Server's bin directory, e.g. "<server root>/bin/httpd/fastcgi.so". This is typically located in "/netscape/server/bin/httpd/*".
    2. Modify your server's obj.conf file to reflect the following changes. This file is usually located in the directory "\netscape\server\<NameOfYourServer>\config\obj.conf".
    3. obj.conf Modifications:

      At the beginning of obj.conf in the Init section, add the following line::
      Init fn=load-modules shlib=fastcgi.so funcs=fastcgi

      Inside an object in obj.conf add the following to the BEGINNING of the other Service directives:
      Service method=(GET|HEAD|POST) type=* fn=fastcgi IP=xxx.yyy.zzz.www Port=3000 Script=/WebX

      The IP parameter must be the IP address of the machine that is running the Web Crossing Server.
      The Port parameter must be the port number that is set in the Web Crossing Sysop control panel, FastCGI settings.
      The Script parameter is the script that you are currently using to access Web Crossing.
      NOTE: This file MUST exist in the correct place on your server, even if the file is empty, as this bypasses the internal Netscapes checks to see if a file exists prior to executing the Service directives.

    4. Restart your Netscape server to reflect the changes to the obj.conf and to allow the loading of the shared FastCgi.so program. You might also need to "Apply" the changes through the administration portion of your server.
    5. Edit the General Settings of the Web Crossing sysop control panel to reflect the port that you chose in step 2.

    » Custom Options

    You may add an optional parameter to the "obj.conf" file to perform some error and timestamp logging to a file by inserting the following parameter: LogRequests=1 to the Service Directive parameters.

    e.g.:
    Service method=(GET|HEAD|POST) type=* fn=fastcgi IP=xxx.yyy.zzz.www Port=3000 Script=/WebX LogRequests=1

    When this parameter is present, errors and timestamps are written to a log file named fastcgi.log.


    »Web Crossing ISAPI Interface

    Web Crossing Internet Information Server (IIS) API Interface is a plug-in module designed exclusively to work with Microsoft's IIS in conjuction with Web Crossing Server. This dynamically loaded library (.dll) provides the interface between the Web Crossing Server and the requests from users through their WWW browers. Initial tests have shown at least a 2X improvement in speed and access of the discussion forums in Web Crossing. It also allows a much larger message to be posted, bypassing the problems in IIS in terms of the length of posted messages.

    The ISAPI version of the script program also acts as a filter for incoming URL requests to your server. This is activated through the NT Registry settings and is designed to allow older saved or cached bookmarks to continue to work without any effort of your users. It takes the old script name and converts it into the new name automatically. You will notice that eventually all of the links in Web Crossing will incorporate the new URL with "webx.dll".

    Installation consists of copying the new file "webx.dll" into the same directory as the previous script file "webx.exe". This effectively replaces the standard method of accessing Web Crossing. Some settings in the NT registry must also be modified to work with Microsoft IIS.

    » Copying WebX.dll to the right location

    The file "webx.dll" that came with this distribution must be copied to the right location in your normal server document directory. If your site URL is something like: http://www.yoursite.com/scripts/webx.exe? then you must copy the file "webx.dll" into the directory specified by your virtual directory "/scripts" on your hard disk. This is probably something like: "c:\inetsrv\scripts\*". This should be the same location as your existing file "webx.exe".

    » Editing NT Registry Settings

    A few changes must be made to the NT registry settings to allow the filter portion of the WebX.dll to work correcly. If you do not require the filter, then you may skip this section and the filter will not be activated.

      Edit NT Registry Settings through Web Crossing Configuration

    1. Run "Web Crossing Configuration" and select the "ISAPI" tab. Note: if you do not see this tab, then you must upgrade to a newer version of Web Crossing.
    2. Edit the "Currently Installed IIS Filters" box to add the FULL path to the "webx.dll" file that was previously installed into your "scripts" directory. Make sure to separate this new path from the others with a comma (,). Don't erase any of the other settings that are already installed.
    3. Edit the "Old Web Crossing Script Name" to match the URL portion of your site which directed users to Web Crossing, usually "/scripts/webx.exe"
    4. Edit the "New Web Crossing Script Name" to match the new URL to your site, usually "/scripts/webx.dll"
    5. Close the Configuration program and move to the next step, Restarting Microsoft IIS.
    6. Edit NT Registry Settings Manually

    1. Run "regedt32.exe" from the command line or from the "Start -> Run" menu. This is usually located in your NT system32 directory.
    2. Open the Registry for the computer on which Web Crossing and your IIS server is running
    3. Open the setting for : System/CurrentControlSet/Services/W3SVC/Parameters
    4. Edit the value "Filter DLLs and edit the list of filters to add the FULL pathname of the location of the "webx.dll" file that was copied in the earlier step. NOTE: All of the installed filters must be separated by a ',' (comma).
    5. Use the "Edit -> Add Key" menu to add a key called "WebX". Leave the "class" box empty.
    6. Open this newly created "WebX" Registry folder
    7. Use the "Edit ->Add Value" menu to add two values called "OldScript" and "NewScript" as the value names and the URL portion of each for the string box. ie. OldScript would be "/scripts/webx.exe" and NewScript would have the value "/scripts/webx.dll"
    8. Verify that these settings are correct and close the Registry Editor.

    » Restart Microsoft IIS

    You must restart Microsoft IIS WWW server so that the settings will be loaded correctly. Use the "Internet Service Manager" or the NT Services Control panel to stop and start the server.

    »Command Syntax

    All commands and each keyword:value parameter are followed by CRLF. Responses start with an error number and text message followed by CRLF. Responses status may be followed by additional keyword:value data lines, each line terminated by a CRLF.

    A final blank line terminates a command or response, except when the response includes a Content-Length keyword. Then the blank line is followed by additional raw data bytes as specified by the Content-Length value.

    Note that data values cannot include CRLF because this is the end-of-value delimiter. So, all incoming or outgoing values will be URL-quoted when they contain CR or LF characters. Any field that is URL quoted is sent as "fieldname/u:value".

    »Status Responses

    210 OK
    400 Not authenticated
    401 No such file
    402 Enter room error: ...
    403 User already exists
    404 Error creating object
    405 Error deleting object
    406 No such macro
    408 Bad syntax
    501 Not implemented
    550 Access error

    »Command Directory

    NOTES:

    Session

    LOGIN/USER:/PASS:logs in to have access to use other commands
    LOGOUTlogs out and closes the TCP/IP session

    Users

    NOTE: "user" is either "USER:username" or "ID:userid"
    "fieldlist" is an optional comma-delimited list of fields

    AUTH/USER:/PASS:checks to authenticate a user
    NEW/USER:name/field1:value1...
    --> ID:/TYPE:USER
    creates a new user
    GET/user:
    -->ID:/TYPE:USER
    returns information about a user
    GET/user:/FIELDS:fieldlist
    --> ID:/TYPE:USER/field1:value1...
    returns information about a user FIELDS:fieldlist is optional
    GETFIELDS/user:
    --> ID:/TYPE:USER/FIELDLIST:
    get list of available fields for a user
    PUT/user:/field1:value1...-->
    ID:/TYPE:USER
    set information about a user.
    EXISTS/USER:namechecks for existence of a user, returns OK or error
    DELETE/user:deletes a user

    Groups

    NOTE: "group" is either "GROUP:groupname" or "GROUPID:groupid"
    "member" is either "MEMBER:name" or "MEMBERID:id" where "id" is for a group or user
    "fieldlist" is an optional comma-delimited list of fields
    "type" is either USER or GROUP

    NEW/GROUP:groupname
    --> ID:/TYPE:GROUP/SIZE:
    creates a new group and returns its ID
    GET/group
    --> ID:/TYPE:GROUP/SIZE:
    (none)
    GET/group/FIELDS:fieldlist
    -->ID:/TYPE:GROUP/SIZE:/field1:value1...
    gets a group's ID, current size, and field data
    GET/group/ITEM:itemIx
    --> ID:/TYPE:/SIZE:
    (none)
    GET/group/ITEM:itemIx/FIELDS:
    --> ID:/TYPE:/SIZE:/field1:value...
    returns the member user or group at an index
    "itemIx" is a 0-origin index into the group, which is sorted by last name.
    Note that member indexes are not static: they change as members are added and removed.
    GET/group/member:
    --> ID:/TYPE:/SIZE:
    checks for a member by name or userId
    GETFIELDS/group
    --> ID:/TYPE:/SIZE:/FIELDLIST:
    gets fields available for a group or item
    PUT/group/field1:value1... sets field values for the group, including its name
    PUT/group/member adds a user or group to the group if not already present
    DELETE/group deletes a group
    DELETE/group/member deletes a user or group from a group

    Locations

    NOTES "location" is "LOCATION:pathname" or "LOCATION:locationId," and can have an optional "ITEM:itemIx"
    "type" is "folder," "discussion," "link," "response," or "chat."

    "GET/location
    --> ID:locationId/TYPE:/SIZE:
    check for existence of a location and its type.
    The returned size is the number of nested items at this location.
    GET/location/FIELDS:fieldlist
    --> ID:locationId/TYPE:/field1:...
    get values from a location. This is either a location itself (no index) or a member of the location (with INDEX:itemIx)
    GETFIELDS/location
    --> ID:locationId/TYPE:/FIELDLIST:
    get a list of fields available at a location
    PUT/location/field1:value1...
    --> ID:locationId/TYPE:
    set information associated with a location
    NEW/location/TYPE:/field1:value1...
    --> ID:locationId/TYPE:
    create a new object. The parent is the location, which can be a folder, discussion, or message depending on the type of object to be created
    DELETE/location deletes a location.

    Chat

    ENTER/ROOM:
    --> HANDLE:/CALLIP:/PORT:/HAS:[MTROP,COOLTALK]
    (none)
    ENTER/location
    --> HANDLE:/CALLIP:/PORT:/HAS:[MTROP,COOLTALK]
    enters a chat room.

    Macros

    RUN/MACRO:/QPARAM1:/QPARAM2:
    --> CONTENT-LENGTH:/data

    (data follows the blank line at the
    end of the response header).
    The macro has access to the incoming qParam1, qParam2 in WCTL.
    Incoming QPARAM1:/QPARAM2: are optional.
    RUN/MACRO:/QPARAM1:/QPARAM2:
    --> CONTENT-LENGTH:/
    data (data follows the blank line at the end of the response header).
    The macro has access to the incoming qParam1, qParam2 in WCTL.
    Incoming QPARAM1:/QPARAM2: are optional.

    For example,

      --> run
      --> macro: test1
      -->
      <-- 210 OK
      <-- Content-Length: 13
      <-- Hello there
    

    (In this example, the returned data ends with a CR/LF, so there are 13 total bytes of data. This is not required, the returned data is binary and may contain any characters, including nulls.)




    © Copyright 1996-2003 by Web Crossing, Inc. All rights reserved.