Previous Page: Extending Your Server with Programs  Next Page: Installing Client-Side Programs

Installing Server-Side Programs

JavaScript applications and CGI programs have different strengths and uses. CGI programs can be written in C, PERL, or other programming languages. All CGI programs have a standard way to pass information between clients and servers. JavaScript applications are written in JavaScript, an object-based scripting language that is easier to learn than an object-oriented programming language and lends itself to rapid application development.

Each type of program is installed onto the server differently. The following list summarizes the procedures:

These installation instructions are described in the following sections.


Installing CGI Programs

Common Gateway Interface (CGI) programs can be created with any number of programming languages. On a UNIX* machine, you're likely to find CGI programs written as Bourne shell or PERL scripts. On a Windows computer, you might find CGI programs written in C++ or batch files. On NetWare®, you might find CGI programs written in NetBasic*, PERL, Novell Script for NetWare (NSN), or LCGI NLMTM applications.

Regardless of the programming language, all CGI programs accept and return data in the same manner.

There are two ways to store CGI programs on your server:

  1. Specify a directory that contains only CGI programs. All files are run as programs regardless of the file extensions.
  2. Specify that CGI programs are all a certain file type. They will all use the file extensions .CGI, .EXE, .NLM, or .BAT. The programs can be located in any directory that the server can serve from.

There are benefits to either implementation. If you want only a specific set of users to be able to add CGI programs, keep the CGI programs in specified directories and restrict access to those directories. If you want to allow anyone who can add HTML files to be able to add CGI programs, use the file type alternative. Users can keep their CGI files in the same directories as their HTML files.

If you choose the directory option, your server will attempt to interpret any file you place in that directory as a CGI program. Similarly, if you choose the file type option, your server will attempt to process any files with the file extensions .CGI, .EXE, .NLM, or .BAT as CGI programs. If a file has one of these extensions but is not a CGI program, an error occurs when a user attempts to access it.


Specifying a CGI Directory

  1. From the Web Manager home page, click Enterprise Web Server servername > Programs > CGI Directory.

  2. In the URL Prefix field, enter the URL prefix you want to use for this directory.

    The text you enter appears as the directory for the CGI programs in URLs. For example, if you enter cgi-bin as the URL prefix, then all URLs to these CGI programs have the following structure:

    http://yourserver.domain.com/cgi-bin/program-name

    The URL prefix you specify can be different from the real CGI directory you specify in the next step.

  3. In the CGI Directory field, enter the location of the directory as an absolute path.

    This directory doesn't have to be under your document root. This is the reason that you need to specify a URL prefix in the previous step.

  4. Click OK > Save and Apply.


Editing an Existing CGI Directory

  1. From the Web Manager home page, click Enterprise Web Server servername > Programs > CGI Directory.

  2. Under Current CGI Directories, click Edit next to the directory you want to edit.

  3. In the URL prefix field, enter the new prefix.

  4. In the CGI directory field, enter the new directory.

  5. Click OK > Save and Apply.


Removing an Existing CGI Directory

  1. From the Web Manager home page, click Enterprise Web Server servername > Programs > CGI Directory.

  2. Under Current CGI directories, click Remove next to the directory you want to remove.

  3. Click OK > Save and Apply.

    Copy your CGI programs into the directories you've specified. Remember that any files in those directories will be processed as a CGI file, so you don't want to put HTML files in your CGI directory.


Specifying CGI as a File Type

  1. From the Web Manager home page, click Enterprise Web Server servername > Programs > CGI File Type.

  2. Select the resource you want to apply this change to from the Editing drop-down list.

  3. Click Browse to choose a part of your server.

  4. Click Options to browse files and directories on your server.

  5. Click Back to return to the CGI as a File Type form.

  6. Click Wildcard to enter the wildcard pattern to edit.

  7. Click Yes to activate CGI as a file type.

  8. Click OK > Save and Apply.

The CGI files must have the file extension .BAT, .EXE, .NLM, or .CGI. Any non-CGI files with those extensions will be processed by your server as CGI files and will cause errors.


Downloading Executable Files

If you're using .EXE as a CGI file type, users will not be able to download .EXE files as executables.

One solution to this problem is to compress the executable files that you want users to be able to download, so that the extension is not .EXE. This solution has the added benefit of shortening the download time.

Another possible solution is to remove .EXE as a file extension from the MAGNUS-INTERNAL/CGI type and add it to the APPLICATION/OCTET-STREAM type (the MIME type for normal downloadable files). You can do this by clicking Enterprise Web Server servername > Server Preferences > MIME Types. However, the disadvantage to this method is that after making this change, you cannot use .EXE files as CGI programs.

Another solution is to edit your server's OBJ.CONF file to set up a download directory, where any file in the directory is downloaded automatically. The rest of the server won't be affected. For directions on setting up this directory, visit the Netscape Technical Support Knowledge Base.


Scripting CGI

Refer to the Novell Developer Kit Web site for information on PERL, NetBasic, NSN, and LCGIs.


Using the Query Handler

You can specify a default query handler CGI program. A query handler processes text sent to it via the ISINDEX tag in an HTML file.

ISINDEX is similar to a form text field in that it creates a text field in the HTML page that can accept typed input. Unlike the information in a form text field, however, the information in the ISINDEX box is immediately submitted when the user presses Enter. When you specify your default query handler, you tell your server the program to direct the input to. For an in-depth discussion of the ISINDEX tag, see an HTML reference manual.

To set a query handler, do the following:

  1. From the Web Manager home page, click Enterprise Web Server servername > Programs > Query Handler.

  2. Select the resource you want to set a default query handler for from the Editing drop-down list.

    If you choose a directory, the query handler you specify runs only when the server receives a URL for that directory or any file in that directory.

  3. Click Browse to choose a part of your server.

  4. Click Options to browse files and directories on your server.

  5. Click Back to return to Query Handler form.

  6. Click Wildcard to enter the wildcard pattern to edit.

  7. In the Default Query Handler field, enter the full path for the CGI program you want to use as the default for the resource you selected.

  8. Click OK > Save and Apply.


Installing Server-Side JavaScript Programs

To install server-side JavaScript programs, you need to activate server-side JavaScript for your server and use the Application Manager. This section includes information on accessing and using the Application Manager to install server-side JavaScript applications as well as to perform other functions.

For more information about writing JavaScript applications, see the Novell Developer Kit Web site.

You must activate server-side JavaScript before you can use the Application Manager. Also, put JSAC.EXE and LIBESNSPR20.DLL in your system directory so that they are in the search path. These files are found in the NOVONYX/SUITESPOT/BIN/HTTPS directory.


Activating Server-Side JavaScript

If you are using server-side JavaScript applications, you must first activate server-side JavaScript for your server.

  1. From the Web Manager home page, click Enterprise Web Server servername > Programs > Server Side JavaScript.

  2. Select Yes to activate the server-side JavaScript application environment.

  3. Click OK > Save and Apply.

  4. When the Activate Server Side JavaScript form appears, click the link to use the Application Manager.

  5. Enter the NetWare Web Manager username and password to use the Application Manager.

    For more information, see Securing the Application Manager.

For applications written in server-side JavaScript, you can perform the following administrative tasks with the server-side JavaScript Application Manager:


Running the Application Manager

To run the Application Manager, click Enterprise Web Server servername > Programs > Server Side JavaScript > Application Manager. You can also run the Application Manager by loading the following URL in your Web browser:

https://server.domain/appmgr

The Application Manager displays all applications currently installed on the server in a scrolling list in the left frame. Click an application in the scrolling list.

For the selected application, the right frame displays the following:

To modify applications, do the following:

  1. In the Applications list, select the application you want to modify.

  2. Click the task button below the Applications list to perform the specified action:

The following explains the buttons and links on the green banner that runs across the top of the screen:


Securing the Application Manager

If you have disabled Web Manager's encryption, intruders can easily intercept your administrator username and password. Because Application Manager uses the same administrator username and password, intruders could also access Application Manager and add, remove, modify, start, stop, or delete your applications.

You should either enable Web Manager's encryption or avoid accessing it from outside of your company's firewall.


Installing Server-Side JavaScript Applications

You must install (add) an application with the Application Manager before you can run it. You can install up to 120 JavaScript applications on one server.

  1. From the Web Manager home page, click Enterprise Web Server servername > Programs > Server Side JavaScript.

  2. Click Application Manager.

  3. Click Add Application at the top of the page.

  4. In the Name field, enter the name of the JavaScript application.

    For specific information on application URLs, see Application URLs.

    IMPORTANT:  Do not give any JavaScript applications the same names as any subdirectories of your primary document directory. If you do, the server will no longer correctly process requests from the directory. For example, if you have a directory server_root/DOCS/BUG and a JavaScript application named Bug, all requests for any files in the BUG directory (or any of its subdirectories) will attempt to launch the JavaScript application Bug. The JavaScript application URI takes precedence.

  5. In the Web File Path field, enter the absolute path to the .WEB file for the application.

  6. In the Default Page field, enter the absolute path of the file to send to clients who do not indicate a specific page for the application.

    This page is analogous to INDEX.HTML for a standard URL. This is a required field.

  7. (Optional) In the Initial Page field, enter the absolute path of the page to run when the application is first started.

    This page runs only once during the life of the application and is used to initialize values and establish database connections.

  8. (Optional) In the Built-in Maximum Database Connections field, enter the maximum number of database connections that this application can have at one time if you are using the built-in Database object.

  9. (Optional) In the External Libraries field, enter the absolute paths of any libraries to be used with the application.

    Libraries installed for one application can be used by all applications on the server.

  10. In the Client Object Maintenance field, select the mode for maintaining the Client object.

    This can be Client-Cookie, Client-URL, Server-IP, Server-Cookie, or Server-URL.

  11. Click OK > Save and Apply.


Application URLs

When you install a server-side JavaScript application, you must enter a name for it. This name determines the application URL, which clients use to access a JavaScript application. Application URLs are of the form http://server.domain/appName/page.html. Server is the name of the HTTP server, domain is the Internet domain (including the subdomains), appName is the application name you enter when you install it, and page is the name of the page in the application.

For example, if your server is named MYSERVER, your domain name is NOVELL.COM, and the application is called Hello World, the application URL is HTTP://MYSERVER.NOVELL.COM/WORLD/HELLO.HTML

This is a required field, and the name you enter must be different from all other application names on the server. The name must include only alphanumeric characters and cannot include spaces.

IMPORTANT:  Before you install an application, make sure the application name you choose does not usurp an existing URL on your server. All client requests for URLs that match the application URL are routed to the directory specified for the .WEB file, circumventing the server's normal document root.


Controlling Access to a Server-Side JavaScript Application

When you install an application, you might want to restrict its use to only certain users. You can do this by applying a configuration style to the application. For more information, see Working with Configuration Styles.


Modifying Installation Parameters

You can change any of the parameters defined when you installed the application, except the application name. To change the name of an application, you must remove the application and then reinstall it.

If you modify the parameters of a stopped application, the Application Manager automatically starts it. When you modify parameters of an active application, Application Manager automatically stops and restarts it.


Removing a Server-Side JavaScript Application

Clicking Remove removes the application from the Application Manager, but does not delete files from the server. At this point, clients can no longer access the application.

If you delete an application and subsequently want to run it, you must install it again.


Starting, Stopping, and Restarting a Server-Side JavaScript Application

You can also start, stop, and restart an application by entering a special URL in the format

http://server.domain/appmgr/control.html?name=appName&cmd=action

where appName is the application name and action is either stop, start, or restart.


Running a Server-Side JavaScript Application

There are two ways to run an installed application:

If you attempt to run a stopped application (one that is not active), then the Application Manager tries to start it first.

WARNING:  The server should not be unloaded while a server-side JavaScript application is running because the server can leave the application in an unpredictable state.


Configuring Default Settings

When you install a new application, the default installation parameters are used for the initial settings.

You can specify the following default settings:



  Previous Page: Extending Your Server with Programs  Next Page: Installing Client-Side Programs