IDependOn-Set: 1
IDependOn-Set: 13
IDependOn-Set: 132
IDependOn-Set: 137
IDependOn-Set: 139
IDependOn-Set: 2
IDependOn-Set: 24
LastModifiedSecs: 925992273
Parent: 24
SequenceNumber: 5
Title: Setting up JServ on NT4.0 - HOW TO
Part: 0
Author-Set: kss1@stern.nyu.edu
LastModifiedSecs: 925831260
Type: monospaced
Lines: 128
From: Sampath, Krishna <kss1@stern.nyu.edu>
To: Java Apache Users <java-apache-users@list.working-dogs.com>
Date: Tuesday, May 04, 1999 10:18 AM
Subject: Setting up JServ on NT4.0 - HOW TO


i just got JServ to work on NT4.0 (SP4).
took about three long evenings to figure it all out. hope this helps. 

krishna sampath


# Checklist to get JServ working on NT4.0 (SP4), with Apache 1.3.6 and JServ 1.0b3

### the obvious gotchas...
# version of jsdk must be 2.0

# ApacheModuleJServ.dll must be the correct version

# ApacheJServ.jar must not be the zero length file that comes in the 
# distribution

# If you are using servlets downloaded from Sun, make sure that they are 
# not using any 2.1 methods


### here are some other things to watch out for... 


### httpd.conf

# file paths must  contain / (forward slash), not \ (back slash)
        ApJServProperties "E:/Apache Group/Apache JServ/conf/jserv.properties"
        ApJServLogFile "E:/Apache Group/Apache JServ/logs/jserv.log"

# make sure that your DocumentRoot and <Directory ...> directives 
# both point to the same spot
        DocumentRoot "E:/htdocs"
        <Directory "E:/htdocs">

# read the excellent paper by Mazzocchi and Fumagalli 
# "Advanced Apache JServ Techniques", especially the last two pages. 
# check the faq for its location. my own setup closely mimics their example. 
# Here, I am creating a servlet zone called weird, which will be called as:
# "http://my_server/servlets/hello"
        ApJServMount /servlets /weird


### jserv.properties

# file paths must contain \ (back slash), NOT / (forward slash).

# ensure that wrapper.bin points to SUN's java and not Microsoft's
        wrapper.bin=E:\JavaSoft\JRE\1.2\bin\java.exe

# make sure wrapper.path points to the winnt and system directories
        wrapper.path=C:\winnt;C:\winnt\system32

# the only two jar files i have needed so far are these, added by default. 
# check paths.
        wrapper.classpath=E:\Apache Group\Apache JServ\ApacheJServ.jar
        wrapper.classpath=E:\JavaSoft\JRE\1.2\lib\jsdk.jar

# this line is not inserted by default, but seems to be necessary.
        wrapper.env=WINDIR=C:\WINNT

# make sure that the zones directive points to the zone we created 
# in httpd.conf
        zones=weird

# ensure the weird zone settings are ok
        weird.properties=E:\Apache Group\Apache JServ\conf\weird.properties

# make sure that your machine is allowed access to the servlets
        security.allowedAddresses=127.0.0.1

# i have set security.authentication=false for the time being, 
# and all the logs turned on.


### weird.properties

# recall that we are trying to setup a zone called weird. 
# here are the relevant lines from weird.properties, which 
# is basically zone.properties, with these changes.

# this file also uses \ (back slash), not / (forward slash) in the paths

# ensure that the zone directory is defined
        repositories=E:\htdocs\servlets\weird

### other remarks

# IMPORTANT: make sure that the directory \servlets\weird exists 
# under your DocumentRoot. this is where your servlets in the weird zone 
# go into. this is what held me up the longest.

# you must "net stop apache" and "net start apache" each time you change 
# any configuration to ensure that the new config is read

# if you are using servlet examples from Sun, make sure that they do not 
# use jsdk2.1 methods!

# here is the applet that i used to test my JServ setup. 
# the file must be called hello.java (thanks cam!)

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class hello extends HttpServlet {
    public void doGet(HttpServletRequest req, HttpServletResponse res)
        throws ServletException, IOException
    {
        res.setContentType("text/html");
        PrintWriter out = new PrintWriter(res.getOutputStream());
        out.println("<html>");
        out.println("<head>");
        out.println("<title>Hello World Servlet</title>");
        out.println("</head>");
        out.println("<body>");
        out.println("<h1>Hello World Servlet</h1>");
        out.println("<p>Hello, world!</p>");
        out.println("</body>");
        out.println("</html>");
        out.close();
    }
} //end of class
EndPart: 0
