CSIS 541 Project: Installation Instructions

Installing MySQL

  1. Go to http://dev.mysql.com/downloads/index.html
  2. Under MySQL database server & standard clients:
       Download MySQL 4.0 (mysql-4.0.18-win.zip)
  3. Unzip mysql-4.0.18-win.zip and run Setup.exe
  4. Install for Typical
  5. Copy C:\mysql\my-small.cnf and rename to C:\my.cnf

Starting MySQL server

  1. At Command Prompt
       C:\mysql\bin>mysqld --console

Stopping MySQL server

  1. At Command Prompt
       C:\mysql\bin>mysqldadmin -u root shutdown

Starting MySQL command line tool

  1. At Command Prompt
       C:\mysql\bin>mysql test
       (where test is the name of the database)

Installing JDBC for MySQL

  1. Go to http://dev.mysql.com/downloads/index.html
  2. Under MySQL Connector/J -- for connecting to MySQL from Java
       Download MySQL Connector/J 3.0 (mysql-connector-java-3.0.11-stable.zip)
  3. Create folder C:\JDBC
  4. Unzip and extract all files to C:\JDBC
  5. Copy
       C:\JDBC\mysql-connector-java-3.0.11-stable\mysql-connector-java-3.0.11-stable-bin.jar
    to
       C:\Sun\jdk\jre\lib\ext\

Testing that all this works

  1. Save these files into your Java work directory;
       TestDB.java   SimpleDataSource.java   database.properties
  2. Compile for TestDB.java
  3. At Command Prompt
       C:\JavaPrograms>java TestDB database.properties
  4. The output should show one line of output "Romeo"

Installing Apache TomCat Server

  1. Go to http://jakarta.apache.org/site/binindex.cgi
  2. Scroll down and under Tomcat 5.0.19, download 5.0.19zip
  3. Unzip into C:\
  4. From Desktop, Right Click on My Computer and select Properties
  5. Click on the Advanced Tab and then click on Environment Variables
  6. If a JAVA_HOME variable does not exist create one with the value set to the Java JDK path (e.g., C:\Sun\AppServer\jdk)

Starting up Tomcat 5

  1. At Command Prompt
       C:\jakarta-tomcat-5.0.19\bin>startup
  2. After startup, the default web applications included with Tomcat 5 will be available by visiting: http://localhost:8080/

Shutting down Tomcat 5

  1. At Command Prompt
       C:\jakarta-tomcat-5.0.19\bin>shutdown

Testing our Java applications on Tomcat

  1. Ensure the web server is shut down
  2. Create folder C:\jakarta-tomcat-5.0.19\webapps\searchengine
  3. Save date.jsp into that directory
  4. Create folder C:\jakarta-tomcat-5.0.19\webapps\searchengine\WEB-INF
  5. Save web.xml into that directory
  6. Create folder C:\jakarta-tomcat-5.0.19\webapps\searchengine\WEB-INF\classes
  7. Start Tomcat
  8. Point your browser to http://localhost:8080/searchengine/date.jsp
  9. The current date and time should be displayed

IMPORTANT NOTE REGARDING PACKAGES

Tomcat 5 does not let you place beans into the default package. Instead, you need to place each bean into a named package. Follow this procedure:

  1. Make a subdirectory WEB-INF/classes/searchengine to hold source and class files.
  2. Place the declaration
    package searchengine;
    as the first line of each source file
  3. Compile the files as follows:
  4. When referencing a bean in a JSP page, use the fully qualified class name, for example
       <jsp:useBean id="zone" class="searchengine.TimeZoneBean" scope="session"/>
  5. To compile servlets, add .../common/lib/servlet.jar to your class path.