   ڹ  JSP ϱ, 2

  Ȳ  donquabi@netian.com
  Id: jserv_jsp.html,v 2.0 2000/10/07
  ______________________________________________________________________

  

  1.   Ͽ
  2.  ȯ
  3. غ 
  4. JDK ġ
     4.1 JDK 1.1.8
     4.2 IBM Java 2 SDK 1.3

  5. JSDK 
  6. ApacheJServ RPM
     6.1 Ű ġ

  7. GNUJSP RPM
  8.  
     8.1 jserv.conf  
     8.2 jserv.properties  
     8.3 wsjzone.properties  

  9.  
     9.1  ⵿
     9.2   
     9.3  
     9.4 JSP 

  10. RedHat Linux 6.2 7.0 
  11. ʷα
  12.  

  ______________________________________________________________________

  1.    Ͽ

     ̹ ,    Ʈ
  ׷̵ Ǿ,  ׵ ִ. ̸  ˸, ̵ ġ
   Բ  Ѵ.

      ,   󿡼 ġ    ڹ
   GNUJSP ϱ ؼ ʿ Ʈ ġϰ 
    Ѵ.

    ٸ  ű 쿡 ݵ ڿ  ֽð, 
   ð  ״θ οϿ մϴ.

     Ȩ   ִ:
  <http://my.netian.com/~donquabi/linux/jserv/jserv_jsp-2.html>

  2.   ȯ

  켱,    ȯ  .

  o  Pentium Pro 200MHz (RAM: 64MB)

  o  Ϳ  6.2 & RedHat Linux 7.0

  o  Ŀ 2.2.17

  o   : apache-1.3.12

  ڴ ¥  6.1 ϴٰ Ϳ  6.2 ġϿ,
  ֱٿ RedHat Linux 7.0 ġϿ  ̴.   ̷  
   ϴ  ̵      
  ־. Ϳ     6.2  ϴ ǰ
  RedHat Linux 7.0 ū    ̴. (Ȥ
  ڿԴ   ׼    ̴.  
  ͵   ڴ ġ ϰڴ.  ġ  
  ߻Ѵٰ ϴ ڸ ſ ⸦ Ѵ.)

  3.  غ 

  켱, ⼭   6.2 ̻, Բ ϴ ġ  
  1.3.9 ̻ ġϿٰ ϰڴ.

  ġ  ڹ  ϱ ؼ   Ʈ
   غϿ Ѵ.

  o  JDK 1.1.8: ibm-jdk-l118-linux-x86.tgz
     <http://www.ibm.com/java/jdk/118/linux/index.html>

  o  IBM Java 2 SDK 1.3: IBMJava2-SDK-13.tgz
     <http://www6.software.ibm.com/dl/dklx130/dklx130-p>

  o  JSDK 2.0: jsdk20-solaris2-sparc.tar.Z
     <http://java.sun.com/products/servlet/download.html>

  o  Apache JServ 1.1.2: ApacheJServ-1.1.2-1.i386.rpm
     <http://java.apache.org/jserv/dist/ApacheJServ-1.1.2-1.i386.rpm>

  o  GNUJSP 1.0.1: gnujsp-1.0.1-1.i386.rpm <gnujsp-1.0.1-1.i386.rpm>

  ڹ  ȯ JDK 1.1.8 Ǵ Java 2 SDK, v1.3 ߿ Ѵ.

  4.  JDK ġ

    ڴ IBM 翡 ϴ  JDK 1.1.8
  ߾.  GNUJSP ġ  JDK 1.1  Ͽ Ͽ
  ϰ ֱ  ̰  ϴٰ Ǵߴ. , 
  ÿ  Java 2 Platform .  7 ʿ IBM Sun
    Java 2 SDK Ҵ. ̹ ֿ Sun Java 2 SDK,
  Standard Edition Version 1.3.0 for Linux (Intel x86)
  <http://java.sun.com/j2se/1.3/download-linux.html> ǥߴ.

  4.1.  JDK 1.1.8

  ġ 丮 /usr/local ϰ,   Ǭ.  ٸ,
   丮 jdk118 丮 .  ȮѴ.

  ġ   δ.

  $ su
  Password:
  # cd /usr/local
  # tar zxvf ibm-jdk-l118-linux-x86.tgz
  # ls
  #

  ׸, ڴ /usr/local/java /usr/local/jdk118 ϰ ǵ
  ũ :ln -s /usr/local/jdk118 /usr/local/java.  ڹ
  丮 ٸ  ġѴٸ ó ũ  ذ  ִ.

  4.2.  IBM Java 2 SDK 1.3

  ġ   δ.

       $ su
       Password:
       # cd /usr/local
       # tar zxvf IBMJava2-SDK-13.tgz
       # ls
       #

     ٸ,   Ǭ ,  丮
  IBMJava2-13 丮 . ʿϸ, ũ : ln -s
  /usr/local/IBMJava2-13 /usr/local/java2

  5.  JSDK 

  ApacheJServ    API 2.0 ԰ݿ  Ǿ.
   ġ ϴ   2.0 ԰ Ѿ ϰ,
   ̸ ϴ JSDK Ͽ ؾ Ѵ.

  JSDK   ϰ, ϴ  ʼ  ̴.
  JSDK      ʴ´.  API ԰
   (Sun) 翡 ϴ ֶ󸮽(Solaris)  
   ϴ.

  , Paul Siegmann Ͽ LGPL   JSDK  
  ִ.  API 2.0 ԰ݴ Ǿ   Ͱ ϰ ȣȯ
  ´. ApacheJServ Ű ̸ Խװ, 켱 ̰ 
   Ͽ.

  6.  ApacheJServ RPM

  ApacheJServ 1.1  ҽ ϰ Բ RPM ȴ. 
   ҽ  Ͽ   , Բ Ǵ 
  Ͽ ࿡ ʿ  ϵ  Ͽ  ϴ
   ʿ ʴ.    INSTALL Ͽ ϰ Ǿ
  , ʺڿԴ  ư,   ŷο  ƴϴ.
  6.1.  Ű ġ

  ġ JDK ġǾ ִٸ,   ApacheJServ Ű ġ
  Ѵ.

       # rpm -i ApacheJServ-1.1.2-1.i386.rpm

  ġ   ٸ,  丮  ǰ,
  /etc/httpd/conf/httpd.conf Ͽ ApacheJServ    ߰
  Ѵ.

  Ű ġ  Ǵ 丮 ߰Ǵ   ǥ
  .

       +-----------------------------+-------------------+------------------+
       |         丮            |               |              |
       +-----------------------------+-------------------+------------------+
       | /etc/httpd/conf/jserv/      | jserv.conf        |                  |
       |                             | jserv.properties  |          |
       |                             | zone.properties   |                  |
       +-----------------------------+-------------------+------------------+
       | /etc/httpd/modules/         | ApacheJServ.jar   |      |
       |                             |                   | Ŭ |
       +-----------------------------+-------------------+------------------+
       | /home/httpd/classes/        | servlet-2.0.jar   | JSDK             |
       +-----------------------------+-------------------+------------------+
       | /home/httpd/servlets/       | Hello.class       |        |
       |                             | IsItWorking.class |                  |
       +-----------------------------+-------------------+------------------+
       | /usr/doc/ApacheJServ-1.1.2/ |                   | ϵ       |
       +-----------------------------+-------------------+------------------+
       | /var/log/httpd/             | jserv.log         |α          |
       +-----------------------------+-------------------+------------------+

  7.  GNUJSP RPM

  GNUJSP   ڹ  (Java Server Pages)  ̴.
  GNUJSP  ġϸ, .jsp Ȯڸ  ڹ ҽ Ϸ
  Ͽ  ϰ, ϰ ȴ. GNUJSP 1.0 JSP 1.0 ԰ 
  Ѵ.

  GNUJSP ڹ ҽ Ŭ  ·,  ȴ. ġ
  Ͽ  ÷,  ,   Ѵ. ġ
   ġϴ  Բ Ǵ INSTALL.apache
  <http://klomp.org/gnujsp/INSTALL.apache> Ѵ.

  GNUJSP, ApacheJServ Ű ,  ġ  Ͽ
  RPM Ű .

    GNUJSP Ű ġѴ.

       # rpm -i gnujsp-1.0.1-1.i386.rpm

  ġ   ٸ, /usr/lib/gnujsp 丮 ϰ, Ŭ
   ȴ. ApacheJServ  Ͽ GNUJSP   
  ߰ϰ, GNUJSP     ߰Ѵ.

  Ű ġ  Ǵ 丮 ߰Ǵ   ǥ
  .

       +------------------------+---------------------+----------------------+------+
       |        丮        |                 |                  |  |
       +------------------------+---------------------+----------------------+------+
       | /etc/httpd/conf/jserv/ | jserv.conf          | ApJServMount,        |  |
       |                        |                     | ApJServAction ߰   |      |
       +------------------------+---------------------+----------------------+------+
       | /etc/httpd/conf/jserv/ | jserv.properties    | classpath ߰       |  |
       |                        |                     |                      |      |
       +------------------------+---------------------+----------------------+------+
       | /etc/httpd/conf/jserv/ | gnujsp.properties   | GNUJSP     |  |
       |                        |                     |              |      |
       +------------------------+---------------------+----------------------+------+
       | /usr/lib/gnujsp/       | gnujsp10.jar        | JSP          |  |
       |                        | sax2.jar            | Ŭ           |      |
       |                        | openxml-1.2-w3c.jar |                      |      |
       |                        | aelfred.jar         |                      |      |
       +------------------------+---------------------+----------------------+------+
       | /usr/doc/gnujsp-1.0.1/ |                     | ϰ JSP |  |
       +------------------------+---------------------+----------------------+------+

  8.   

  ApacheJServ Ϸ    ϵ ʿϴ.

  o  jserv.conf
     <http://my.netian.com/~donquabi/linux/jserv/jserv_conf.txt>

  o  jserv.properties
     <http://my.netian.com/~donquabi/linux/jserv/jserv_properties.txt>

  o   [servlet zone]  
     <http://my.netian.com/~donquabi/linux/jserv/zone.properties.txt>

  o  GNUJSP [servlet zone]  
     <http://my.netian.com/~donquabi/linux/jserv/wsjzone_properties.txt>

  8.1.  jserv.conf  

  jserv.conf   ġ   ApacheJServ  
  ϱ    ߰Ѵ.

  GNUJSP Ű ߰ϴ κ  .

       +----------------------------------------------------------------------------------+
       |  ApJServProperties /etc/httpd/conf/jserv/jserv.properties                        |
       |      :                                                                           |
       |  # Mount point for Servlet zones                                                 |
       |  ApJServMount /wsj /wsjzone                                                      |
       |  ApJServMount /servlets /root                                                    |
       |  ApJServMount /servlet /root                                                     |
       |      :                                                                           |
       |  # Executes a servlet passing filename with proper extension in PATH_TRANSLATED  |
       |  # property of servlet request.                                                  |
       |  ApJServAction .jsp /wsj/gnujsp                                                  |
       |      :                                                                           |
       +----------------------------------------------------------------------------------+

  8.2.  jserv.properties  

  jserv.properties   ApacheJServ     ȯ
   Ѵ.

   ƾ  κ  . JDK 1.1.8 ϴ ̴.

       +------------------------------------------------------------------+
       |  # Execution parameters                                          |
       |  wrapper.bin=/usr/local/java/bin/java                            |
       |      :                                                           |
       |  # CLASSPATH environment value passed to the JVM                 |
       |  wrapper.classpath=/usr/local/java/lib/classes.zip               |
       |  wrapper.classpath=/etc/httpd/modules/ApacheJServ.jar            |
       |  wrapper.classpath=/home/httpd/classes/servlet-2.0.jar           |
       |  wrapper.classpath=/usr/lib/gnujsp/servlet-2.0-plus.jar          |
       |      :                                                           |
       |  # Servlet Zones parameters                                      |
       |  zones=root,wsjzone                                              |
       |  root.properties=/etc/httpd/conf/jserv/zone.properties           |
       |  wsjzone.properties=/etc/httpd/conf/jserv/wsjzone.properties     |
       |      :                                                           |
       +------------------------------------------------------------------+

  , Java 2 SDK 1.3 ϴ 쿡  .

  +------------------------------------------------------------------+
  |  # Execution parameters                                          |
  |  wrapper.bin=/usr/local/java2/bin/java                           |
  |      :                                                           |
  |  # CLASSPATH environment value passed to the JVM                 |
  |  wrapper.classpath=/usr/local/java2/lib/tools.zip                |
  |  wrapper.classpath=/etc/httpd/modules/ApacheJServ.jar            |
  |  wrapper.classpath=/home/httpd/classes/servlet-2.0.jar           |
  |  wrapper.classpath=/usr/lib/gnujsp/servlet-2.0-plus.jar          |
  |      :                                                           |
  |  # Servlet Zones parameters                                      |
  |  zones=root,wsjzone                                              |
  |  root.properties=/etc/httpd/conf/jserv/zone.properties           |
  |  wsjzone.properties=/etc/httpd/conf/jserv/wsjzone.properties     |
  |      :                                                           |
  +------------------------------------------------------------------+

  8.3.  wsjzone.properties  

  wsjzone.properties   JSP   ȯ Ѵ.
  ApacheJServ Բ Ǵ    zone.properties
   .

  ֿ κ  .

  +--------------------------------------------------------------------------------+
  |  # List of Repositories
  | |  #######################
  | |
  | |  # The list of servlet repositories controlled by this servlet
  zone            | |  # Syntax:
  repositories=[repository],[repository]...                           |
  |  # Default: NONE
  | |  # Note: The classes you want to be reloaded upon modification
  should be put   | |  #       here.
  | |  repositories=/usr/lib/gnujsp/gnujsp10.jar
  | |  repositories=/usr/lib/gnujsp/sax2.jar
  | |  repositories=/usr/lib/gnujsp/openxml-1.2-w3c.jar
  | |  repositories=/usr/lib/gnujsp/aelfred.jar
  | |  #repositories=/home/httpd/servlets
  | |        :
  | |
  | |  # Servlet Aliases
  | |  ##################
  | |
  | |  # This defines aliases from which servlets can be invoked.
  | |  # Each alias give a new instance of the servlet. This means that
  if a servlet | |  # is invoked both by class name and by alias name,
  it will result in _TWO_    | |  # instances of the servlet being
  created.                                     | |  # Syntax:
  servlet.[alias].code=[classname] (String)                           |
  |  # Default: NONE
  | |  # servlet.snoop.code=SnoopServlet
  | |  # servlet.hello.code=org.fool.Dummy
  | |  servlet.gnujsp.code=org.gjt.jsp.JspServlet
  | |        :
  | |
  | |  # Aliased Servlet Init Parameters
  | |  ##################################
  | |
  | |  # These properties define init parameters for each servlet that
  is invoked    | |  # by its alias.
  | |  # Syntax:
  servlet.[alias].initArgs=[name]=[value],[name]=[value],...          |
  |  # Default: NONE
  | |  # servlet.snoop.initArgs=message=I'm a snoop servlet
  | |  # servlet.hello.initArgs=message=I say hello world to everyone
  | |
  | |  # give me debug output in the logs (time and space consuming)
  | |  servlet.gnujsp.initArgs=debug=true
  | |  # I want detailed path output in the logs (lot of stuff)
  | |  # servlet.gnujsp.initArgs=pathdebug=true
  | |  # where to put created java source and class files (www server
  needs write access!)  |
  servlet.gnujsp.initArgs=scratchdir=/var/tmp/gnujsp
  | |  # created java classes use packages instead of long file names
  | |  servlet.gnujsp.initArgs=usepackages=true
  | |  # remove comment if you want german messages :-)
  | |  # servlet.gnujsp.initArgs=language=de,country=de
  | |  # checkclass: is set to true: check for changes to jsp pages and
  recompile    | |  # checkdependancies: keep track of included files
  and check for changes       | |
  servlet.gnujsp.initArgs=checkdependancies=true,checkclass=true
  | |  # Do not remove java source files after compilation. (helpful for
  debugging)  | |  servlet.gnujsp.initArgs=keepJava=true
  | |  # which sax parser to use for xml files (experimental!)
  | |  # servlet.gnujsp.initArgs=xmlparser=com.microstar.xml.SAXDriver
  | |  # builtin-java: use the java compiler classes from JDK
  | |  servlet.gnujsp.initArgs=compiler=builtin-javac -classpath
  %classpath%:%scratch| |dir%:/usr/lib/gnujsp/gnujsp10.jar -d
  %scratchdir% -deprecation %source%         |
  +--------------------------------------------------------------------------------+

  9.   

  ApacheJServ Ű ġ    httpd.conf  ߰ϱ
      쿡  ⵿Ͽ Ѵ.

  9.1.   ⵿

  ,   ⵿ؾ Ѵ. ,     ̶
  ⵿ ؾ Ѵ.

       # /etc/rc.d/init.d/httpd stop
       # /etc/rc.d/init.d/httpd start

  9.2.    

  ġ  error_log     κ 鿩 : tail
  /var/log/httpd/error_log.  ڰ RedHat Linux 7.0 error_log
     ,  ߿ ApacheJServ/1.1.2 ִٸ, ġ
           ִ.

  +------------------------------------------------------------------+
  |  ......                                                          |
  |  ... [notice] Apache/1.3.12 (Unix) (Red Hat/Linux) mod_ssl/2.6.6 |
  |OpenSSL/0.9.5a mod_perl/1.24 PHP/4.0.2 ApacheJServ/1.1.2 configure|
  |d -- resuming normal operations                                   |
  +------------------------------------------------------------------+

  9.3.   

  ApacheJServ Ű ġϸ, /home/httpd/servlets 丮 Hello,
  IsItWorking  ϵ ȴ.    ̵ ߿
  IsItWorking   .

  IsItWorking  ϱ  URL  .

  http://localhost/servlet/IsItWorking

  [[IsItWorking   :   ȭ
  <http://my.netian.com/~donquabi/linux/jserv/working.jpg>]]

  9.4.  JSP 

    ̸ JSP  Ѵ.   ִٸ, JSP
  Ͽ ؼ    ۿ .

  GNUJSP Ű ġϸ, JSP  Բ ġȴ. ġ
  /usr/share/doc/gnujsp-1.0.1/examples ̴.   hello.jsp (ġ
  ȿ /home/httpd/html 丮 ȴ) /home/httpd/html
  丮 ϰ,     .

  hello.jsp Ͽ ϱ  URL  .

  http://localhost/hello.jsp

  [[hello.jsp   ȭ
  <http://my.netian.com/~donquabi/linux/jserv/hellojsp-2.jpg>]]

  10.  RedHat Linux 6.2 7.0 

      6.2 /home/httpd/html 𷺰, RedHat
  7.0 /var/www/html 丮 ġѴ.   
  ApacheJServ RPM  GNUJSP RPM   6.2 Ͽ
  ۵Ǿ.  hello.jsp  /home/httpd/html 丮
  ȴ.

  RedHat 7.0  ϴ 쿡 /home/httpd/html 丮 
  hello.jsp  /var/www/html 丮  Ͽ Ѵ.

  11.  ʷα

  ݱ  ٸ  ٸ,  Ͽ 
     ̴.  JSP  ۵ ̴. 
    ʴ°?

  ApacheJServ 1.1 GNUJSP 1.0 ʱ  ԰ݰ JSP ԰ 
   ۵ư, ӵ      ԰ 2.0 JSP
  ԰ 1.0 Ѵ. ֱٿ ̵ ԰  ׷̵ Ǿ. 
  ԰  2.2  ȮǾ, 2.3  غǾ  
  ߿ ִ.  ׸, JSP ԰ 1.1  ȮǾ, 1.2 
    ߿ ִ.

  , GNUJSP üϴ, ο  JSP ϴ Ʈ ġ
  (Apache Software Foundation) ֵ  ߿ ִµ Tomcat
  <http://jakarta.apache.org/tomcat> װ̴. Tomcat  
  2.2 JSP 1.1  ϴ   (reference
  implementation)̴.    3.1μ Ȩ ̳ʸ
   Ӹ ƴ϶ ҽ     ִ.

  12.   

  o   ڹ  JSP ϱ
     <http://my.netian.com/~donquabi/linux/jserv/jserv_jsp.html>

  o  The Apache JServ Project <http://java.apache.org/>

  o  GNUJSP <http://klomp.org/gnujsp/>

  o  Java Server Pages <http://java.sun.com/products/servlet/>

  o  Java Servlet API <http://java.sun.com/products/servlet/>

  o  Alternative Servlet implementation
     <http://www.euronet.nl/~pauls/java/servlet/>

  o  Servlet Central: Using Apache JServ 1.0b1
     <http://www.servletcentral.com/1999-01/jserv.html>

  o  Servlet FAQ <http://www.purpletech.com/servlet-faq/>

  o  Java 1.1.8 IBM Developer Kit for Linux
     <http://www.ibm.com/java/jdk/118/linux/index.html>

  o  IBM Developer Kit for Linux, Java 2 Technology Edition
     <http://www.ibm.com/java/jdk/linux130/>

  o  Java 2 SDK, Standard Edition Version 1.3.0 for Linux (Intel x86)
     <http://java.sun.com/j2se/1.3/download-linux.html>

  o  Tomcat @ Jakarta <http://jakarta.apache.org/tomcat/>

  o  Which JSP book serves up the best lesson?
     <http://www.javaworld.com/javaworld/jw-09-2000/jw-0929-jspbooks.html/>

  o  Java servlet books: A comparative review
     <http://www.javaworld.com/javaworld/jw-03-2000/jw-03-ssj-
     books.html>

     ߸ κ  ְų  ֽø ϰڽϴ.

  1999-2000 Ȳ  sj@kldp.org donquabi@netian.com

