1.ȯ°æ
rh 9.x
apache_1.3.34
tomcat 5.0.28
connector(mod_jk) - 1.2.15 jakarta-tomcat-connectors-1.2.15-src.tar.gz
jdk 1.4.x
2. apache ¼³Ä¡
- ¾ÐÃàÇØÁ¦ tar xvzf apache_1.3.34.tar.gz
- ¼³Ä¡
./configure --prefix=/usr/local/apache --enable-shared=proxy --bindir=/usr/bin
--sbindir=/usr/sbin --libexecdir=/usr/local/apache/lib --logfiledir=/var/log/httpd
--sysconfdir=/etc/httpd/conf --enable-module=so --enable-module=status
--enable- module=info
make; make install;
3. jdk ¼³Ä¡ (binary)
/usr/j2sdk-1_4_2_06-linux-i586.bin ÇÏ¸é ¾ÐÃàÀÌ ÁÖ·ç·ç Ç®¸®¸é¼
j2sdk1.4.2_06 µð·ºÅ丮 »ý±è
¼ÒÇÁÆ® ¸µÅ© °É¾îÁÜ ln -s j2sdk1.4.2_06/ java
4. tomcat(binary) ¼³Ä¡
- group ¹× user »ý¼º
groupadd tomcat ; useradd -g tomcat tomcat
- tomcat ¾ÐÃà±×³É Ç®¾îÁÖ¸éµÊ
- ±×¸®°í tomcat·Î ¼ÒÇÁÆ® ¸µÅ©
- /usr/local/tomcat
- user tomcat ÀÇ .bash_profile¼öÁ¤ /home/tomcat/.bash_profile
export JAVA_HOME=/usr/java
export CATALINA_HOME=/usr/local/tomcat
export TOMCAT_HOME=/usr/local/tomcat
5. ¾ÆÆÄÄ¡, tomcat Å×½ºÆ®
¾ÆÆÄÄ¡ ½ÇÇàÈÄ
http://url - ¾ÆÆÄÄ¡ Å×½ºÆ®ÆäÀÌÁö ³ª¿À¸é Á¤»ó
ÅèĹ ½ÇÇàÈÄ
http://url:8080 - ÅèĹ Å×½ºÆ® ÆäÀÌÁö(¸ø»ý±ä °í¾çÀÌ) ³ª¿À¸é Á¤»ó
6. ¾ÆÆÄÄ¡ ÅèĹ ¿¬µ¿À§ÇÑ mod_jk ¼³Ä¡
- ¾ÐÃàÇ° tar xvzf jakarta-tomcat-connectors-1.2.15-src.tar.gz
- jakarta-tomcat-connectors-1.2.15-src/jk/native À§Ä¡·Î À̵¿
- ./configure --with-apxs=/usr/sbin/apxs
=/usr/sbin/apxs ÀÌ °æ·Î´Â apache¼³Ä¡ÇÒ¶§ --sbindir ¿©±â¿¡ ÁöÁ¤µÈ À§Ä¡
- make
- jakarta-tomcat-connectors-1.2.15-src/jk/native/apache1.3 À¸·Î À̵¿
- mod_jk.so ÆÄÀÏ È®ÀÎ
- cp mod_jk.so /usr/local/apache/lib/
/usr/local/apache/lib/ À§Ä¡´Â apache¼³Ä¡ÇÒ¶§ --libexecdir ¿¡ ÁöÁ¤µÈ À§Ä¡
7. httpd.conf ¼öÁ¤ ¹× work.propeties »ý¼º
httpd.confÆÄÀÏ¿¡ ´ÙÀ½°ú °°ÀÌ Ãß°¡
JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile /var/log/httpd/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# Send JSPs for context /jsp-examples to worker named default
JkMount /*.jsp default
Alias "/" "/usr/local/tomcat/webapps/ROOT/"
JkMount /jsp-examples/*.jsp default
Alias /jsp-examples "/usr/local/tomcat/webapps/jsp-examples/"
JkMount /servlets-examples/* default
Alias /servlets-examples "/usr/local/tomcat/webapps/servlets-examples/"
<Directory "/usr/local/tomcat/webapps/ROOT/">
Options FollowSymLinks
AllowOverride None
Allow from all
</Directory>
<Directory "/jsp-examples">
Options FollowSymLinks
AllowOverride None
Allow from all
</Directory>
DirectoryIndex Áö½ÃÀÚ¿¡ index.jsp Ãß°¡
DocumentRoot /home/httpd/html - ¾ÆÆÄÄ¡ À¥ÆäÀÌÁö ·çÆ®µð·ºÅ丮
- work.propeties ³»¿ë
workers.tomcat_home=/usr/local/tomcat
workers.java_home=/usr/java
ps=/
worker.list=default
worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1
8. ¾ÆÆÄÄ¡ ÅèĹ ¿¬µ¿Å×½ºÆ®
http://url Çؼ ÅèĹ±âº»ÆäÀÌÁö(¸ø»ý±ä°í¾çÀÌ) ³ª¿À¸é ¼º°ø
9. 1~8±îÁö ÀÛ¾÷ÀÌ ¼º°øÀûÀ¸·Î ³¡³ª¸é ÇÑ°¡Áö Àǹ®Á¡
¾ÆÆÄÄ¡¿Í ÅèĹÀÇ ¿¬µ¿ °¡Àå Å«(?) ¸ñÀûÀº static page(htmlµî) ´Â apache¿¡¼Ã³¸®ÇÏ°í
dynamic page(jspµî) ´Â ÅèĹ¿¡¼ ó¸®Çϴµ¥ ÀÖ´Ù ±×·±µ¥ 1~8¹ø±îÁöÀÇ °úÁ¤À» °ÅÄ¡¸é
¸ðµç ¼Ò½º (static, dynamic) ´Â ÅèĹÀÇ ¼Ò½º ±âº»À§Ä¡ÀÎ
/usr/local/tomcat/webapps/ROOT ¿¡ ³õ¿©¾ßÇÑ´Ù
¸¸ÀÏ apacheÀÇ DocumentRoot ¿¡ /home/httpd/html À̶ó°íÇÏ°í
ÀÌ À§Ä¡¿¡ test.htmlÆäÀÌÁö¸¦ ³Ö°í
http://url/test.html À» Çغ¸¸é 404error Áï file not found error°¡ ³ª¿Ã°ÍÀÌ°í
¾ÆÆÄÄ¡ÀÇ error_log¸¦ º¸¸é
/usr/local/tomcat/webapps/ROOT/test.html À» ã´Â°ÍÀ» È®ÀÎÇÒ¼ö ÀÖ´Ù.
ÀÌ ¹®Á¦¸¦ ÇØ°áÇϱâ À§ÇØ apache ÀÇ viturlhost ±â´ÉÀ» ÀÌ¿ëÇÑ´Ù
httpd.conf¿¡ ´ÙÀ½°ú °°ÀÌ Ãß°¡
<VirtualHost *:80>
ServerName aaa.co.kr
DocumentRoot /home/httpd/html
# Use SetEnvIf to st no-jk when /home/ is encountered
SetEnvIf Request_URI "/*" no-jk
Alias / /home/httpd/html/
<Directory "/home/httpd/html">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
ÀÌ·¸°Ô ÇÏ°í ¾ÆÆÄÄ¡ Àç½ÃÀÛ
http://url/test.html Çϸé apacheÀÇ DocumentRoot ¿¡ À§Ä¡ÇÑ
/home/httpd/html/test.html À» º¸¿©ÁÖ°í
http://url/index.jspÇϸé ÅèĹÀÇ DocumentRoot,¿¡ À§Ä¡ÇÑ
/usr/local/tomcat/webapps/ROOT/index.jsp ¸¦ º¸¿©ÁÜÀ» È®ÀÎÇÒ¼ö ÀÖ´Ù
--³¡