http://developer.netscape.com/library/documentation/
.
Additionally, your server can send these types of client-side applications to clients:
http://developer.netscape.com/library/documentation/
.
Additionally, this chapter describes the steps for specifying a default query handler CGI program. (A query handler processes text sent to it via the ISINDEX
tag in an HTML file.)
http://developer.netscape.com/library/documentation/
.
To enable your server to use server-side Java applets:
Be sure to copy all server-side Java applets into the directory you've specified.
Installing CGI programs
Common Gateway Interface, or 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.
Regardless of the programming language, all CGI programs accept and return data in the same manner, as described in Netscape's DevEdge online documentation web site athttp://developer.netscape.com/library/documentation
/.
There are two ways to store CGI programs on your server machine:
.cgi
, .exe
, or .bat
. The programs can be located in any directory the server can serve from..cgi
, .exe
, 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.
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
Note
The URL prefix you specify can be different from the real CGI directory you
specify in the next step.
To remove an existing CGI directory, click that directory's Remove button in the CGI Directory form. To change the URL prefix or CGI directory of an existing directory, click that directory's Edit button.
Copy your CGI programs into the directories you've specified. Remember--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
To specify CGI programs as a file type:
The CGI files must have the file extensions .bat
, .exe
, or .cgi
. Any non-CGI files with those extensions will be processed by your server as CGI files, causing 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 making the download time shorter.
Another possible solution is to remove .exe
as a file extension from the magnus-internal/cgi
type and add it instead to the application/octet-stream
type (the MIME type for normal downloadable files). You can do this through the Server Manager, by choosing 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, see the technical note at http://help.netscape.com/kb/server/960513-130.html
.
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 Return. When you specify your default query handler, you tell your server to which program to direct the input. For an in-depth discussion of the ISINDEX
tag, see an HTML reference manual.
To set a query handler, do the following:
Enabling WAI services
Web Application Interface (WAI) services are a kind of plug-in that uses the Common Object Request Broker Architecture (CORBA).
Before you use WAI services, you must enable them on your server. Enabling WAI services essentially turns on Internet Inter-ORB Protocol (IIOP) support in the server. You may have other (non-WAI) applications that need this support. If you need IIOP support, enable WAI services.
To enable WAI services on your server:
For more information about WAI, see Writing Web Applications with WAI on Netscape's DevEdge online documentation web site at http://developer.netscape.com/library/documentation/
.
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 perform other functions.
For more information about writing JavaScript applications, see Writing Server-Side JavaScript Applications on Netscape's DevEdge online documentation web site at http://developer.netscape.com/library/documentation/
.
Activating server-side JavaScript
If you are using server-side JavaScript applications, you must first activate server-side JavaScript for your server.
To enable server-side JavaScript:
.web
file, and type of client-object maintenance). http://
server.domain
/appmgr
.
You see the following screen. The Application Manager
The Application Manager displays all applications currently installed on the server in a scrolling list in the left frame. Select an application by clicking its name in the scrolling list. For the selected application, the right frame displays
.web
file on the server.Warning!
Your Application Manager runs on your web server (rather than on the administration server). The Application Manager is installed into theConsequently, you may want to restrict access to the Application Manager URL and the application URI so that only you and any other trusted administrators can access them. If you don't restrict access to the Application Manager, anyone can add, remove, modify, start, and stop applications on your server.js/ appmgr
directory. You can access it without the Server Manager with this URL:http://
yourserver
.domain.com/appmgr
.
If you want to require the administration server user and password for access to the Application Manager, follow these steps:
You then must enter the administration server username and password to use the Application Manager.
If your server does not use the Secure Sockets Layer (SSL), the username and password for the Application Manager are transmitted unencrypted over the network. Any intruder who intercepts this data may be able to access the Application Manager. If you use the same password for your administration server, the intruder can also control your server. For security reasons, do not use the Application Manager from outside of your firewall unless you are using SSL.
Installing server-side JavaScript applications
You can install up to
120 JavaScript
applications on one
server.
You must install (add) an application with the Application Manager before you can run it. To install a new application:
http://
server.domain/world
. This is a required field, and the name you type must be different from all other application names on the server. The name must include only alphanumeric characters and cannot include spaces. For more information on application URLs, see "Application URLs" on page 154.
.web
file for the application. This is a required field.
index.html
for a standard URL. This is a required field.
Note
Don't 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.
Application URLs
When you install a server-side JavaScript application, you must enter a name for it. This name determines the application URL, the URL that clients use to access a JavaScript application. Application URLs are of the form http://
server.domain
/
appName
/page.html
.
where server is the name of the HTTP server, domain is the Internet domain (including any subdomains), appName is the application name you enter when you install it, and page is the name of a page in the application.
For example, if your server is named myserver
and your domain name is mozilla.com
, the application URL for the Hello World sample application is http://
myserver
.mozilla.com/world/hello.html
.
When a client requests this URL, the server generates HTML for the specified page in the application and sends it to the client.
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
Using the previous example, any requests for URLs that begin with .web
file, circumventing the server's normal document root.
http://
myserver
.mozilla.com/world
will look for documents in the js/samples/world
directory and not in your server's normal document root.
Controlling access to a server-side JavaScript application
When you install an application, you may 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" on page 68. For more information on restricting access to part of your server, see "Controlling access to your server" on page 97.
Modifying installation parameters
To modify an application's installation parameters, select the application name in the left frame of the Application Manager and click Modify.
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
To remove the selected application, click Remove. This action 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 you subsequently want to run it, you must install it again.
Starting, stopping, and restarting a server-side JavaScript application
To start an installed application that is stopped, click Start. If the application starts successfully, clients can run the application.
To stop an active application, click Stop. The application's status changes to "stopped," and clients can no longer run the application. You must stop an application if you want to move the .web
file or update an application from a development server to a deployment server.
To restart a running application, click Restart. For any changes you have made to take effect, you must restart an application after you compile it.
You can also start, stop, and restart an application by entering a special URL of the form:
where appName is the application name and action is either http://
server.domain/appmgr/control.html?name=
appName&cmd=
action
stop
, start
, or restart
.
Running a server-side JavaScript application
There are two ways to run an installed application:
.web
file path, default page, initial page, maximum number of built-in database connections, external libraries, and client object maintenance technique. You can specify a default directory path for your development area and native executables libraries. http://developer.netscape.com/library/documentation/
.