|
1. °³¹ß ȯ°æ
os : aix5.3
java : j2sdk1.4 64ºñÆ®¿ë
web Server : httpd-2.0.55(apache2)
application Server : jakarta-tomcat-4.1.31(tomcat)
connector : jakarta-tomcat-connectors-1.2.14.1-src
2. download
http://apache.org/¿¡¼ apache(Http Server)¿Í Tomcat À» ´Ù¿î·Îµå
apache Http Server´Â httpd-2.0.55.tar.gz ¸¦ ´Ù¿î¹Þ´Â´Ù.
tomcatÀº 4.1.31 tar.gz ¸¦ ´Ù¿î¹Þ´Â´Ù.
tomcat connector´Â tomcat down ¹Þ´Â °÷¿¡ °¡¸é Tomcat Connectors°¡ ÀÖ´Ù. ÀÌ°÷À» Ŭ¸¯ÇÏ°í µé¾î°¡¸é JK 1.2.15 Source Release tar.gz ¸¦ º¼ ¼ö ÀÖ´Ù.Ŭ¸¯ ÇÏ¿© ´Ù¿î¹Þ´Â´Ù.
3. ÄÄÆÄÀÏÇϱâ
tar -xvf httpd-2.0.55.tar
.tar¸¦ Ç®¸é httpd-2.0.55 µð·ºÅ͸®°¡ »ý¼ºµÈ´Ù.
[XXX]cd httpd-2.0.55
[XXX]./configure -prefix=/usr/local/apache2
-enable-rule=SHARED_CORE
-enable-module=so -enable-so
checking.........
checking.........ÇÏ¸é¼ error°¡ ¾øÀ¸¸é ´ÙÀ½À» ½ÇÇàÇÑ´Ù.
make
error°¡ ¾øÀ¸¸é ´ÙÀ½À» ½ÇÇàÇÑ´Ù.
make install
error°¡ ¾øÀ¸¸é Á¤»óÀûÀ¸·Î apache°¡ ¼³Ä¡µÊ.
cd /usr/local/apache2/bin -¾ÆÆÄÄ¡ bin µð·ºÅ͸®·Î À̵¿
./apachectl start -¾ÆÆÄÄ¡ ½ÇÇà
ps -eaf|grep httpd -½ÇÇà ¾ÆÆÄÄ¡ È®ÀÎ
4. ½ÇÇà È®ÀÎ
-apache ºê¶ó¿ìÀú·Î È®ÀÎ
http://localhost:80/
ȸéÀÌ ¶ß¸é Á¤»óÀûÀ¸·Î ½ÇÇàÁß.
-apache Á¤Áö
/usr/local/apache2/bin¿¡¼ ./apachectl stop
5. Tomcat install
5.1 ÆÐÅ°Áö Ç®±â
jakarta-tomcat-4.1.31.tar.gz ÀÌ ÀÖ´Â µð·ºÅ͸® À̵¿ÇÑ´Ù.
gunzip jakarta-tomcat-4.1.31.tar.gz
tar -xvf jakarta-tomcat-4.1.31.tar
......... ....
..... ......................
error ¾øÀÌ Ç®¸®°í ³ª¸é À̸§À» º¯°æÇÑ´Ù.
mv jakarta-tomcat-4.1.31 /usr/local/tomcat
.profile º¯°æ
root¿¡¼ vi .profile ÇÑ ÈÄ ´ÙÀ½À» Ãß°¡
export CATALINA_HOME=/usr/local/tomcat
export TOMCAT_HOME=/usr/local/tomcat
export CLASSPATH=.:$CATALINA_HOME/common/lib/ojdbc14.jar:\
$CATALINA_HOME/common/lib/servlet.jar
:wq ÀúÀåÇÑ ÈÄ ºüÁ® ³ª¿Â´Ù.
5.2 ºê¶ó¿ìÀú¿¡¼ È®ÀÎ
http://localhost:8080/
°í¾çÀÌ ±×¸² ³ª¿À¸é ¼º°øÀÌ´Ù.
6. apache-tomcat ¿¬µ¿
6.1 ¿¬µ¿ ¸ðµâ Ç®±â
jakarta-tomcat-connectors-1.2.14.1-src.tar.gz ÀÌ ÀÖ´Â µð·ºÅ͸®·Î À̵¿ÇÑ´Ù.
gunzip jakarta-tomcat-connectors-1.2.14.1-src.tar.gz
tar jakarta-tomcat-connectors-1.2.14.1-src.tar
cd jakarta-tomcat-connectors-1.2.14.1-src
cd jk/native/
./configure --with-apxs=/usr/local/apache2/bin/apxs
...... ..
...........
error°¡ ¾øÀ¸¸é ´ÙÀ½ ¸í·É¾î ½ÇÇàÇÑ´Ù.
make
...... ...... ....
...... .... ............
error°¡ ¾øÀ¸¸é ¸ðµâÀÌ ½ÇÇàµÈ´Ù. mod_jk.so´Â make½ÇÇàÇÏ°í °¡Àå ¸¶Áö¸· ºÎºÐ¿¡
pwd½ÄÀ¸·Î mod_jk.so°¡ ¸¸µé¾îÁø °æ·Î°¡ ³ª¿Â´Ù. Àß Ã£¾Æ¼ ±× °æ·Î·Î À̵¿ÇÑ´Ù.
¾Æ¸¶µµ cd ../build/jk/apache2
ls Çؼ mod_jk.so °¡ ÀÖ´ÂÁö È®ÀÎÇØ º»´Ù. ÀÖÀ¸¸é
cp mod_jk.so /usr/local/apache2/modules/
mod_jk.so¸¦ /usr/local/apache2/modules/·Î º¹»çÇÑ´Ù.
6.2 httpd.conf ¼³Á¤Çϱâ
LoadModule jk_module modules/mod_jk2.so
JkWorkerFile /usr/local/apache/conf/worker2.properties
JkLogFile /usr/local/jakarta-tomcat-4.1.12/logs/mod_jk.log
JkLogLevel emerg
- %Apche Home%/conf Æú´õ ¾È¿¡ workers2.properties ÆÄÀÏ Ãß°¡ »ý¼º
ÀÌÇÏ sample ---------------------------------------------------
[logger]
level=DEBUG
[config:]
file=${serverRoot}/conf/workers2.properties
debug=0
debugEnv=0
[uriMap:]
info=Maps the requests. Options: debug
debug=0
[shm:]
info=Scoreboard. Required for reconfiguration and status with multiprocess servers
file=${serverRoot}/logs/jk2.shm
size=1048576
debug=0
disabled=00
[workerEnv:]
info=Global server options
timing=1
debug=0
[lb:lb]
info=Default load balancer.
debug=0
[channel.socket:localhost:8009]
info=Ajp13 forwarding over socket
port=8009
host=127.0.0.1
debug=0
tomcatId=localhost:8009
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
[status:]
info=Status worker, displays runtime informations
[vm:]
info=Parameters used to load a JVM in the server process
JVM=${JAVA_HOME}/jre/bin/client/jvm.dll
classpath=${CATALINA_HOME}/bin/tomcat-jni.jar
classpath=${CATALINA_HOME}/server/lib/commons-logging.jar
#OPT=-Djava.class.path=c:\Program Files\Apache Group\Tomcat4.1\bin\tomcat-jni.jar
OPT=-Dtomcat.home=${CATALINA_HOME}
OPT=-Dcatalina.home=${CATALINA_HOME}
OPT=-Xmx128M
#OPT=-Djava.compiler=NONE
disabled=0
# Uri mapping
[uri:localhost/*.jsp]
worker=ajp13:localhost:8009
[uri:www.test.com/*.jsp]
worker=ajp13:localhost:8009
[uri:www.test.com/servlet/*]
worker=ajp13:localhost:8009
[uri:/jkstatus/*]
info=Display status information and checks the config file for changes.
group=status:
[uri:/examples]
info=Example webapp in the default context.
context=/examples
debug=0
[uri:/servlet/*]
info=Servlet mapping
[uri:/*.jsp]
info=Jsp mapping
7. ÅèÄÏ ¼³Á¤
- web.xml ÆÄÀÏ ¼öÁ¤
a. servlet ÁÖ¼®À» Ç®¾îÁØ´Ù.
<servlet>
<servlet-name>invoker</servlet-name>
<servlet-class>
org.apache.catalina.servlets.InvokerServlet
</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
b. servlet-mapping ÁÖ¼®À» Ç®¾îÁØ´Ù.
<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>
c. listings ÀÇ param-value ¸¦ false ·Î ¼öÁ¤
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>
org.apache.catalina.servlets.DefaultServlet
</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
- jk2.properties ÆÄÀÏ ¼öÁ¤
a. handler.list=apr,request,channelJni ¸¦ handler.list=apr,request ·Î ¼öÁ¤
b. shm.file=${jkHome}/work/jk2.shm ÁÖ¼®À» Ç®¾îÁÜ.
c. apr.jniModeSo=inprocess ÀÇ ÁÖ¼®À» Ç®¾îÁÜ.
- server.xml ÆÄÀÏ ¼öÁ¤
a. <Engine name="Catalina" defaultHost="localhost" debug="0"> ÁÖ¼® ó¸® ( Çʼö )
b. <Engine name="Standalone" defaultHost="localhost" debug="0" jvmRoute="jvm1"> ÁÖ¼®À» Ç®¾îÁÜ. ( Çʼö )
c. <Connector port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" /> ÁÖ¼® ó¸® ( Çʼö )
d. webapps ´Â Tomcat ÀÇ Default DocumentRoot ÀÓ.
ÀÌ°ÍÀ» ¼öÁ¤Çϱâ À§Çؼ´Â webapps ¿¡ '/' °æ·Î¸¦ ³ÖÀ» ¼ö ÀÖÀ½.
<Host name="localhost" debug="0" appBase="/"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false"> ¼öÁ¤ ( Çʼö ¾Æ´Ô )
e. path ´Â default ·Î "" ÀÓ.
docBase ´Â default ·Î ROOT ÀÓ.
documentRoot ¸¦ ¹Ù²Ù±â À§ÇØ ¼³Á¤.
<Context path="/" docBase="d:/www" debug="0"/> »ðÀÔ ( Çʼö )
### jsp¼Ò½º°¡ ±×´ë·Î º¸Àδٸé
jk2.properties ¼³Á¤À» ¾Æ·¡¿Í °°ÀÌ ¹Ù²Û´Ù
#handler.list=apr,request
handler.list=request,channelJni
|