Database Web Server

Software Installation Guide

 

 

 

By: Scott Selikoff

Last Modified: July 20, 2002

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Introduction

 

 

            This installation guide will direct you through the process of setting up a database web server as well as setting up a database client to access the server.  The database software used in this manual is IBMâ DB2 and the application web server is Apache Tomcat.  The specific versions of these products used by this guide are:

·  IBMâ DB2 Universal Enterprise Edition 7.2

·  Sunâ Java J2SE v1.4.0_01, SDK

·  Apache Jakarta-Tomcat 4.0.4

 

Although this guide uses examples from these specific versions of Java, DB2, and Tomcat, the version of these products is generally invariant of the installation procedure.  Also note that there is a wealth of information available on the Internet about these products.

 

 

            Here is a quick reference chart for the installation guide:

 

Section

Page

  I.  Setting up a Database Web Server

         Step 1:  Install the DB2 Server Software

3

         Step 2:  Add a new Database

7

         Step 3:  Setting up the Environmental Variables

9

         Step 4:  Install the Java SDK Software

12

         Step 5:  Install Apache Tomcat Web Software

16

         Step 6:  Configure Java and Tomcat

22

 

II.  Setting up a Database Client

         Step 1:  Install the DB2 Client Software

27

         Step 2:  Connect to a Database

28

 

 

 


I.  Setting up a Database Web Server

 

 

            Prerequisites:

 

·  OS:  Win2k/WinNT, or equivalent Server Software

·  Up to 700 MB

·  Local Network or Internet Access

 

 

            Step 1:  Install the DB2 Server Software

 

1.  First, insert your IBM DB2 installation CD into the computer you wish to install to.  If you are installing from another location such as the harddrive or a network or if the installation process does not begin when you insert the CD, locate the installation files and select setup.exe from the main installation directory.

 

            The DB2 pre-installation guide will then open:

 

 

            Click Install to begin the process.


 

 

Note:  If DB2 is all ready installed, you may receive a warning message similar to the following:

 

 

If the computer is currently being used as an online server, it is recommended that you select No and take the databases offline properly before continuing.  You can then continue with the installation afterwards.  Alternatively, if the system is not currently being used or you have no concern for the previous database system, then select Yes to continue.

 

 

 

 

2.  The first installation window will ask you which DB2 packages you would like to install.  Keep in mind that while the packages available for your installation version of DB2 may vary slightly from the ones we have listed, the server installation software is essential.  If this package is not available, it may be because you are not running WinNT/Win2k.

 

 

            The packages available for DB2 7.2 Enterprise Edition are:

 

·  DB2 Enterprise Edition:  Required to run a Server

·  DB2 Application Development Client:  Operational

·  DB2 Administration Client:  Recommended.  Required if you plan to perform client-side modifications of the database from the server computer.

 

            Once done selecting the packages, Click Next

 

 

3.  The installation program will then ask what type of installation you would like.  Select a Typical unless you wish to customize the files to be installed.

     Click Next

 

4.  Choose a drive to install DB2 to.  The Space required field will tell you how much space the installation will take up once complete.

     Click Next

 

 

5. Next, select a username and password for the central database server.  We recommend choosing a complex password since the system account is of high importance.  Make sure the check box at the bottom is checked.  This will help to simplify managing your system.

 

 

            Once done entering your username and password, Click Next

 

 

6.  The installation program will most likely ask you to confirm the creation of the account, which you can do by just select Yes.

 

 

 

 The final page before installation will appear, confirming the installation settings:

 

 

            Click Next

 

 

            The installation program will now begin copying files.  Afterwards, it may take some time configuring your system, so please be patient while it works.  You should reboot the computer after installation is complete.

 

 

 

           


            Step 2:  Add a new Database

 

1.  From the Windows Start Menu, choose:

               Start Menu à Program Files à IBM DB2 à Control Center

 

2.  Expand the Systems folder and select the computer you wish to add the database to.  If this the local computer you are currently using, then the network name of your computer will appear in the list.

 

3.  Expand the Instances\DB2 folder of the computer you selected.

 

4.  Right click on the Databases folder, select Create à Database Using Wizard

 

 

             The Database Creation Wizard will now open to help facilitate you in the creation of your 

            new database

 

 

5.  First, enter the general database info as follows:

 

·  Database name:  System name of the database.  Choose something short and simple

·  Default drive:  Drive to store the database files on

·  Alias:  Simple name or nickname to reference the database by

·  Comment:  Single sentence containing a short description of the database

 

Click Next

 

6.  The next five windows ask you many questions including how you would like to manage storage space for different types of tables.  We recommend that unless you have any specific designs in mind for the database, you allow DB2 to auto-configure this information for you.  Simply keep clicking Next.

 

7.  Finally, select Finish.  The following dialogue will appear and you will be notified when the process is complete.

 

 

8.  Try viewing your table using the Control Center since this application was opened when you created the database.  Locate your system and database folder and see if the new database you created appears in the list.  You may need to perform Refresh to update the system profile.  Simply select Refresh off of View on the menu bar.

 

            You may also try connecting to your database as a client either locally from the server itself or from another computer on the network.  Recall that if did not install the Client Administration package during Step 1, you must connect from another computer on the network to use most of the client tools.  For instructions on how to set up a computer on the network for remote database access, please refer to Section II.

           


            Step 3:  Setting up the Environmental Variables

 

 

1.  Next, we need to set up some environmental variables so that the different applications will knows where each others’ files.  This step is actually being done before installing any of the applications involved simply because some of the installations require some of them to be set, and since it does not hurt to set them all before installing any applications, we will do it now.

 

     Note that you must, when installing Java JDK and Tomcat, use the application paths that you set in this step.  If you want to place them into different locations, you must remember to go back and change the values you are entering now to reflect this information.

 

 

2a)  In WinNT/Win2k,

        From the Windows Start Menu, go to:

                                    Start Menu à Control Panel à System

 

                        Select the Advanced Tab at the top:

 

 


 Next, Select Environmental Variables:

 

           

We are going to add new System variables, which is the second section.  Please add the following variables and values.

    

System Variable

Value

CATALINA_HOME

C:\Tomcat

CLASS_PATH

C:\jdk\bin;c:\tomcat\common\lib\servlet.jar;C:\jdk\lib\tools.jar

JAVA_HOME

C:\JDK

TOMCAT_HOME

C:\Tomcat

 

     We accomplish this by select New from the bottom taskbar and entering the values in the box as so:

 

 

     Repeat the process for all four system variables.  Note that some of them may all ready exist on your computer, so you just need to Edit them to make sure they have the correct value.  Also note that if you install these applications in different locations than we have recommend, you will need to update these values to reflect these changes later on.


2b)  In Win95/Win98,

        From the Windows Start Menu, go to Run, type Edit, and hit Enter.

 

        Now, we are going to modify the system Autoexec.bat file to include this information.  On the File menu go to Open, and type C:\autoexec.bat.  The file should then open.

 

 

Then, just simply cut and paste the follow lines at the end of the file:

 

 

SET CATALINA_HOME = C:\Tomcat

SET CLASS_PATH = C:\jdk\bin;c:\tomcat\common\lib\servlet.jar;C:\jdk\lib\tools.jar

SET JAVA_HOME = C:\JDK

SET TOMCAT_HOME = C:\Tomcat

 

 

Finally, Go to File menu again and now select Save.

 

 

3.  Next, you need to reboot the computer for these changes to take affect.

 

 


            Step 4:  Install the Java SDK Software

 

 

1.  First, you need to download and install the latest version of the Sun Java SDK (Software Developer’s Kit).  Currently, we recommend version 1.4.  Keep in mind that older versions could cause incompatibilities with newer versions Tomcat when we attempt to bridge them later in this guide.  For a Windows-based machine, download the SDK Windows file in the second column at:

            http://java.sun.com/j2se/1.4/download.html

 

 

 

            Note that if this link is no longer valid, simply go to the Sun website (java.sun.com) and follow the links downloading J2SE.  Then simple follow the instructions in the preceding paragraph when you reach the list of download candidates

 

 

 


2.  The next step is to install the downloaded software.  Find where you downloaded the file to and double click it.  The installation process should begin.  Note, we are not going to be doing a standard installation so follow these instructions carefully.

 

     The following window will open automatically as the installation process begins:

 

 

Click Next

 

 

 

Note:  If the Java software is all ready installed, you may receive a warning message similar to the following:

 

 

Choose OK to uninstall, since you need a clean updated version of JDK, and after the uninstall process is complete, restart the process over from #2 by double clicking the Java install file again.

 

 

 

3.  The first page just asks you to read the license agreement.

When you are done, Click Next

 


4.  The next page asks you to do define a home directory for the Java kit.  We are going to change this value to be c:\JDK.  Simply select Browse and type:

 

                        c:\JDK              (replace c: with the drive of your choice, but remember that later)

 

 

     Afterwards, click Next

 

 

5.  The next page asks about which packages you would like to install.  Leave these settings as they are and simply click Next to continue.

 

 

 

6.  The next page asks which browsers you wood like Java to support.  Since this option really does not affect the server, you can select the browsers you would like to support and then click Next to continue.

 


7.  Finally, the installation process will commence.  You should get the following message the process is complete:

 

 

     The installer will then ask you to restart your computer.  It is recommended that you restart your computer.

 

 

 

Note:  While the files are being installed, you may receive a warning message similar to the following:

 

 

This warning means that there exists some program on your system currently using a file the installer would like to overwrite during installation.

 

We recommend closing all other applications, including disabling any web servers you might all ready be running, and selecting Retry.  If this does not work, then we recommend Rebooting and trying the installation procedure again.  Finally, if all else fails, you can select Ignore in the hopes that the problem is not detrimental.

 

 

 


            Step 5:  Install Apache Tomcat Web Software

 

 

1.  The first step is to download the Apache Jakarta-Tomcat, aka Tomcat, software from the Apache Web Site.  For a Windows-based machine, the direct address to the file libraries for version 4.0.4 is:

            http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.4/bin/

 

            Note that if this link is no longer valid, simply go to the main Jakarta website (jakarta.apache.org) and follow the links for the Tomcat file libraries, directory /bin.

 

             There may be multiple versions of the software, like 1.0.24, 2.0.26, etc.  Download the latest version by selecting the file with the latest version number and an .exe extension at the end.  For example:

            jakarta-tomcat-4.0.4.exe

 

     Note that there is often a LE version.  This is the Light Edition of the software which takes up less space.  In general, you do not want to download this version, so make sure you select the file without an LE in it’s name.

 

 

2.  The next step is to install the downloaded software.  Find where you downloaded the file to and double click it.  The installation process should begin by informing you that it has found your Java software at c:\JDK.

 

 

     If this message does not say this, you may need to reinstall your Java files since its best to keep them in this specific directory for simplicity.  Or, you may have simply forgot to restart the machine after Step 4.

 

     If everything is fine, then select OK and the installation will begin:

 

 

     Click I Agree when you are done reading.

3.  The next page asks about which packages you would like to install.  Leave these settings as they are and simply click Next to continue.

 

 

4.  The next page asks you to do define a home directory for the Tomcat Server.  We are going to change this value to be c:\tomcat.  In the textbox type:

 

                        c:\tomcat          (replace c: with the drive of your choice, but remember that later)

 

 

     Click Install to continue

 

5.  Finally, the files will copy and when they are done the following screen should appear:

 

 

     Select Close to complete the installation procedure.

 

6.  Next, reboot the computer to initialize the Tomcat Web Server

 

 


Now that the Tomcat Software is installed, the next four steps will go over general use and testing to make sure the basic server is functioning properly.

 

 

7.  This step describes how to turn on/off the web server.

 

     To control your server, use the shortcuts Start Tomcat and Stop Tomcat provided by Tomcat under:

Start Menu à Program Files à Apache Tomcat 4.0

 

     A Tomcat command window may open on some systems.  If it does, then you must keep this Window open to keep the server running.  Closing this Window signifies shutting down the server.  Alternatively, you can use the Stop Tomcat command in the Windows Start Menu to shut down your server.

 

 

 

Note:  You may receive the following error message when you attempt to start Tomcat.

 

 

This is occurs because Tomcat cannot find the Java JDK files at the place you told it to.  Please review Step 3 and Step 4 to ensure that the path you provided for the environmental variable Java_Home matches the location of the Java files on your harddrive that you installed during Step 4.

 

 

 

 

8.  Next, we will test the application server connection locally.  First start the server using the instructions from the previous step.  Then go to the web site:

            http://localhost:8080

 

     This is the standard method of accessing the computer’s server locally.  Note that all of Tomcat’s requests are handled through port 8080.  We will modify this to use the default web server, port 80, later on.

 

 

 


     You should see something like this:

 

 

     If you do not see anything this, then it means your server might be installed but not running.  Follow the guidelines for #7 to start you server.

 

 

10.  Assuming you can access the web server locally from the computer you are at, try next to access the web server remotely from another computer.  This type of test can vary depending on whether or not you are running on a local intranet or have internet access.