Jakarta Tomcat 4.1.18 & mod_jk.so ÄÄÆÄÀÏ ¸Þ´º¾ó (Ver 1.1)


Official distribution site : http://jkkang.net/
Technical Info : jkkang65@hanmail.net

Last Updated in January 21st, 2003
Written by Kang Jul Ki



  º» ¹®¼­´Â Redhat 7.3°ú Java 1.4.1 ȯ°æ¿¡¼­ Tomcat 4.1.18À» ÄÄÆÄÀÏÀ» Çؼ­ Java Servlet, JSP ÇÁ·Î±×·¡¹ÖÀ» ÇϱâÀ§ÇÑ ¹æ¹ýÀ» ¼³¸íÇÏ´Â ¹®¼­ÀÌ´Ù. º» ¹®¼­´Â ÄÄÆÄÀÏ °úÁ¤À» ´Ù·ç±â ¶§¹®¿¡ »ç¿ëÀÚ°¡ µû¶ó¼­ ÇÏ´Ù°¡ ¹ß»ýÇÏ´Â ¹®Á¦¿¡ ´ëÇؼ­´Â ¾î¶² Ã¥ÀÓµµ ÇÊÀÚ°¡ ÁöÁö ¾Ê´Â´Ù.

S/WVersionºñ°í
Linux7.3
Apache1.3.27
Java1.4.1Linux JVM
GNU gcc2.96or higher
GNU make3.79.1or higher
Jakarta Tomcat4.1.18



1. Apache 1.3.27 ÄÄÆÄÀÏ ¹× ÀνºÅç


  2002³â 12¿ù 24ÀÏ ÇöÀç apache 1.3.27¹öÀüÀÌ 1.3.x ¹öÀü¿¡¼­´Â °¡Àå ÃֽŠ¹öÀüÀÌ´Ù. º» ¹®¼­¿¡¼­´Â Apache 2.x´Â ´Ù·çÁö ¾Ê¾Ò´Ù. ApacheÀÇ ¼³Ä¡ directory´Â /usr/local/apacheÀ» ±ÇÀåÇÑ´Ù. configure¸¦ ½ÇÇàÇÒ ¶§ --prefix=/usr/local/apache°¡ ±âº»À̹ǷΠƯº°È÷ À§ µð·ºÅ丮¿¡ ÀνºÅçÇÏ°íÀÚ ÇÑ´Ù¸é --prefix¸¦ ÁÙ ÇÊ¿ä´Â ¾ø´Ù. configure¸¦ ÇÒ¶§ DSO(Dynamic Shared Object) ¸¦ Áö¿øÇϵµ·Ï ¼³Á¤À» ÇØ¾ß ÇÑ´Ù. ±×¸®°í Apache, TomcatÀº www ¶õ »ç¿ëÀÚ¸¦ ¸¸µé¾î °ü¸®ÇÏ°Ô ÇÏ°í /usr/local/apache ¿¡ ±âº»µð·ºÅ丮¸¦ °®µµ·Ï ÇÏ°Ú´Ù. ÇÊÀÚÀÇ Å×½ºÆ®È¯°æÀ» µû¶ó¼­ ÇÏ´Â°Ç ÀÚÀ¯Áö¸¸, ¾Æ¹«·¡µµ ÇÊÀÚ¿Í °°Àº ȯ°æ¿¡¼­ Çϴ°ÍÀ» ±ÇÇÏ°í ½Í´Ù.


Linux OS ¹öÀü

[www /home/tomcat 1 ] uname -r
2.4.18-3

Apache 1.3.27 ¾ÐÃà Ç®±â

[root@www /]# id
uid=0(root) ..................................................

[root@www /]# cd /usr/local
[root@www /usr/local]# ls -l apache_1.3.27.tar.gz
-rw-r--r-- 1 root root 2306052 Jan 1 16:39 apache_1.3.27.tar.gz

[root@www /usr/local]# gzip -dc apache_1.3.27.tar.gz | tar xvf -
[root@www /usr/local]# ln -s apache_1.3.27 apache
[root@www /usr/local]# cd apache
[root@www /usr/local/apache]#

»õ·Î¿î »ç¿ëÀÚ www¸¦ ¸¸µé°í Ȩµð·ºÅ丮(/usr/local/apache), ±âº»½©(csh)À» ¼³Á¤ÇÑ´Ù. ÇÊÀÚ°¡ ¸¸µç AIX ¸Þ´º¾ó¿¡¼­´Â kshÀ» »ç¿ëÇß¾ú´Âµ¥, Linux¿¡¼­´Â bashÀ» ¾²Áö¾Ê°í ÇÊÀÚÀÇ ÆíÀÇ»ó cshÀ» »ç¿ëÇϵµ·Ï ÇÏ°Ú´Ù. bash »ç¿ëÀڴ ȯ°æº¯¼ö¸¦ bash¿¡ ¸Âµµ·Ï ¹Ù²ãÁÖ¸é µÈ´Ù.

[www /usr/local/apache 5 ] id
uid=501(www) gid=501(www) groups=501(www)

[www /usr/local/apache 6 ] pwd
/usr/local/apache

[www /usr/local/apache 7 ] echo $SHELL
/bin/csh

Makefile »ý¼º ¹× ÄÄÆÄÀÏ, ÀνºÅç

[www /usr/local/apache 9 ] su - root
Password:
[root@www ~]#
[root@www ~]# whoami
root
[root@www ~]# cd ~www
[root@www /usr/local/apache]#
[root@www /usr/local/apache]# ./configure --prefix=/usr/local/apache --enable-module=so
[root@www /usr/local/apache]# make
[root@www /usr/local/apache]# make install
[root@www /usr/local/apache]# cd ..
[root@www /usr/local]# chown -R www.www apache_1.3.27

Apache°¡ Á¦´ë·Î ±ò·È´ÂÁö ½ÇÇà½ÃÄÑ º»´Ù. ApacheÀÇ ½ÇÇàÀº root id·Î Çؾ߸¸ ÇÑ´Ù.

[root@www /usr/local]# cd apache
[root@www /usr/local/apache]# whoami
root

[root@www /usr/local/apache]# ./bin/apachectl start
./bin/apachectl start: httpd started
[root@www /usr/local/apache]# ps -ef|grep httpd
root      7786     1  0 16:51 ?        00:00:00 /usr/local/apache/bin/httpd
nobody    7787  7786  0 16:51 ?        00:00:00 /usr/local/apache/bin/httpd
nobody    7788  7786  0 16:51 ?        00:00:00 /usr/local/apache/bin/httpd
nobody    7789  7786  0 16:51 ?        00:00:00 /usr/local/apache/bin/httpd
nobody    7790  7786  0 16:51 ?        00:00:00 /usr/local/apache/bin/httpd
nobody    7791  7786  0 16:51 ?        00:00:00 /usr/local/apache/bin/httpd


2. www »ç¿ëÀÚÀÇ .cshrc ¼³Á¤ (ȯ°æº¯¼ö)


  ¸¸¾à www »ç¿ëÀÚ°¡ csh À» »ç¿ëÇÑ´Ù¸é ´ÙÀ½°ú °°ÀÌ .csh¿¡ ³Ö¾îÁÖ¸é µÈ´Ù. ÁÖÀÇÇÒÁ¡Àº rootÀÇ .cshrc¿Í wwwÀÇ .cshrc¿¡¼­ ¾Æ·¡¿Í °°Àº ȯ°æº¯¼öµéÀº °°°Ô ÇØÁà¾ß ÇÑ´Ù. ³ªÁß¿¡ ¾Ë°ÔµÇÁö¸¸, root·Î ÄÄÆÄÀÏÀ» ÇÒ ÀϵéÀÌ Àֱ⠶§¹®ÀÌ´Ù. ÇÊÀÚ´Â ÆíÇÏ°Ô ±×³É µÎ°³¸¦ wwwÀÇ .cshrc·Î °°°ÔÇؼ­ »ç¿ëÀ» Çß´Ù.

   a. C Shell (.cshrc) »ç¿ëÀÚ

set path=(/usr/local/bin /usr/bin /etc /usr/sbin /usr/ucb /bin /usr/bin/X11 /sbin
set path=($path /usr/java141/bin)
...
setenv LANG en_US
...
setenv CLASSPATH /usr/java141/lib/tools.jar:/usr/java141/jre/lib:.
setenv JAVA_HOME /usr/java141

   b. Korn Shell (.profile) »ç¿ëÀÚ

PATH=/usr/local/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/bin:/usr/bin/X11:/sbin
PATH=$PATH:/usr/java141/bin
...
export LANG=en_US
...
export CLASSPATH=/usr/java141/lib/tools.jar:/usr/java141/jre/lib:.
export JAVA_HOME=/usr/java141


3. Java 1.4.1 ¼³Ä¡ È®ÀÎ


  ÇÊÀÚ´Â AIX ¸Þ´º¾óÀÇ °æ¿ì¿¡´Â Java 1.3.1·Î ÄÄÆÄÀÏÀ» ÇÏ¿´À¸³ª, Linux Redhat 7.3¿¡¼­´Â Java 1.4.1 À¸·Î ÄÄÆÄÀÏÀ» ÇÏ¿´´Ù. °¡´ÉÇÏ´Ù¸é ÃֽŹöÀüÀ¸·Î ÄÄÆÄÀÏÀ» Çϴ°ÍÀÌ ÁÁ´Ù. Linux¿ë Java´Â http://www.blackdown.org/¿¡¼­ ´Ù¿î¹ÞÀ¸¸é µÈ´Ù.

[www /usr/local/apache 3 ] cd /usr/local/java141
[www /usr/local/java141 4 ] ls -l
total 10416
drwxr-xr-x    2 root     root         4096 Jul 24 10:02 bin/
-rw-r--r--    1 root     root         4431 Jul 24 10:01 COPYRIGHT
drwxr-xr-x    6 root     root         4096 Jul 24 10:01 demo/
drwxr-xr-x    3 root     root         4096 Jul 24 10:01 include/
-rw-r--r--    1 root     root         4370 Jul 24 10:01 INSTALL
drwxr-xr-x    5 root     root         4096 Jul 24 10:00 jre/
drwxr-xr-x    2 root     root         4096 Jul 24 10:01 lib/
-rw-r--r--    1 root     root        10694 Jul 24 10:01 LICENSE
drwxr-xr-x    4 root     root         4096 Jul 24 10:02 man/
-rw-r--r--    1 root     root         9518 Jul 24 10:01 README
-rw-r--r--    1 root     root        16224 Jul 24 10:01 README.html
-rw-r--r--    1 root     root     10567673 Jul 24 10:01 src.zip


4. Jakarta Tomcat °ü·Ã ÆÄÀÏ ´Ù¿î·Îµå


  ´ÙÀ½ ÆÄÀϵéÀº Jakarta TomcatÀ» ÄÄÆÄÀÏÇϱâ À§Çؼ­ ²À ÇÊ¿äÇÑ ÆÄÀϵéÀÌ´Ù. TomcatÀ» Á¦¿ÜÇÑ ´ëºÎºÐÀÇ Java Jar ÆÄÀϵéÀº jar ÇüÅ·Π´Ù¿î·Îµå ¹ÞÀ¸¸é µÈ´Ù. ¿Ö³ÄÇϸé ÀÚ¹Ù´Â ¾î´À OS¿¡¼­µµ ȣȯµÇ´Â Ư¡¶§¹®ÀÌ´Ù.

[www /usr/local/apache/jakarta 25 ] ls -l
drwxr-xr-x    3 www      www          4096 Oct 24 13:49 commons-beanutils-1.5/
drwxr-xr-x    3 www      www          4096 Oct 21 23:36 commons-collections-2.1/
drwxr-xr-x    6 www      www          4096 Dec 15 19:35 commons-daemon/
drwxr-xr-x    2 www      www          4096 Dec 29 02:24 commons-dbcp-1.0/
drwxr-xr-x    3 www      www          4096 Aug 14 01:28 commons-digester-1.3/
drwxr-xr-x    3 www      www          4096 Sep 27 11:21 commons-logging-1.0.2/
drwxr-xr-x    3 www      www          4096 May  1  2002 commons-modeler-1.0/
drwxr-xr-x    3 www      www          4096 Aug 13 10:42 commons-pool-1.0.1/
drwxr-xr-x    4 www      www          4096 Dec 29 01:02 jaf-1_0_2/
drwxr-xr-x    9 www      www          4096 Dec 29 00:28 jakarta-ant-1.5.1/
drwxr-xr-x    6 www      www          4096 Dec 29 15:26 jakarta-regexp-1.2/
drwxr-xr-x    6 www      www          4096 Dec 29 00:41 jakarta-servletapi-4/
drwxr-xr-x    4 www      www          4096 Feb 10  2002 jakarta-struts-1.0.2/
drwxr-xr-x    9 www      www          4096 Dec 31 23:46 jakarta-tomcat-4.1.18-src/
drwxr-xr-x   11 www      www          4096 Dec 29 00:48 jakarta-tomcat-connectors-4.1.18-src/
drwxr-xr-x    4 www      www          4096 Dec 29 01:13 javamail-1_2/
drwxr-xr-x    2 www      www          4096 Dec 29 02:38 jdbc2_0-stdext/
drwxr-xr-x    3 www      www          4096 Dec 29 02:33 jndi-1.2.1/
drwxr-xr-x    3 www      www          4096 Dec 29 15:52 jsse-1.0.2/
drwxr-xr-x    2 www      www          4096 Dec 29 02:44 jta-spec1_0_1/
drwxr-xr-x    2 www      www          4096 Dec 29 16:19 junit3.7/
drwxr-xr-x    6 www      www          4096 Jun 10  2002 mx4j-1.1/
drwxr-xr-x    2 www      www          4096 Dec 29 15:39 tyrex-1.0/
drwxr-xr-x    5 www      www          4096 Dec 29 00:16 xalan-j_2_4_1/
drwxr-xr-x    5 www      www          4096 Dec 29 16:36 xerces-2_1_0/

[www /usr/local/apache/down 27 ] ls -l
-rw-r--r--    1 www      www        222454 Dec 28 18:28 commons-beanutils-1.5.tar.gz
-rw-r--r--    1 www      www        311878 Dec 28 18:28 commons-collections-2.1.tar.gz
-rw-r--r--    1 www      www       3623295 Dec 28 18:30 commons-daemon-20021215.tar.gz
-rw-r--r--    1 www      www        225013 Dec 28 18:30 commons-dbcp-1.0.zip
-rw-r--r--    1 www      www        186272 Dec 28 18:30 commons-digester-1.2.tar.gz
-rw-r--r--    1 www      www        215040 Dec 28 18:30 commons-digester-1.3.tar.gz
-rw-r--r--    1 www      www         70920 Dec 28 18:30 commons-logging-1.0.2.tar.gz
-rw-r--r--    1 www      www         68208 Dec 28 18:30 commons-modeler-1.0.tar.gz
-rw-r--r--    1 www      www         79475 Dec 28 18:30 commons-pool-1.0.1.tar.gz
-rw-r--r--    1 www      www        356277 Dec 28 18:30 jaf-1_0_2.zip
-rw-r--r--    1 www      www       4977991 Dec 28 18:32 jakarta-ant-1.5.1-src.tar.gz
-rw-r--r--    1 www      www        949102 Dec 28 18:32 jakarta-regexp-1.2.tar.gz
-rw-r--r--    1 www      www        128070 Dec 28 18:32 jakarta-servletapi-4-src-20021214.tar.gz
-rw-r--r--    1 www      www       3517875 Dec 28 18:33 jakarta-struts-1.0.2.tar.gz
-rw-r--r--    1 www      www       2127262 Dec 28 18:35 javamail-1_2.zip
-rw-r--r--    1 www      www         32815 Dec 28 18:35 JavaService-bin-1.2.0.zip
-rw-r--r--    1 www      www          6727 Dec 28 18:35 jdbc2_0-stdext.jar
-rw-r--r--    1 www      www        100883 Dec 28 18:35 jndi-1_2_1.zip
-rw-r--r--    1 www      www        779779 Dec 28 18:35 jsse-1_0_3_01-gl.zip
-rw-r--r--    1 www      www          6574 Dec 28 18:36 jta-1_0_1a.zip
-rw-r--r--    1 www      www        374491 Dec 28 18:36 junit3.7.zip
-rw-r--r--    1 www      www        589941 Dec 28 18:36 ldap-1_2_4.zip
-rw-r--r--    1 www      www       1527941 Dec 28 18:36 mx4j-1.1.tar.gz
-rw-r--r--    1 www      www       1724971 Dec 28 18:37 tomcat-4.1.18-src.tar.gz
-rw-r--r--    1 www      www       1806046 Dec 28 18:37 tomcat-connectors-4.1.18-src.tar.gz
-rw-r--r--    1 www      www        240070 Dec 28 18:37 tyrex-1.0.jar
-rw-r--r--    1 www      www       7556669 Dec 28 18:39 xalan-j_2_4_1-bin.tar.gz
-rw-r--r--    1 www      www       3425224 Dec 28 18:40 Xerces-J-bin.2.1.0.tar.gz
-rw-r--r--    1 www      www       3308618 Dec 15 18:35 Xerces-J-bin.2.2.1.tar.gz

5. Jakarta Ant ÄÄÆÄÀÏ ¹× ÀνºÅç


  Ant ´Â UnixÀÇ Make¿Í °°Àº Build Åø·Î¼­ TomcatÀº ÀÌ°ÍÀ» »ç¿ëÇÑ´Ù. Download: http://www.apache.org/dist/ant/source/
¾ÕÀ¸·Î´Â UnixÀÇ Make ´ë½Å OS¿¡ ºñÀÇÁ¸ÀûÀÎ Java·Î °³¹ßµÈ Ant°¡ ¸¹ÀÌ »ç¿ëµÉ°ÍÀ¸·Î ÇÊÀÚ´Â ±â´ëÇÑ´Ù.

[www /usr/local/apache/jakarta 20 ] gzip -dc ../down/jakarta-ant-1.5.1-src.tar.gz | tar xvf -
[www /usr/local/apache/jakarta 21 ] cd jakarta-ant-1.5.1
[www /usr/local/apache/jakarta/jakarta-ant-1.5.1 22 ] ./build.sh -Ddist.dir=/usr/local/apache/jakarta/jakarta-ant-1.5.1 dist
[www /usr/local/apache/jakarta/jakarta-ant-1.5.1 22 ] ./build.sh install

AntÀÇ ÄÄÆÄÀÏÀÌ ¼º°øÀûÀ¸·Î ³¡³­ÈÄ, .cshrc¿¡ PATH, ANT_HOME, CLASSPATH ȯ°æº¯¼ö¸¦ ´ÙÀ½°ú °°ÀÌ °¢°¢ µî·ÏÀ» ÇÑ´Ù.

set path=( $path /usr/sbin /usr/local/java141/bin /usr/local/apache/jakarta/jakarta-ant-1.5.1/bin . )
setenv ANT_HOME /usr/local/apache/jakarta/jakarta-ant-1.5.1
setenv CLASSPATH.:/usr/local/java141/lib/tools.jar:/usr/local/java141/jre/lib/rt.jar:/usr/local/apache/jakarta/jakarta-ant-1.5.1/lib/ant.jar

ÁÖÀÇÇÒÁ¡Àº .cshrc¿¡ ȯ°æº¯¼ö¸¦ »õ·Ó°Ô µî·ÏÀ» ÇÑ´ÙÀ½¿¡´Â ¹Ýµå½Ã Àû¿ëÀ» ½ÃÄÑÁà¾ß¸¸ ÇÑ´Ù. À̸¦ À§Çؼ­´Â logout/loginÀ» ÇÏ´Â ¹æ¹ý°ú command line¿¡¼­ su405:/usr/local/apache>. ./.profileÀ» µ¹¸®´Â ¹æ¹ýÀÌ ÀÖ´Ù. ÇÊÀÚ´Â ÈÄÀÚ¸¦ ¼±È£ÇÏÁö¸¸, ȯ°æº¯¼ö¿¡ ´ëÇÑ ÀÌÇØ°¡ ºÎÁ·ÇÑ »ç¿ëÀÚ¶ó¸é logout/login ÇÏ´Â ¹æ¹ýÀ» ÃßõÇÏ°í ½Í´Ù.
ÇÑ°¡Áö ./build.sh install ÇÒ¶§ chmod ¿¡·¯°¡ ¹ß»ýÇϸé, build.xmlÀÇ ¿¡·¯°¡³ª´Â ÁÙÀ» commentó¸®ÇÏ°í ´Ù½Ã Çغ»´Ù. ±×·³ Àß µÉ°ÍÀÌ´Ù.

[www /usr/local/apache/jakarta/jakarta-ant-1.5.1 32 ] cd bin
[www /usr/local/apache/jakarta/jakarta-ant-1.5.1/bin 33 ] ls -l
-rwxr-xr-x    1 www      www          5077 Jan  1 17:46 ant*
-rw-r--r--    1 www      www          2927 Jan  1 17:46 ant.bat
-rwxr-xr-x    1 www      www           166 Jan  1 17:46 antRun*
-rw-r--r--    1 www      www           686 Jan  1 17:46 antRun.bat
-rwxr-xr-x    1 www      www          1433 Jan  1 17:46 antRun.pl*
-rwxr-xr-x    1 www      www          2488 Jan  1 17:46 complete-ant-cmd.pl*
-rw-r--r--    1 www      www           356 Jan  1 17:46 lcp.bat
-rwxr-xr-x    1 www      www          4544 Jan  1 17:46 runant.pl*
-rwxr-xr-x    1 www      www          2894 Jan  1 17:46 runant.py*

[www /usr/local/apache/jakarta/jakarta-ant-1.5.1/bin 34 ] cd ../lib
[www /usr/local/apache/jakarta/jakarta-ant-1.5.1/lib 35 ] ls -l
-rw-r--r--    1 www      www        720319 Jan  1 18:00 ant.jar
-rw-r--r--    1 www      www        424794 Jan  1 17:46 optional.jar
-rw-r--r--    1 www      www           682 Oct  3 00:07 README
-rw-r--r--    1 www      www        831473 Oct  3 00:07 xercesImpl.jar
-rw-r--r--    1 www      www        108484 Oct  3 00:07 xml-apis.jar

6. Jakarta Servletapi ÄÄÆÄÀÏ ¹× ÀνºÅç


  Download: http://jakarta.apache.org/builds/jakarta-servletapi-4/nightly/src/


[www /usr/local/apache/jakarta 39 ] gzip -dc ../down/jakarta-servletapi-4-src-20021214.tar.gz | tar xvf -
[www /usr/local/apache/jakarta 40 ] cd jakarta-servletapi-4
[www /usr/local/apache/jakarta/jakarta-servletapi-4 41 ] ant -projecthelp
Buildfile: build.xml
Main targets:

  all      Clean, compile, and dist
  clean    Clean previous build results
  compile  Compile API classes (Default)
  dist     Create binary distribution
  
  Default target: compile
  
[www /usr/local/apache/jakarta/jakarta-servletapi-4 42 ] ant all

[www /usr/local/apache/jakarta/jakarta-servletapi-4 57 ] ls -l lib
-rw-r--r--    1 www      www         78861 Jan  1 18:09 servlet.jar

ÀÌ¿Í °°ÀÌ servlet.jar ÆÄÀÏÀÌ ¼º°øÀûÀ¸·Î »ý¼ºÀÌ µÇ¸é, .profileÀÇ CLASSPATH¿¡ ´ÙÀ½°ú °°ÀÌ Ãß°¡¸¦ ÇÑÈÄ Àû¿ë½ÃŲ´Ù.
servlet.jar´Â Servlet Programming¿¡ À־ ¾ÆÁÖ Áß¿äÇÑ È­ÀÏÀ̴ٴ°ÍÀ» ÀØÁö ¸»ÀÚ.
setenv CLASSPATH .:/usr/local/java141/lib/tools.jar:/usr/local/java141/jre/lib/rt.jar:/usr/local/apache/jakarta/jakarta-ant-1.5.1/lib/ant.jar:/usr/local/apache/jakarta/jakarta-servletapi-4/lib/servlet.jar


7. Jakarta Tomcat Connectors ÀνºÅç


  Connectors ÇÁ·Î±×·¥Àº ÀÌ¹Ì ÄÄÆÄÀÏÀÌ µÇ¾î .jar ÆÄÀÏÀÌ ÀÖÀ¸¹Ç·Î ÀνºÅ縸 ÇÏ¸é µÈ´Ù.

[www /usr/local/apache/jakarta 58 ] gzip -dc ../down/jakarta-tomcat-connectors-4.1.18-src.tar.gz | tar xvf -

8. Dependency Library ÀνºÅç


  ÀÌ ÆÄÀϵéÀº build.properties ¿¡ ¸í½ÃµÈ ²À ÇÊ¿äÇÑ ¶óÀ̺귯¸®µéÀÌ´Ù. ¹Ì¸® ÀνºÅçÀ» Çϵµ·Ï ÇÏÀÚ. ÀÌ ÆÄÀϵéÀº ÀÌ¹Ì ÄÄÆÄÀÏÀÌ µÈ .jar ÆÄÀϵéÀÌ Àֱ⠶§¹®¿¡ À¥½ÎÀÌÆ®¿¡¼­ ´Ù¿î·Îµå ¹Þ¾Æ¼­ ¼³Ä¡¸¸ ÇÏ¸é µÈ´Ù.
Tomcat ¸Þ´º¾óÀ» º¸¸é ´ÙÀ½°ú °°ÀÌ ¼³Á¤À» Çسõ°í ÄÄÆÄÀÏÇÒ°ÍÀ» ±ÇÇÑ´Ù.
# ----- Build Control Flags
#Build all components
#full.dist=on
¿¡¼­ full.dist=onÀ¸·Î ³õ°í ÄÄÆÄÀÏÀ» ÇÑ´Ù. ÀÌ·¸°Ô Çؾ߸¸ Tomcat ÀÇ ¸ðµç ±â´ÉÀ» ¸Àº¼¼ö ÀÖ´Ù.

Çʼö [www /usr/local/apache/jakarta 61 ] gzip -dc ../down/commons-collections-2.1.tar.gz| tar xvf -
[www /usr/local/apache/jakarta 62 ] gzip -dc ../down/commons-beanutils-1.5.tar.gz | tar xvf -
[www /usr/local/apache/jakarta 63 ] gzip -dc ../down/commons-digester-1.3.tar.gz| tar xvf -
[www /usr/local/apache/jakarta 64 ] gzip -dc ../down/commons-logging-1.0.2.tar.gz | tar xvf -
[www /usr/local/apache/jakarta 65 ] gzip -dc ../down/jakarta-regexp-1.2.tar.gz | tar xvf -

optional [www /usr/local/apache/jakarta/jdbc2_0-stdext 66 ] cp ../../down/jdbc2_0-stdext.jar .
[www /usr/local/apache/jakarta 67 ] cp -R ../down/jaf-1.0.2 .
[www /usr/local/apache/jakarta 68 ] cp -R ../down/javamail-1.2 .
[www /usr/local/apache/jakarta 69 ] gzip -dc ../down/commons-daemon-20021215.tar.gz | tar xvf -
[www /usr/local/apache/jakarta 70 ] cp -R ../down/commons-dbcp-1.0 .
[www /usr/local/apache/jakarta/jndi-1.2.1/lib 71 ] ls -l
-rw-r--r--    1 www      www        104195 Dec 29 02:36 jaas.jar
-rw-r--r--    1 www      www         98496 Dec 29 02:36 jndi.jar
-rw-r--r--    1 www      www        125243 Dec 29 02:36 ldap.jar

[www /usr/local/apache/jakarta 72 ] gzip -dc ../down/mx4j-1.1.tar.gz | tar xvf -
[www /usr/local/apache/jakarta 73 ] cp -R ../jakarta-success/jta-spec1_0_1 .
[www /usr/local/apache/jakarta 74 ] gzip -dc ../down/commons-modeler-1.0.tar.gz | tar xvf -
[www /usr/local/apache/jakarta 75 ] gzip -dc ../down/commons-pool-1.0.1.tar.gz | tar xvf -
[www /usr/local/apache/jakarta/tyrex-1.0 76 ] ls -l
-rw-r--r--   1 www      www     240070 Dec 24 02:42 tyrex-1.0.jar
[www /usr/local/apache/jakarta 77 ] gzip -dc ../down/jakarta-struts-1.0.2.tar.gz | tar xvf -

9. Jakarta Tomcat ÄÄÆÄÀÏ ¹× ÀνºÅç


  À̹ø Àå¿¡¼­´Â °¡Àå Áß¿äÇÑ Tomcat ÄÄÆÄÀÏ ¹× ÀνºÅçÀ» ÇÏ¿©º¸ÀÚ. Áö±Ý±îÁö ÇØ¿Â °úÀåÀº °á±¹ Tomcat ÄÄÆÄÀÏÀ» À§Çؼ­ ÇÊ¿äÇÑ Áغñ°úÁ¤ ÀÖ¾ú´Ù´Â °ÍÀ» ÀØÁö ¸»ÀÚ.

±× Àü¿¡ ´ÙÀ½°ú °°ÀÌ .cshrc¿¡ ȯ°æº¯¼öÀÇ ¼³Á¤ÀÌ Á¦´ë·Î µÇ¾ú´ÂÁö È®ÀÎÀ» ÇÏ¿©º»´Ù. ±×¸®°í ³ª¼­ ÄÄÆÄÀÏÀ» ÇÑ´Ù.

[www /usr/local/apache 80 ] echo $CLASSPATH
.:/usr/local/java141/lib/tools.jar:/usr/local/java141/jre/lib/rt.jar:/usr/local/apache/jakarta/jakarta-servletapi-4/lib/servlet.jar:/usr/local/apache/jakarta/jakarta-ant-1.5.1/lib/ant.jar

[www /usr/local/apache/jakarta 81 ] gzip -dc ../down/jakarta-tomcat-4.1.18-src.tar.gz | tar xvf -

[www /usr/local/apache/jakarta 82 ] cd jakarta-tomcat-4.1.18-src
[www /usr/local/apache/jakarta/jakarta-tomcat-4.1.18-src 83 ] cp build.properties.sample build.properties

¹Ýµå½Ã build.properties ¸¦ ¼öÁ¤À» ÇÑ´ÙÀ½¿¡ ÄÄÆÄÀÏÀ» Çؾ߸¸ ÇÑ´Ù. ÇÊÀÚ°¡ »ç¿ëÇß´ø build.properties¸¦ ¸µÅ©ÇØ ³õÀ¸´Ï, Âü°íÇϱ⠹ٶõ´Ù.
±×¸®°í, ÄÄÆÄÀÏÀ» ÇϱâÀü¿¡ ¸Þ´º¾óÀ» ²À Àд ½À°üÀ» ±â¸£µµ·Ï ÇÏÀÚ. ¹°·Ð ÇÊÀÚÀÇ ¸Þ´º¾óÀ» º¸´Â ºÐµéÀº ÇÊÀÚÀÇ ÄÄÆÄÀÏ ¸Þ´º¾óÀ» º¸¸é µÇÁö¸¸, ´ÙÀ½¹øÀ» À§Çؼ­ BUILDING.txt, README.txt, RUNNING.txt ÆÄÀÏÀ» ²À Àеµ·Ï ÇÏÀÚ.
ÀÌÁ¦ ÄÄÆÄÀÏÀ» ÇÒ Áغñ°¡ µÇ¾ú´Ù.

[www /usr/local/apache/jakarta/jakarta-tomcat-4.1.18-src 71 ] ant -projecthelp
  Buildfile: build.xml
  Main targets:

  all        Clean, build, and deploy all components
  clean      Clean all components
  deploy     Build and deploy all components
  detect     Display configuration and conditional compilation flags
  dist       Create binary distribution
  installer  Create Windows installer
  release    Create a Tomcat 4 packaged distribution
  test       Unit tests on all components

Default target: deploy
[www /usr/local/apache/jakarta/jakarta-tomcat-4.1.18-src 71 ] ant deploy

10. Jakarta Tomcat ½ÃÀÛ


  Áö±Ý±îÁö ¸¹Àº ÀÛ¾÷À» °ÅÃļ­ ÄÄÆÄÀÏÀ» ¿Ï¼ºÇÏ¿´´Ù. ÀÌÁ¦´Â ½ÇÇàÇغ¸´Â Àϸ¸ ³²¾Ò´Ù.
±× Àü¿¡ export CATALINA_HOME=/usr/local/apache/jakarta/jakarta-tomcat-4.1.18-src/build ȯ°æº¯¼ö¸¦ Ãß°¡ÇÑ´Ù.
±×¸®°í Àû¿ë½ÃÅ°´Â°Í ÀØÁö ¸»ÀÚ.

[www /usr/local/apache/jakarta/jakarta-tomcat-4.1.18-src/build/bin 79 ] ./catalina.sh run
Using CATALINA_BASE:   /usr/local/apache/jakarta/jakarta-tomcat-4.1.18-src/build
Using CATALINA_HOME:   /usr/local/apache/jakarta/jakarta-tomcat-4.1.18-src/build
Using CATALINA_TMPDIR: /usr/local/apache/jakarta/jakarta-tomcat-4.1.18-src/build/temp
Using JAVA_HOME:       /usr/local/java141
Jan 1, 2003 6:17:43 PM org.apache.commons.modeler.Registry loadRegistry
INFO: Loading registry information
Jan 1, 2003 6:17:44 PM org.apache.commons.modeler.Registry getRegistry
INFO: Creating new Registry instance
Jan 1, 2003 6:17:51 PM org.apache.commons.modeler.Registry getServer
INFO: Creating MBeanServer
Jan 1, 2003 6:18:02 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on port 8080
Starting service Tomcat-Standalone
Apache Tomcat/4.1
Jan 1, 2003 6:19:04 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8080
Jan 1, 2003 6:19:05 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Jan 1, 2003 6:19:05 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=27/885  config=/usr/local/apache/jakarta/jakarta-tomcat-4.1.18-src/build/conf/jk2.properties

Tomcat ùȭ¸éÀÌ ¶ß´ÂÁö È®ÀÎÇÒ·Á¸é http://jkkang.net:/8080/ ¸¦ Çغ¸¸é ¾Ë¼ö ÀÖ´Ù.
´ÙÀ½Àº ÇÊÀÚ°¡ ÄÄÆÄÀÏ¿¡ ¼º°øÇؼ­ Á¢¼ÓÇغ» Jakarta Tomcat ù È­¸éÀÌ´Ù.

¼±ÅÃÇϸé Å«È­¸éÀ¸·Î º¼¼ö ÀÖ½À´Ï´Ù.


11. Tomcat ¿¡ °ü¸®ÀÚ¸¦ À§ÇÑ »ç¿ëÀÚ »ý¼ºÇϱâ


TomcatÀº °­·ÂÇÑ Web Admin ToolÀ» Á¦°øÇÑ´Ù. ÀÌ´Â ¼³Á¤º¯°æÀ» À§Çؼ­ ÆÄÀÏÀ» Á÷Á¢ ÆíÁýÇÏ´Â°É ÇÇÇÒ¼ö ÀÖ´Ù. ±âº»ÀûÀ¸·Î °ü¸®ÀÚ¿ë »ç¿ëÀÚ´Â »ý¼ºÀÌ µÇ¾î ÀÖÁö ¾ÊÀ¸¹Ç·Î ´ÙÀ½°ú °°ÀÌ »ç¿ëÀÚ¸¦ Ãß°¡ÇÑ´ÙÀ½ TomcatÀ» Àç½ÇÇàÇÑ´Ù.
[www /usr/local/apache_1.3.27/jakarta/jakarta-tomcat-4.1.18-src/build/conf 30 ] vi tomcat-users.xml
...
<user username="jkkang" password="jkkang123" roles="admin"/>
...

´ÙÀ½Àº Tomcat Web Server Administration Tool¿¡ Á¢¼ÓÇϱâÀ§ÇÑ ·Î±×ÀΠâÀÌ´Ù.

Tomcat Web Server Administration Tool.


´ÙÀ½Àº Tomcat Web Server Administration Tool¿¡ ·Î±×ÀÎÇÑ ÈÄÀÇ ÁÖÈ­¸é ÀÌ´Ù.

Tomcat Web Server Administration Tool.


12. Tomcat Web Application Manager »ç¿ëÇغ¸±â


Jakarta Tomcat¿¡´Â Web Application Manager¶õ À¯¿ëÇÑ ToolÀÌ ÀÖ´Ù. ´ÙÀ½ È­¸é¿¡¼­ ó·³ ¿©·¯°¡Áö ±â´ÉÀ» ÇÒ¼ö°¡ ÀÖ´Ù.


Tomcat Web Application Manager.


13. »õ·Î¿î Context¸¦ Ãß°¡ÇÏ°í ¿¹Á¦ ÇÁ·Î±×·¥µéÀ» ½ÇÇàÇغ¸±â


Jakarta Tomcat¿¡´Â examples µð·ºÅ丮¿¡ ¸¹Àº Java Servlet, JSP °ü·Ã ¿¹Á¦µéÀÌ ÀÖ´Ù. À̹ø¿¡´Â ÇÊÀÚÀÇ À̸§Àº º»µý jkkangÀ̶õ Context¸¦ Ãß°¡ÇÏ°í ¿¹Á¦ÇÁ·Î±×·¥µéÀ» ½ÇÇà½ÃÄѺ¸ÀÚ. ¾Æ·¡ È­¸é¿¡¼­¿Í °°ÀÌexamples µð·ºÅ丮¸¦ Åë°·Î jkkang µð·ºÅ丮¿¡ ±×´ë·Î º¹»ç¸¦ Çؿ´Ù. ±×¸®°í³ª¼­ Tomcat Manager È­¸é¿¡ µé¾î°¡º¸¸é /jkkang µð·ºÅ丮°¡ º¸ÀÏ°ÍÀÌ´Ù. ¹®Á¦´Â ±×³É ½ÇÇàÀ» ÇϰԵǸé Servlet ÇÁ·Î±×·¥Àº º¸¾È»ó ¸·ÇôÀֱ⠶§¹®¿¡ ½ÇÇàÀÌ µÇÁö ¾Ê´Â´Ù. ¹æ¹ýÀº °£´ÜÇÏ´Ù. $CATALINA_HOME/conf/web.xml ÆÄÀÏÀ» vi·Î ¿­¾î¼­ ¾Æ·¡ È­¸é°ú °°ÀÌ Comment 󸮵Ǿî ÀÖ´Â ºÎºÐÀ» Ç®¾îÁÖ°í TomcatÀ» Àç½ÇÇà ÇÑ´ÙÀ½¿¡ ½ÇÇàÀ» Çغ¸¸é µÈ´Ù.

[www /usr/local/apache/jakarta/jakarta-tomcat-4.1.18-src/build/webapps 10 ] mkdir jkkang
[www /usr/local/apache/jakarta/jakarta-tomcat-4.1.18-src/build/webapps 11 ] cd jkkang
[www /usr/local/apache/jakarta/jakarta-tomcat-4.1.18-src/build/webapps 12 ] cp -R ../examples/* .
[www /usr/local/apache_1.3.27/jakarta/jakarta-tomcat-4.1.18-src/build/webapps/jkkang 11 ] ls -l
drwxr-xr-x    2 www      www          4096 Aug  7 11:40 images/
drwxr-xr-x   16 www      www          4096 Aug  7 11:40 jsp/
drwxr-xr-x    2 www      www          4096 Aug  7 11:40 servlets/
drwxr-xr-x    4 www      www          4096 Aug  7 11:40 WEB-INF/

[www /usr/local/apache_1.3.27/jakarta/jakarta-tomcat-4.1.18-src/build/webapps/jkkang 12 ] cd $CATALINA_HOME/conf
[www /usr/local/apache_1.3.27/jakarta/jakarta-tomcat-4.1.18-src/build/conf 13 ] vi web.xml
...
<!--
    <servlet-mapping>
        <servlet-name>invoker</servlet-name>
        <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
-->
...

À§ ºÎºÐÀÇ Ä¿¸ÇÆ®¸¦ Á¦°ÅÇÑ´Ù.


14. mod_jk.so ÄÄÆÄÀÏÇϱâ


À̹øÀå¿¡¼­´Â mod_jk.so¸¦ ÄÄÆÄÀÏ(»ý¼º)ÇÏ¿© Apache¿Í ¿¬µ¿À» ÇÏ¿©º¸ÀÚ.

[www /usr/local/apache 20 ] cd jakarta/jakarta-tomcat-connectors-4.1.18-src/jk/native
[www /usr/local/apache/jakarta/jakarta-tomcat-connectors-4.1.18-src/jk/native 21 ] ./buildconf.sh
[www /usr/local/apache/jakarta/jakarta-tomcat-connectors-4.1.18-src/jk/native 22 ] ./configure --with-apxs=/usr/local/apache/bin/apxs CFLAGS=-O2
[www /usr/local/apache/jakarta/jakarta-tomcat-connectors-4.1.18-src/jk/native 23 ] make
[www /usr/local/apache/jakarta/jakarta-tomcat-connectors-4.1.18-src/jk/native 24 ] make install
[www /usr/local/apache/libexec 2 ] ls -l
-rw-r--r--    1 www      www          7518 Dec 30 17:11 httpd.exp
-rw-r--r--    1 www      www        127076 Jan 21 14:47 mod_jk.a
-rw-r--r--    1 www      www           709 Jan 21 14:47 mod_jk.la
lrwxrwxrwx    1 www      www            15 Jan 21 14:47 mod_jk.so -> mod_jk.so.0.0.0*
lrwxrwxrwx    1 www      www            15 Jan 21 14:47 mod_jk.so.0 -> mod_jk.so.0.0.0*
-rwxr-xr-x    1 www      www        113836 Jan 21 14:47 mod_jk.so.0.0.0*

À§¿Í °°ÀÌ mod_jk.so¸¦ »ý¼ºÇÏ´Â ÀÏÀÌ ³¡³ª°í ³ª¸é, Apache¿Í mod_jk.so¸¦ ¿¬µ¿À» ÇÏ¿©ÁÖ¸é µÈ´Ù. ±× Àü¿¡ ¸î°¡Áö ¸¸µé¾î¾ßÇÒ ÆÄÀϵéÀÌ ÀÖ´Ù. mod_jk.conf, workers.propertiesÀÇ µÎ°³ÀÇ ÆÄÀÏÀÌ´Ù. ÀÌ ÆÄÀϵéÀº ÀÎÅͳݿ¡ ³ª¿ÍÀÖ´Â ¿¹Á¦ÆÄÀÏÀ» ¼öÁ¤Çؼ­ ¸¸µé¸é µÈ´Ù. ÀÌ µÎ°³ÀÇ ÆÄÀÏÀÌ ÇÊ¿äÇϽŠºÐÀº ¸ÞÀÏÀ» º¸³»ÁÖ¸é º¸³»ÁÖµµ·Ï ÇÏ°Ú´Ù.

ApacheÀÇ httpd.confÀÇ ³¡ºÎºÐ¿¡ ´ÙÀ½°ú °°ÀÌ ÇÑÁÙÀ» Ãß°¡ÇØÁØ´Ù. ¹°·Ð ÀÚ½ÅÀÌ ¼³Ä¡ÇÑ Tomcat °æ·Î¿¡ ¸Âµµ·Ï ÇØÁÖ¸é µÈ´Ù.

Include /usr/local/apache/jakarta/jakarta-tomcat-4.1.18-src/build/conf/jk/mod_jk.conf
...


±×¸®°í³ª¼­ mod_jk.confÀ» À§ °æ·Î¿¡ ¸¸µé¾î ÁØ´Ù. ³»¿ëÀº ´ÙÀ½°ú °°ÀÌ Çϵµ·Ï ÇÑ´Ù. Áß¿äÇÑ°ÍÀº JkMount¿¡ ÀÚ½ÅÀÇ Servlet/JSP °æ·Î¸¦ Ãß°¡¸¸ ÇØÁÖ¸é µÈ´Ù. #
# Tomcat 4.1.18 & mod_jk.so
#
JkWorkersFile /usr/local/apache/jakarta/jakarta-tomcat-4.1.18-src/build/conf/jk/workers.properties
JkLogFile /usr/local/apache/logs/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkMount /*.jsp ajp13
JkMount /*/servlet/ ajp13
JkMount /examples/* ajp13


±×¸®°í ¸¶Áö¸·À¸·Î mod_jk.conf°¡ ÀÖ´Â À§Ä¡¿¡ workers.properties¸¦ »ý¼ºÇØÁØ´Ù. ³»¿ëÀº ´ÙÀ½°ú °°ÀÌ ÇϵÇ, ÀÚ½ÅÀÇ °æ·Î¿¡ ¸Âµµ·Ï ¼öÁ¤À» ÇØÁÙ ÇÊ¿ä´Â ÀÖ´Ù.

workers.tomcat_home=/usr/local/apache/jakarta/jakarta-tomcat-4.1.18-src/build
workers.java_home=/usr/java141
ps=/
worker.list=ajp12, ajp13
# Definition for Ajp13 worker
#
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13


±×¸®°í ³ª¼­ Apache¸¦ restart ½ÃÄÑÁØ´Ù.
http://jkkang.net/examples/ ¸¦ ÇßÀ»¶§ È­¸éÀÌ º¸ÀÌ¸é ¼º°øÀÌ´Ù. ÀÌ·¸°Ô ¿¬µ¿ÇØÁÖ±â Àü¿¡´Â http://jkkang.net:8080/examples¸¦ Çß´ø°ÍÀ» ±â¾ïÇϱ⠹ٶõ´Ù. ÀÌÁ¦´Â À¥¼­¹öÀÇ ±â´ÉÀº Apache¿¡ ¸Ã±â°í, TomcatÀº Servlet/JSP ¿£ÁøÀ¸·Î »ç¿ëÀÌ µÇ´Â°ÍÀÌ´Ù.


Áö±Ý±îÁö ÀÛ¼ºÇÑ ¸Þ´º¾óÀÌ 100% ¿ÏÀüÇÑ°Ô ¾Æ´Ï¶ó¼­ ¸î±ºµ¥ ¼öÁ¤ÇÒ°÷ÀÌ ÀÕÁö¸¸, ¿©±â±îÁö¶óµµ ±ÞÇÏ°Ô °ø°³¸¦ ÇÕ´Ï´Ù. °ð ½Ã°£³ª´Â´ë·Î °Ë¼ö¸¦ Çؼ­ ´Ù½Ã ¿Ã¸®µµ·Ï ÇÏ°Ú½À´Ï´Ù.





Copyleft (c) 1996 - 2002, Kang Jul Ki. All rights were not reserved.
Powered by http://jkkang.net since 1996