Novell Home

Using NetWare 5 as a Web Application Server

Articles and Tips: article

FABIO EDUARDO ELIAS
Senior Consultant
Novell Consulting

01 Nov 1999


Helps non-developers get up to speed on running Web applications on a NetWare 5 server, complete with NDS, HTML, Java, PERL, NetBasic, CGI, Netscape Web Server, and Oracle 8, Includes a lab setup with exercise to provide hands-on experience with these technologies.

Forward

This AppNote deals with NetWare 5 and its Web-related products and technologies, including Novell Directory Services (NDS), HyperText Markup Language (HTML), Java, JavaScript, PERL (Practical Extraction and Reporting Language), NetBasic, CGI (Common Gateway Interface), Netscape FastTrack Web Server, and Oracle 8. It aims primarily to give non-programmers some background and experience in running Web applications on a NetWare 5 server. Thus, it will address Web applications, a broad subject, just enough to assist the reader in performing the tasks outlined in this document.

This AppNote is targeted at systems administrators, especially NetWare network administrators, to introduce them to the subject of running Web applications in the NetWare environment. It will also benefit intranet or Web site development or administration professionals, presenting the advantages of NetWare 5 as an alternative to other Web service platforms in the industry.

This AppNote covers the following topics:

  • Background information on Web applications, and the evolution of different languages and platforms for running such applications

  • NetWare 5's technologies and features for running Web applications

  • Lab exercises to give the reader some hands-on experience installing Web (and some non-Web) applications on a NetWare 5 server (these should take about two hours to complete)

After completing these lab exercises, the reader will have mastered the issues, technologies, and products dealt with throughout this document.

For more information on NetWare 5, visit the product site at:

http://www.novell.com/products/netware5/

Introduction

The Internet has fostered a revolution in the way people and companies communicate. In just a few short years, it has become a popular way for people to do research, get entertainment, and even go shopping. As a result, businesses are becoming increasingly aware of the Internet's value as a space for them to sell their image, services, or products.

This all happens in a virtual universe called the World Wide Web ("the Web") that is continually evolving. In the beginning, the Web was simply a way to access the Internet, which consisted of static pages containing only text and pictures. The Web access concept was soon extended inside companies, creating so-called "intranets." Gradually, the Web evolved into a global network made up of thousands of pages dynamically linked to directories, databases, and other services. Today, the dynamic environment of the Web allows for the creation of innovative applications and new opportunities for electronic business.

NetWare 5, Novell's state-of-the-art networking platform, has been designed from the beginning as an ideal server for Internet and intranet services and applications. By adopting open protocols and integrating services with a powerful directory service (NDS), NetWare 5 offers superior manageability, enhanced interoperability with third-party systems, and a significant reduction in Total Cost of Ownership (TCO).

A highly important feature of NetWare 5 is its capability as an application server for Web-based applications. Thanks to NetWare's high levels of security, performance, integration with NDS, and widespread market acceptance, Web applications can really show off their capabilities on the NetWare 5 platform. And since NetWare supports Java, Novell automatically adds to NetWare 5 an ever increasing group of Web developers and applications that are readily available on the market.

Evolution of Web Applications

When the Web revolution began, the fundamental piece of technology was the Web browser. This basic application could access text- and picture-rich HTML pages through the HyperText Transfer Protocol (HTTP). Hypertext is the foundation of the Web, providing the basic path through which users navigate from one page to another and from one site to another.

However, having only hypertext is a bit limiting. In a strict hypertext environment, the browser does not react to events (such as passing the mouse over a picture), nor does it allow data input or perform any logic processing. Moreover, the content shown is static: a price listing, for instance, is a mere text document that must be edited, just like any other text, if it needs to be updated.

It soon became evident that a more intelligent browser would be a big advantage. Consequently, the simple logic-less HTML document browsers were replaced by more powerful HTML browsers that can interpret the logic that is embedded in newer versions of HTML. In addition to displaying text and images, Web pages can now run forms and scripts, or refer to external programs to be run. This is very exciting because programs can be loaded on demand; they no longer have to be installed and configured at the workstations. This is a major contributor to the TCO reduction of intranet environments.

Web Programming Languages

The programs embedded in HTML are scripts called JavaScript (although, except for the name, JavaScript has nothing to do with the Java language or platform). The browser interprets the document's JavaScript instructions and runs them. This allows for decision-making and the generation of graphs, animations, formulae, messages, and so on. A great advantage of these scripts is their small size and fast loading by browsers.

However, there is also external code which is not embedded inside the HTML document but which is referenced within it. This code is also loaded and interpreted by the browser. On the Internet, the most popular way to do this is through Java "applets." The Java applet code is loaded from the Web server into the browser, and then run by the browser. (The Java platform will be discussed in more detail later in this AppNote.)

Java applets are far more powerful than JavaScript, due to their rich object- oriented architecture and to the increasing number of components available for them to use. On the other hand, the code is larger and may take longer to load, especially over slow WAN links. Of course, this is not critical for running simple applets or any applet in an intranet environment.

Logic in the Server

Although the logic in the browser is often all an application needs, this is increasingly less true as applications become richer. When a form is used in an HTML document, for example, the data usually needs to be sent somewhere. A typical example of a server-based application is one where a user fills in an information request form in the browser, clicks on a button, and receives a list of items in response. What happens in this scenario is that the browser sends the information to the Web server which, through a server-based application, prepares for the user an answer page filled in with data from a database. Since a new page is generated at every request, it is called a dynamic page, or dynamic-content page.

Several languages are used to run such logic in the server. A typical example is PERL, an interpreted (as opposed to compiled) script language. The script remains in its text form, allowing for interpretation by any server with an interpreter. This portability is one of the strengths of scripting languages. In the case of PERL, it is a significant strength because virtually all Web servers have a PERL interpreter of some kind.

On the other hand, since PERL code has to be interpreted before being sent to the processor, this approach is slower than compiled languages. Another drawback is that PERL is not as rich as other languages in the industry, which limits its usefulness for more sophisticated applications. As a result, the PERL script language is generally used only for simpler solutions.

Richer languages such as C++, Delphi, Visual Basic, NetBasic, and others can be used to interact with a Web server. The problem is that when an application is written using such languages, it is restricted to running on a single platform. For example, if you write a Visual Basic application, it will run only under Windows. A NetBasic application will run only on NetWare. Of course, C and C++ compilers are available for all platforms, but a compiled C++ application will run only on the platform for which it was written to. Even though C++ provides a certain degree of portability, it always requires some recoding for cross- platform success.

Choosing a programming language automatically ties you not only to the chosen language, but also to a platform and an operating system. However, an operating system is not defined only by the programming languages that generate code for it. It usually offers many other services beyond the Web server service.

With NetWare 5, you can use one operating system platform for your entire suite of networking services and applications. What's more, Novell recognizes the reality of the heterogeneous environment. Customers have the option to choose the operating systems they consider best for each service, yet still take advantage of homogeneous administration performed through an integrated directory service. In addition, Novell fully supports the Java language, which allows the creation of highly sophisticated projects. It also gives customers the freedom to choose an operating system regardless of the programming languages being used for application development.

The Java Platform

Besides being a programming language, Java is also a platform. A platform typically refers to an operating system, but as mentioned above, "an operating system is not defined only by the programming languages that generate code for it." In the case of Java, however, you could say that it is a platform defined only by the programming language that generates code for it.

More than any other programming language, Java stands as the model for Internet open standards. Although technically its source code is not open (Java is owned by Sun Microsystems), it has become a widely accepted standard that is present in virtually every operating system. The Java programming language is extremely powerful because it was designed by combining the best aspects of other existing languages. It is 100% object-oriented, with some features inherited from the "only platform where it runs""the JVM (Java Virtual Machine).

The JVM (Java Virtual Machine). The JVM is what makes Java a platform. As the name says, the JVM is a virtual machine (with a 64-bit "virtual processor") under which Java applications run. An operating system running Java applications must have a JVM. A browser that supports Java applets has a built-in JVM, or one running under it in the host operating system. Likewise, a Web server that supports "servlets" has a built-in JVM, or one running under it in the operating system. (Just as Java components running in browsers are called applets, the ones that interact with Web servers are called servlets.)

The code of a Java application is run by a JVM. However, each JVM knows it is responsible for running the application code in a real machine, through the host operating system. Thus, the JVM works much like an interpreter, keeping 100% compatible with the specifications of a standard JVM. But actually, Java source code (extension .java) must be compiled in a Java class (extension .class) to be run under a JVM. The code is interpreted only from the point of view of the operating system that is hosting the JVM. However, from the point of view of the JVM, the code is compiled and run by its virtual processor. The JVM's virtual machine code is called ByteCode.

Due to the translation step from the JVM code into the host processor's machine language, there is some degradation in application speed. However, the amount of degradation is steadily decreasing due to improvements in the traditional translation techniques and through additional technologies, such as JIT (Just In-Time) compilers. This technology allows already- translated (compiled) code to be retained in memory for the host processor's native instructions, rather than having to repeatedly translate the same ByteCode.

As described above, applications written in Java can be run in several ways:

  • When written to be run directly from the operating system, as any other application (a text editor, a Web server, or a Web browser), they are called Java applications.

  • When written to be run from within another application, they are called applets, as is the case of those run by Web browsers. There is some difference in the creation of applets because the way they are started is different.

  • If they are to receive data from and send data to Web servers, they are called servlets.

All these cases require the programs to be compiled in ByteCode (extension .class) in order to be run by a JVM.

Programming Tools and Application Servers. The use of Java has been increasing steadily over the past few years, as has the number of available Java programs. The same is true of Java programming tools. Several tools are available, ranging from the simplest ones to the more complete, to allow you to graphically generate applications, applets, and servlets complete with wizards, a project control environment, and other features. Many classes (well-known libraries) and components (called JavaBeans) are also available for Java.

Another interesting development is the Java application server, which creates a control layer to the servlets and makes it easier to control events, access permissions, database access, and so on. A number of companies have purchased Java application servers in order to have this additional layer for their Java systems.

Many projects in Java have taken far less development time than expected. This is because expectations were based upon previously-obtained performance using other programming languages. This difference is due mainly to the true object orientation offered by the Java platform and to other aspects of its advanced architecture.

Later in this AppNote you will find references to Web sites containing information about Java components, programming tools, and application servers. If you are interested in the Java platform, it is definitely worth experimenting with.

NetWare 5 and Web Applications

As stated previously, NetWare 5 has been designed from the very beginning to be an ideal server for Internet and intranet services and applications. Some of the most important key features offered by NetWare 5 are:

  • The ability to access all its services through the TCP/IP networking protocol

  • A new, faster, and more stable environment for running native or Java applications

  • Administration by a directory service (NDS)

When analyzing NetWare 5, it is plain to see that its services are integrated to open Internet protocols and to the NDS administrative model. A partial list of NDS-enabled services shipped with NetWare 5 includes ZENworks (Zero Effort Networks), DNS (Domain Name Services), DHCP (Dynamic Host Configuration Protocol), SLP (Service Location Protocol), NDPS (Novell Distributed Print Services), NSS (Novell Storage Services), Netscape FastTrack Web Server, JVM (Java Virtual Machine), Oracle 8, and others.

While an in-depth explanation of these services is beyond the scope of this document, the sections below summarize what NetWare 5 offers as a Web application server.

Existing Web-Related Components

NetWare 5 is a strategic platform on which it is possible to develop and implement a new generation of distributed Internet/intranet applications. The system includes and supports CORBA (Common Object Request Broker Architecture) ORBs, PKI (Public Key Infrastructure), NetBasic interpreter, JVM for NetWare, JavaBeans for NetWare, JavaScript, PERL 5, C, and C++.

Two components that are important to the development of more sophisticated e-business applications are the CORBA support (for platform-independent applications intercommunications) and the PKI implementation (for administration of electronic certificates, providing an additional security layer).

The built-in JVM brings many benefits for developing and implementing applications on NetWare 5 servers. Besides allowing Java applications and servlets (which are not NetWare-specific) to be run, the JVM offers us the possibility to use a new Graphical User Interface (GUI) in the NetWare server. The JVM is an indispensable part of NetWare 5. It is noteworthy that the JVM is loaded by default in the NetWare installation process, through a Java wizard run in the server's GUI.

Oracle 8 for NetWare

The 5-user version of Oracle 8 included in NetWare 5 features major enhancements in performance, scalability, functionality, manageability, and reliability. Oracle 8 adds to NetWare 5 the latest database resources, such as giant tables, partitioning, and object-oriented functions.

Oracle 8 for NetWare provides high performance and scalability through its unique technology, allied to NetWare's multithreaded architecture, in addition to being optimized to make the most of NetWare's multi-tasking, multi-processing and I/O features. Additionally, Oracle 8 for NetWare offers manageability and data access through the close integration with NDS.

Netscape FastTrack Web Server

The Netscape FastTrack Web Server is a full Web server. With this, NetWare 5 servers can serve pages with static and dynamic content through Java servlets and applications written in JavaScript, NetBasic, Perl, C, and C++. FastTrack also supports Secure Socket Layer (SSL), allowing the data to travel in encrypted form across the network. FastTrack offers a full architecture for installing a Web server using industry-standard applications, languages, and protocols.

Although FastTrack is included on the NetWare 5 distribution CD, a version called Netscape Enterprise Server with more resources and features than FastTrack can be freely downloaded from Novell's Web site at http://www.novell.com.

Building Real-World Applications

With the components referred to above, NetWare 5 is a full platform to host Web applications, from the simplest to the more complex and sophisticated. The remainder of this AppNote shows you how to install these components and experiment with some of them in a series of lab exercises. You will see how to run simple applications that come with NetWare 5, along with others that are included in this AppNote or available from the Web. Looking at simple applications such as these will give you a good idea of what could be implemented in larger, more sophisticated systems.

To allow you to experience a more complex system, we invite you to visit a site that is running a full e-commerce system over the Internet using the NetWare 5 platform and related components as its infrastructure. The site is ShopNovell, Novell's electronic shopping site, located at http://shop.novell.com.

The ShopNovell system allows customers to choose catalog products, put them in a virtual shopping cart, choose the delivery method, and conclude the secure transaction using a credit card. The system prevalidates the card and address, checks for fraud, and calculates taxes. It then sends the already-confirmed order to the delivery company, and the bill to the credit card company.

ShopNovell uses a 100% Java e-commerce application server that, in turn, uses the CORBA architecture to deploy its components through the several system servers working in a cluster to offer high system availability and scalability. The site is sped up and protected by Novell BorderManager. Four Web servers running Netscape Enterprise Server for NetWare with SSL interact with the clients. These servers run a blend of Java servlets, JavaScript, and HTML. The servlets communicate via CORBA with the Java application server, which in turn accesses the database server via JDBC (Java DataBase Connectivity).

Example Applications

The example applications are presented as a lab exercise to demonstrate how to run Web applications on a NetWare 5 server. For the purposes of this AppNote, the applications are intentionally simple and are independent of any particular development and run environment (for Java servlets). They have been developed by members of DeveloperNet, Novell's developer program, and are downloadable from the Internet. The file that contains these applications is called NW5LABUS.ZIP, located at http://www.novell.com/coolsolutions/tools/13826.html.

Although this is a technical exercise to demonstrate how to run applications, its goal is not to teach you how to program. However, it can help in this purpose, and consequently we have included simple, concise, and easily editable code.

Lab Setup

For this lab, you'll need two computers: a server and a workstation. The server should be a Pentium-class computer (preferably Pentium Pro or Pentium II) with at least 128 MB of RAM and a 2.1-GB hard drive. The workstation should have at least 16 MB of RAM (depending on the Windows version) and a 1.2-GB hard drive.

On the server, you'll install NetWare 5, Oracle 8, and Netscape FastTrack Server, along with various Java applications, servlets, and NetBasic scripts. Oracle 8 (5-user license) and FastTrack are included with NetWare 5. The additional components necessary for running the servlets can be downloaded from the DeveloperNet site at no additional cost.

The following sections provide step-by-step instructions on how to install and configure the software components for the lab. Once this is done, we present a lab script that walks you through the process of testing the applications running in the NetWare server. It is recommended that you follow the lab script from beginning to end, following the sequence outlined in this AppNote.

Installing the NetWare 5 Server

The first step is to install a NetWare 5 server with the following parameters:

  • NetWare 5 server name: APPLAB_NW5

  • 50 MB DOS partition

  • 2 GB NetWare partition

  • SYS volume: 1500 MB, default configuration

  • Oracle volume: 500 MB, no compression, no suballocation, with 16KB block size (although the Oracle database can be placed on the SYS: volume, we prefer to create a separate volume to maximize system performance)

    The NSS (Novell Storage Services) file system is an excellent option for databases due to its high scalability and reliability. The Oracle volume can be created in NSS, but in order to do so, 500 MB of space must exist outside the traditional NetWare partition, in a portion of the disk that is not yet partitioned.

  • A new NDS tree, named APPLAB_TREE, with a single container O=LAB containing all the objects

  • Administrator account created as "CN=Admin.O=LAB", with the password "LABPASS"

  • Protocols: IP must be enabled, IPX is optional

  • Add the following line to the SYS:\etc\hosts file:

    nnn.nnn.nnn.nnnlab.mylabsite.com

    where nnn.nnn.nnn.nnn is your server's IP address. In the applications used in this lab, your server will be referenced by this name (lab.mylabsite.com). This reference is being placed in the server to avoid the need for inserting it in your organization's DNS (which you could do as an alternative to adding this line to the hosts file).

Workstation Setup

A workstation running Windows 95/98 or NT Workstation is needed to install some components of the lab and to run a browser to test the applications running in the NetWare 5 server.

Set up this workstation as follows:

  • Install the TCP/IP protocol and a Web browser (Netscape Navigator or Microsoft Internet Explorer).

  • Install Novell Client 32 included in NetWare 5, or a more recent version downloaded from http://www.novell.com/download/(this software will be needed in the lab only for FastTrack installation).

  • Add the following line to the C:/windows/hosts file:

    nnn.nnn.nnn.nnnlab.mylabsite.com

    where nnn.nnn.nnn.nnn is your server's IP address. In the applications used in this lab, your server will be referenced by this name (lab.mylabsite.com). This reference is being placed in the workstation to avoid the need for inserting it in your organization's DNS (which you could do as an alternative to adding this line to the hosts file).

Installing the Netscape FastTrack Web Server

FastTrack is included with NetWare 5. The setup software is found on the NetWare 5 Install CD, in the directory <CD_drive:<\products\webserv.

At the workstation with NetWare Client 32 loaded, log in to the APPLAB_NW5 server as Admin and run SETUP.EXE from the directory specified above. Customize the following items:

  • Change "Admin Port" to the number 30000.

  • Leave the administrator user as Admin and, to make memorization easier in the lab, set the same password as for NetWare (LABPASS).

  • In the AUTOEXEC.NCF Options, select "Change the Autoexec.ncf file."

After the installation, choose "Launch Server" to load FastTrack, or load it manually via the server console by typing "NSWEB "Enter"".

Installing Oracle 8

A copy of Oracle 8, with a 5-user license, is included in NetWare 5. It is installed as follows:

  1. Load NWCONFIG.NLM and select Product Options | Install a product not listed.

  2. Press <F3< and type the CD drive letter or the volume ID number assigned when the CD was mounted (mount the CD as a volume by typing <CDROM< at the console and (re)inserting the Oracle 8 CD). For example, you might enter <O8NW8030:NetWare\Install< where O8NW8030: is the volume ID for the mounted CD.

  3. Proceed normally with the installation, entering the company name and other information as requested. Change only the following information specific to the lab:

    • For "Volume" choose "Oracle".

    • For "Password" enter (and confirm) "LABPASS".

    • For "Choose Protocol" choose only TCP/IP.

    • For "Choose TCP/IP Host Name", enter "lab.mylabsite.com".

    • For "Choose JDBC Components", choose "JDK 1.1 JDBC OCI Driver" and "JDK 1.1 JDBC Thin Driver".

  4. Edit the SYS:\etc\java.cfgfile and add the following line at the end:

    CLASSPATH=$CLASSPATH;ORACLE:\oranw803\JDBC\lib\classes111.zip

  5. Edit the SYS:SYSTEM\AUTOEXEC.NCF file and add the following lines at the end to automatically start the Oracle database:

    ORALOAD ORASTART

  6. To start Oracle now, type the following commands at the server console:

    ORALOAD ORASTART

Note: When run, ORASTART.NCF will request the password used at Oracle 8 installation (the password is LABPASS). If you want to skip this, edit the STARTDB.SQL file located in the ORACLE:ORANW803\NLM directory and change the line "CONNECT INTERNAL" to "CONNECT INTERNAL /LABPASS".

To unload Oracle, type ORASTOP and then ORAUNLD. As with the ORASTART command, the ORASTOP command will request the password used at Oracle 8 installation. To skip this, edit the STOPDB.SQL file and change the line "CONNECT INTERNAL" to "CONNECT INTERNAL /LABPASS.

Accessing DeveloperNet Components

Novell's DeveloperNet site contains upgrades for various components used in the development and running of applications, both in the server and in workstations, as well as for many programming languages. At this site, you can access the components and their documentation, examples, publications, and more.

To download components, you must register with the DeveloperNet program. Don't worry, you can sign up in the "Electronic" category free of cost. To do this, go to http://developer.novell.com and click on Subscribe (or go directly to http://developer.novell.com/cgi-bin/nvolve/register?).

This lab requires the Servlet Gateway for NetWare. If you do not have this component, go to http://developer.novell.com, click on "Kits and Downloads", then click "Novell Developer Kit" and "Downloads" (or go directly to http://developer.novell.com/ndk/download.htm). Download the component "Servlet Gateway for NetWare" (the SERVGATE.EXE file).

Before the download, your DeveloperNet PIN and password will be requested. You received these when you registered with the DeveloperNet program.

Installing the Servlet Gateway for NetWare. After downloading the component, run SERVGATE.EXE from the workstation with Client 32 loaded, logged in to the APPLAB_NW5 server as Admin. To install it on the APPLAB_NW5 server, go to the server console and follow the steps given below.

Note: The way in which Servlet Gateway for NetWare configures FastTrack may be changed in future versions. If necessary, check for new procedures in the README.TXT file included with the component.

  1. To change the FastTrack configuration, type the following command:

    SG4NWCFG

  2. Unload FastTrack and the JVM with the following commands:

    NVXWEBDN JAVA -EXIT

  3. At the end of the SYS:\etc\java.cfg file, add the following lines:

    CLASSPATH=$CLASSPATH;$SERVLETCLASSPATH SERVLETCLASSPATH=$CLASSPATH

  4. Reload the JVM and FastTrack with these commands:

    JAVA NVXWEBUP

Installing the Sample Web Applications

When installing files as described in the sections below, keep in mind that Java applications are usually case-sensitive. Be sure to enter the commands with upper- and lower-case characters exactly as shown.

ChangePassword. This is actually two independent applications: one written in the Java servlet format, and the other as a NetBasic script. To install them, copy the files from the ChangePassword directory of the NW5LABUS.ZIP archive to the directories shown below:

  • ChangePassword.htm SYS:\Novonyx\suitespot\docs\ChangePassword.htm

  • ChangePassword.bas -> SYS:\Netbasic\web\ChangePassword.bas

  • ChangePassword.java -> SYS:\java\servlets\ChangePassword.java

  • ChangePassword.class -> SYS:\java\servlets\ChangePassword.class

Books. This sample application is actually two applications and one Java servlet. These pieces are independent when running, but all of them are necessary to a functional application (one creates the data tables, the second changes them, and the last performs queries).

To install this application, copy the files contained in the Books directory in the NW5LABBR.ZIP archive to the directories described below (create the directories if they do not exist):

  • MakeDB\* -> SYS:\java\apps\books\MakeDB\*

  • QueryDB\* -> SYS:\java\apps\books\QueryDB\*

  • ServletJava\*.htm -> SYS:\Novonyx\suitespot\docs\*.htm

  • ServletJava\*.java -> SYS:\java\servlets\*.java

  • ServletJava\*.class -> SYS:\java\servlets\*.class

Next, run the MakeDB application to create the tables to be used by the QueryDB application and by the Books servlet. The tables' content is previously stored in four .TXT files, which will be imported to the new tables. Type these commands at the NetWare 5 console:

envset cwd=\java\apps\books\makedb java MakeDB Books.txt java MakeDB Authors.txt java MakeDB BooksAuthors.txt java MakeDB Publishers.txt

What Else to Install?

The components installed up to this point are enough to perform the lab exercises outlined in this AppNote. However, the items below can improve the overall system performance and enhance your lab experience.

Product Updates. When this document was written, both NetWare 5 and Netscape FastTrack had updates and patches available. Other system components can be separately upgraded before being added to larger packs, as happens with DeveloperNet components (JVM, NCSL, Beans Services, Servlet Gateway for NetWare, and so on).

Out of these upgrades, the support packs (such as Support Pack for NetWare 5, found at http://support.novell.com/misc/patlst.htm, as well as other upgrades on that page) are the most important for better system performance and stability. We have not included them here as necessary items because the lab uses an independent NDS tree and meets all the objectives with no upgrades required. If you want better system performance and stability, go ahead and install the upgrades.

HotJava Browser. The HotJava Browser is a 100% Java-written Web browser. Thus, it can be run on any platform with a JVM, which includes NetWare 5. When this document was written, the latest release was 1.1.5. To install this version on NetWare 5, follow these steps.

  1. Download the "HotJava Browser 1.1.5 for Other Platforms" from http://java.sun.com/products/hotjava/index.html.

  2. Decompress the HJB115-GENERIC.ZIP archive (for release 1.1.5) in the SYS:\java\apps\HotJava directory. The decompression will create the directory SYS:\java\apps\HotJava1.1.5; rename it to SYS:\java\apps\HotJava.

  3. Create a HOTJAVA.NCF file with the following lines:

    envset HOTJAVA_HOME = \java\Apps\HotJava

    envset CWD = \java\Apps\HotJava

    java -classpath \java\Apps\HotJava\lib\;\java\Apps\HotJava\lib\classes.zip;\java\lib\classes.zip -ms4m -mx32m -Dhotjava.home=\java\Apps\HotJava -Djava.home=\java sunw.hotjava.Main

To run the browser, type HOTJAVA at the server console. If you want to include the browser in the GUI's Novell menu, edit the SYS:\java\nwgfx\fvwm2\ fvwm2rc5xx file. You can also change the GUI resolution through the Novell | Tools | Display Properties menu option. Both changes require you to exit the GUI and restart it (the command is STARTX at the server console).

Other Web Applications. A range of other applications can be downloaded from the Internet to be run on the NetWare 5 server. Here are a few sites:

  • Novell DeveloperNet. The sample code page is at http://developer.novell.com/ndk/sample.htm

  • Servlet Central. This site contains several interesting articles about Servlets. The home page is at http://www.servletcentral.com/, and the page with links to products is at the hyperlink "Servlet Archive".

  • TUCOWS. This is a site with several downloadable programs, having also many mirrors around the world. It features a Java-specific zone, not necessarily with Web applications, that can be part of a site, such as Chat-IRC applications. Access the site at http://www.tucows.com.

  • Java Home Page. This is the Sun Microsystems Java page containing manuals, JDKs, and a number of additional resources. The address is http://java.sun.com.

  • HiTecSoft. HiTecSoft is the company that developed NetBasic. This site contains more NetBasic scripts (WebConsole for NetWare is noteworthy) and the NetBasic Compiler SDK that makes development easier and allows the NetBasic scripts to be compiled in NLMs. Their home page is at http://www.hitecsoft.com.

The Lab Script

With FastTrack installed, you are prepared to run CGI and NLM programs (written in C or C++), as well as scripts in NetBasic, PERL, and JavaScript on the NetWare 5 server. With Oracle 8 installed, these applications can access the databases they manage. The installation of Servlet Gateway for NetWare allows servlets running on NetWare 5 to interface with FastTrack.

The NetWare 5 environment is now fully set up to run a broad range of Web applications, from a variety of development languages. These applications can run various tasks such as sales support, e-business, process management, administration of networks and other resources, and so on. They can access a number of services to perform their tasks. The two chief services we will work with in this lab are NDS and Oracle 8. NDS is an essential service for user identification and access control. Access to Oracle 8 is also critical, since most dynamic Web applications interact with databases.

Exercise 1: ChangePassword (Accessing NDS Using NetBasic)

The ChangePassword applications have a simple goal: to change the password of an NDS user by means of a Web browser. Before proceeding, you need to create a user:

  • Create the user "John" in the context O=LAB. The last name can be "Doe". Assign the password "111" to this user.

Now test the password-changing NetBasic script as follows:

  1. At the workstation, load a Web browser (Netscape Navigator or Internet Explorer) and access the following page:

    http://lab.mylabsite.com/netbasic/ChangePassword.bas

  2. Note that the page titled "NDS Password Change" has been loaded. Fill in the following data:

    • User: CN=John.O=LAB

    • Current Password:111

    • New Password:222

    • Confirm the New Password:222

  3. Click on the Change Password button. You should see the message "Your password has been successfully changed!".

  4. Click on the Back button in your browser, then click again on the Change Password button. This time you should see the message "Unable to log on NDS with these data." This is because you have entered John's current password as 111, when actually it has been changed to 222.

To better understand how this application works, examine the script source code (ChangePassword.bas). If you want to try your hand at editing the code, you'll find a NetBasic on-line manual at the Novell DeveloperNet site (http://developer.novell.com) or at HiTecSoft's site (http://www.hitecsoft.com). You can also download additional sample code from these sites.

Remember that NetBasic can have its scripts compiled into NLMs by using the NetBasic Compiler SDK. It can be used to generate not only scripts with CGI (via Web Server), but also with data input and output via NetWare text console.

Exercise 2: ChangePassword (Accessing NDS Using Java Servlets)

Next we will use a servlet to perform the same function as with the NetBasic script. The Java ChangePassword servlet has several internal definitions that are tied to the lab's tree name, context, and Admin name and password. If any of this information has been changed, you will need to change and recompile the SYS:\java\servlets\ChangePassword.java file, as explained later, before proceeding.

  1. From your Web browser, go to the following page:

    http://lab.mylabsite.com/ChangePassword.htm

  2. Note that the page is different than the NetBasic version, although the title remains "NDS Password Change". Fill in the form with the following data (taking into account that user John now has the password "222"):

    • User: John

    • Current Password: 222

    • New Password:111

    • Confirm the New Password: 111

  3. Click on the Change Password button. You should see the message "Password successfully changed!".

  4. Click on the Back button in your browser, then click again on the Change Password button. This time you should see the message "Invalid Current Password!", just like happened with the NetBasic script.

One difference that can be noted in this ChangePassword implementation relative to the one in NetBasic is that here you typed only "John", while in the first you typed ".CN=John.O=LAB". This happens because we are not implementing the strings treatment in the NetBasic script, whereas we do in the servlet (although somewhat poorly).

Another fundamental difference is that this servlet can be installed not only on a NetWare server, but also on servers running Solaris, Linux, Windows NT, or any other platform with a JVM. And it is not necessary to recompile the code!

In the servlet-based solution, the form is in HTML at SYS:\Novonyx\ suitespot\docs\ChangePassword.htm. We suggest the addition of more dynamism and intelligence on the client side, by adding Java Script to this page. You can study the logic running on the server side for the servlet in the ChangePassword.class file; source code is in ChangePassword.java (both located in the SYS:\java\servlets\ directory). If you change the source code, you must recompile it through the following commands at the server:

envset cwd=\java\servlets javac ChangePassword.java

After recompiling, the old ChangePassword.class will remain in use (and not the recompiled one). Actually, this reflects a great benefit of servlets: they are retained in server memory, offering a much higher performance in sites with intensive activity. It also offers the possibility of having several concurrent sessions in the same servlet.

To unload a version of the ChangePassword servlet from the NetWare 5 server memory, use a utility included in the Servlet Gateway for NetWare. In your browser, go to http://lab.mylabsite.com/servlet/ServletManager(User Name=servlet, Password=manager). Click on "Unload ChangePassword". When the servlet is requested again, it will be automatically loaded from its new (recompiled) version.

To enhance this servlet and even create other ones, you will find many development tools, Java classes, Java Beans, and other resources readily available on the Web. The sites already referred to in this document are good points to start from. The JDK documentation (Java Development Kit) can be found athttp://java.sun.com/docs/index.html.

Exercise 3: Books (Accessing Oracle 8)

"Books" is a combination of two Java applications (MakeDB and QueryDB) and a Java servlet (Books). The first application, MakeDB, has already been used during the application install process to create the tables in the Oracle database. You may have noticed that this application has run fully in the server and that its interface has been the NetWare text console.

Note: Although not the ultimate goal of this document, we have seen that you can have (non-Web) applications written in Java running on the NetWare server. Actually, a number of applications work under this model, and that can open a whole new dimension of solutions for your network.

The second application, QueryDB, also runs fully in the server, or in a workstation if you have a JVM (such as Sun's JDK) installed on it. Unlike MakeDB, QueryDB uses the GUI. To load it on the NetWare server, type the following commands at the console:

envset cwd=\java\apps\books\querydb java QueryDB

You can also create the SYS:\SYSTEM\QUERYDB.NCF file with the lines above and run the application by typing QUERYDB at the console. If you want to include it in the GUI's Novell menu, edit the SYS:\java\nwgfx\ fvwm2\ fvwm2rc5xx file. You can also change the GUI resolution through the Novell | Tools | Display Properties menu option. Both changes require that you exit the GUI and restart it (the command is STARTXat the server console).

When loading the QueryDB application, you should see the window "Oracle 8 for NetWare access demonstration." This application is a demonstration of basic functions typically performed in a bookstore. From QueryDB, the bookstore manager can do a search by clicking on the Search button. He/she can list all (default) or just a few items, according to the restrictions in "Authors" and "Publishers." The Price Change button can be used only when a publishing house is selected in "Publishers", since rebates or raises are offered by publishing houses.

To explore this application, perform the following operations:

  1. Click (and hold) on "Authors" and select "All".

    Tip: If you cannot make the authors list scroll up or down with the mouse, hold the button down in "Authors" and use the keyboard arrows to select (go up until you reach the top and you should find "All").

  2. Click (and hold) on "Publishers" and select "All".

  3. Click on "Search": Access to Oracle 8 database using Java Servlet.

  4. Click on "Price Change": you will see the message "Sorry, but this cannot be done". This is because price changes can be done only for one publishing house at a time.

  5. Click (and hold) on "Publishers" and select "Academic Press".

  6. Click on "Search": you will see only one book in the list (the only one for this publishing house), called Advanced HTML " CGI Writer's Companion, costing $29.95.

  7. Type "10" in the field next to Price Change, click on "Price Change", and then click on "Search": you should see the same book, but the price has risen $10 to $39.95.

  8. Type "-10" in the field next to Price Change, click on "Price Change", and then click on "Search": you should see the same book, but the price has been reduced by $10, going back to $29.95.

Of course, an application to manage the books in a bookstore should do much more than this. This sample application aims to give you an idea of what can be done. A more sophisticated version would have the ability to add and delete records, change the prices in a percent base, and so on.

Now imagine that this bookstore wants its customers to be able to search its book catalog via the Internet. This is exactly what you will do now, using the "Books" servlet.

  1. From your Web browser, go to the following page:

    http://lab.mylabsite.com/Books.htm

    A page will be shown having the title "Access to Oracle 8 database using Java Servlets".

  2. Click on "List Prices Table": you will see a list of all the books. Note that Advanced HTML " CGI Writer's Companion is the third book and its price is $29.95, according to your last price change using QueryDB.

You could use QueryDB and the Books servlet together to check whether, after changing a price, it is updated in the browser when you reload the page.

This servlet could be enhanced further to allow searches with restrictions, or to allow the user to register (in the NDS or in an Oracle 8 table) and do shopping. This would be stepping up to a full e-business level, not only for queries, but also for sales.

Exercise 4: FastTrack Scripts Demonstration

In addition to the NetBasic scripts seen above, when you install FastTrack it is possible to run PERL 5 and JavaScript scripts on the server side (in this case, run by the Web server, and not by the browser). These languages, like Java, have the advantage of being supported by multiple platforms. However, neither their portability nor their architectures can parallel the Java platform. In addition to these scripting languages and Java Servlets, CGIs NLM can be integrated with FastTrack.

From the "Scripting" option at FastTrack's default home page, you can access sample scripts written in JavaScript, PERL 5, NetBasic, and CGI (NDS Browser). However, you must do some configuration to run the scripts in JavaScript and the CGI NDS Browser. JavaScript support at the server is disabled in FastTrack, and it is necessary to enable it. To do so, follow these steps:

  1. Enter the URL http://lab.mylabsite.com:30000.

  2. Log in with the name "Admin" and the password "labpass".

  3. You will enter the Netscape Server Administration page. Click on "applab_nw5".

  4. You probably will see "Warning: manual edits not loaded". This is due to changes done by SG4NWCFG.NCF when you installed the Servlet Gateway for NetWare. Click OK.

    Click on Apply(at the top of the page), click Load Configuration Files, then click OK. Now the warning is no longer shown.

  5. Click on Programs(at the upper bar, in the page).

  6. Click on Server Side Javascript.

  7. Choose "Yes" for both options and click OK.

  8. Click on Save and Apply and, after the changes, click OK.

The JavaScript support at the server is now enabled in FastTrack. If you have not updated FastTrack in NetWare 5, you will face a problem trying to run the NDS Browser CGI. This problem has already been fixed in newer versions of FastTrack. However, you can easily overcome the problem as follows:

  1. Given that you are still at the "Programs" option of the Netscape FastTrack Server 3 page, click on CGI Directory.

  2. At the "Prefix: /lcgi" line, click on Edit.

  3. Edit the "CGI directory" field from "/novonyx/suitespot/lcgi-bin" to "/novonyx/suites~1/lcgi-bin".

  4. Click on Save and Apply and, after the changes, click OK.

Now you are ready to test all items of the FastTrack scripting page by pointing your browser to http://lab.mylabsite.com/scripting.html.

What Else to Test?

As discussed in the "What Else to Install?" section, you can install and test several other Java Servlets and scripts that can be found on the Internet and which will help you enhance your Web site.

The Internet as a Source for Resources. Talking specifically about Java, you can test development tools which allow programming with full graphic support, or even test Java application servers in NetWare. They will build a control layer for your servlets and make easier the control of events, access permissions, database access, and so on.

You can also test "non-Web" applications on the server, such as the HotJava Browser. Although a browser does not seem a very interesting example of application to be run in the server, it can be useful in some administrative tasks.

Installing a Chat Server. If you install the HotJava Browser on your NetWare server, or have a second workstation configured in your lab, you can test a Java application that can enhance your site: an IRC (Internet Relay Chat). An IRC allows several people to access "virtual rooms" and "talk" with each other. They can conduct meetings that are more serious or access it just for fun. The rooms can be public or private.

One IRC client/server application written in Java is FastChat Client Server. You can download it from TUCOWS (http://www.tucows.com) by following the "Java" and "Chat - IRC" links. We have tested shareware release 1.1.0. Below are some tips on how to install it:

  1. Decompress the FASTCHAT.ZIP archive and copy the install.class file to the SYS:\java\apps\FastChat directory.

  2. At the server console, type:

    envset cwd=\java\apps\FastChat java install

    The install software will load a Wizard at the server GUI and finish the installation. At the end, the Wizard warns you that a batch file has not been created because it does not know how to do it in NetWare 5. But this is easy to do (see Step 3).

  3. Create a SYS:\SYSTEM\FASTCHAT.NCF file containing the following lines:

    envset cwd=\java\apps\FastChat java ChatServer 7009

    7009 is the IP port the IRC will use. If you need to change this number, it should be changed in the client (as described below).

  4. Type FASTCHAT at the server console to load the Chat server.

    To unload it, type "java -show", write down the ChatServer ID, and then type "java -kill ###", where ### is the ChatServer ID.

Now your IRC server is up. For the clients to use the IRC, they should load the Client system portion. In the case of this system, Client is a light Java applet which should be loaded into the browser through an HTML page.

Here's how to copy the files under FastTrack and use two clients:

  1. Copy SYS:\java\apps\FastChat\*.* to SYS:\Novonyx\suitespot\docs\ FastChat\*.*.

  2. In the first browser, enter the URL http://lab.mylabsite.com/fastchat/chatclient.html.

  3. The ChatClient applet will be loaded. Type "User1"Enter"" where it says "Type Here".

  4. In the second browser, enter the same URL. Type "User2 "Enter"" where it says "Type Here".

    Now you have User1 and User2 connected to the same "virtual room" of your IRC server.

The customizable client has various additional options, and you can create many rooms, public or private. Refer to the readme.txt file for details.

Tips for Running the JVM in NetWare

JVM Environment. The SYS:\etc\java.cfg file has a number of environment commands that are run when the NetWare JVM (JAVA.NLM) is loaded. The JVM environment variables in NetWare can be seen by typing the "envset" command at the system console.

To create or change a variable (called, for instance, JAVA_TEST) to the value "abc", use the command "envset JAVA_TEST=abc". To add ";def" at the end, type "envset JAVA_TEST=$JAVA_TESTE;def". To delete the variable, type "envset JAVA_TEST=".

An important variable is CLASSPATH. As in any JVM, this variable shows the JVM where to look for Java classes. A system often cannot be run because it does not find a class due to the lack of definition of a file or directory in this variable.

Another important variable is CWD, which shows the default directory. Very often, the simplest way to run a Java program is to change the default directory to the program location, and load program.class using the "Java program" command.

Commands can be grouped within .NCF files, as you have done a few times during the lab exercises.

Performance. The NetWare JVM will become much faster when the system upgrades are applied. Another point to note is that the JIT is not enabled by default. To enable it, you can permanently define the JAVA_COMPILER (envset JAVA_COMPILER=symcjit) variable in SYS:\etc\java.cfg, or add/remove it in NCF files of specific applications.

For instance, in the NetWare 5 original release (without upgrades), the JIT caused an error loading the ConsoleOne application. You can enable the JIT by default at SYS:\etc\java.cfg and, within SYS:\public\mgmt\console1\ console1.ncf, include the command "envset JAVA_COMPILER=" before the application load, and the command "? envset JAVA_COMPILER=symcjit" (the "?" will cause, by default, a 10-second delay) after the application load.

Command Line Options. To see the normal command line options of a JVM, run the command "java -help" at the server console. For NetWare-specific options, run the command "java -nwhelp". These options are quite useful.

The GUI's "Novell" Menu. The GUI definitions, such as wallpaper and the "Novell" menu at the footer are defined in the SYS:\java\nwgfx\fvwm2\ fvwm2rc5xx file. This is a text file that can be edited either manually or by applications (not yet included in the product, but can be written) to change the GUI aspects. You will have to restart the GUI to enable the new configuration (exit the GUI and type STARTX to load it again).

GUI Resolution. You can change the GUI resolution through the Novell menu, Tools | Display Properties. You will have to restart the GUI to enable the new configuration (exit the GUI and type STARTXto load it again).

Running the JVM in NetWare 4. The NetWare JVM is not included in NetWare 4, but it can be installed on servers running NetWare 4.1x or later. In fact, it is possible to perform this AppNote's NetWare 5 lab exercises with NetWare 4, after downloading and installing the following files from Novell's DeveloperNet site:

  • Novell JVM for NetWare (jvm.exe)

  • Novell Class Libraries for Java (njcl.exe)

  • Beans for Novell Services (bns.exe)

Conclusion

This AppNote has provided a basic introduction to running Web applications and related technologies on the NetWare 5 platform. It has also presented several lab exercises and sample applications to help non-programmers gain some hands-on experience with these technologies. The reader is invited to explore further by using the references listed below.

Additional References

  • Java Servlets by Karl Moss (Computing McGraw-Hill, July 1998, ISBN 0079137792)

  • JDBC Database Access with Java: A Tutorial and Annotated Reference by Hamilton/Fisher/Cattell (Addison-Wesley, August 1997, ISBN 0201309955)

  • Core Java 1.1 (Vol. I and Vol. II) by Horstmann and Cornell (Prentice Hall, December 1998, ISBN 0137669658)

  • Beans for Novell Services sample code available at http://www.developer.novell.com/

In addition, the source code of the "Books" applications has been used by permission of its author, Francisco Jacob, Internet specialist and member of Novell's DeveloperNet program. He can be contacted at the e-mail address fjacob@linkway.com.br.

In writing the ChangePassword.java servlet, we obtained permission to use source code previously written by Euclides Junior, Web applications developer and member of Novell's DeveloperNet program. He can be contacted at the e-mail address euclidesjr@hotmail.com.

* Originally published in Novell AppNotes


Disclaimer

The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.

© 2014 Novell