[root@jmnote ~]# yum list tomcat*
Loaded plugins: fastestmirror
Loading mirr
Installed Packages
tomcat5-jsp-2.0-api.x86_64 5.5.23-0jpp.19.el5_6 installed
tomcat5-servlet-2.4-api.x86_64 5.5.23-0jpp.19.el5_6 installed
Available Packages
tomcat5.x86_64 5.5.23-0jpp.37.el5 Daum
tomcat5-admin-webapps.x86_64 5.5.23-0jpp.37.el5 Daum
tomcat5-common-lib.x86_64 5.5.23-0jpp.37.el5 Daum
tomcat5-jasper.x86_64 5.5.23-0jpp.37.el5 Daum
tomcat5-jasper-javadoc.x86_64 5.5.23-0jpp.37.el5 Daum
tomcat5-jsp-2.0-api.x86_64 5.5.23-0jpp.37.el5 Daum
tomcat5-jsp-2.0-api-javadoc.x86_64 5.5.23-0jpp.37.el5 Daum
tomcat5-server-lib.x86_64 5.5.23-0jpp.37.el5 Daum
tomcat5-servlet-2.4-api.x86_64 5.5.23-0jpp.37.el5 Daum
tomcat5-servlet-2.4-api-javadoc.x86_64 5.5.23-0jpp.37.el5 Daum
tomcat5-webapps.x86_64 5.5.23-0jpp.37.el5 Daum
[root@jmnote ~]# yum install tomcat5
... (생략)
====================================================================================================
Package Arch Version Repository Size
====================================================================================================
Installing:
tomcat5 x86_64 5.5.23-0jpp.37.el5 Daum 394 k
Installing for dependencies:
ant x86_64 1.6.5-2jpp.2 Daum 2.3 M
axis x86_64 1.2.1-2jpp.6 Daum 3.6 M
bcel x86_64 5.1-8jpp.1 Daum 1.1 M
classpathx-jaf x86_64 1.0-9jpp.1 Daum 111 k
classpathx-mail x86_64 1.1.1-4jpp.2 Daum 1.2 M
eclipse-ecj x86_64 1:3.2.1-19.el5.centos Daum 9.0 M
gcc-java x86_64 4.1.2-54.el5 Daum 3.2 M
geronimo-specs x86_64 1.0-0.M2.2jpp.12.el5.centos Daum 259 k
geronimo-specs-compat x86_64 1.0-0.M2.2jpp.12.el5.centos Daum 5.5 k
jakarta-commons-beanutils x86_64 1.7.0-5jpp.1 Daum 567 k
jakarta-commons-collections x86_64 3.2-2jpp.3 Daum 1.2 M
jakarta-commons-daemon x86_64 1:1.0.1-6jpp.1 Daum 46 k
jakarta-commons-dbcp x86_64 1.2.1-7jpp.1 Daum 278 k
jakarta-commons-digester x86_64 1.7-5jpp.1 Daum 349 k
jakarta-commons-discovery x86_64 1:0.3-4jpp.1 Daum 150 k
jakarta-commons-el x86_64 1.0-7jpp.1 Daum 268 k
jakarta-commons-fileupload x86_64 1:1.0-6jpp.1 Daum 53 k
jakarta-commons-httpclient x86_64 1:3.0-7jpp.1 Daum 596 k
jakarta-commons-launcher x86_64 0.9-6jpp.1 Daum 97 k
jakarta-commons-logging x86_64 1.0.4-6jpp.1 Daum 115 k
jakarta-commons-modeler x86_64 1.1-8jpp.3.el5 Daum 260 k
jakarta-commons-pool x86_64 1.3-5jpp.1 Daum 142 k
java-1.4.2-gcj-compat-devel x86_64 1.4.2.0-40jpp.115 Daum 50 k
ldapjdk x86_64 4.18-2jpp.3.el5 Daum 907 k
libgcj-devel x86_64 4.1.2-54.el5 Daum 1.4 M
log4j x86_64 1.2.13-3jpp.2 Daum 728 k
mx4j x86_64 1:3.0.1-6jpp.4 Daum 2.7 M
regexp x86_64 1.4-2jpp.2 Daum 102 k
tomcat5-common-lib x86_64 5.5.23-0jpp.37.el5 Daum 226 k
tomcat5-jasper x86_64 5.5.23-0jpp.37.el5 Daum 1.1 M
tomcat5-server-lib x86_64 5.5.23-0jpp.37.el5 Daum 4.0 M
wsdl4j x86_64 1.5.2-4jpp.1 Daum 429 k
xalan-j2 x86_64 2.7.0-6jpp.1 Daum 4.6 M
xerces-j2 x86_64 2.7.1-7jpp.2.el5_4.2 Daum 3.1 M
xml-commons-resolver x86_64 1.1-1jpp.12 Daum 170 k
Updating for dependencies:
cpp x86_64 4.1.2-54.el5 Daum 2.9 M
gcc x86_64 4.1.2-54.el5 Daum 5.3 M
gcc-c++ x86_64 4.1.2-54.el5 Daum 3.8 M
gcc-gfortran x86_64 4.1.2-54.el5 Daum 3.5 M
libgcc i386 4.1.2-54.el5 Daum 97 k
libgcc x86_64 4.1.2-54.el5 Daum 100 k
libgcj x86_64 4.1.2-54.el5 Daum 18 M
libgfortran x86_64 4.1.2-54.el5 Daum 245 k
libstdc++ i386 4.1.2-54.el5 Daum 363 k
libstdc++ x86_64 4.1.2-54.el5 Daum 354 k
libstdc++-devel x86_64 4.1.2-54.el5 Daum 2.8 M
tomcat5-jsp-2.0-api x86_64 5.5.23-0jpp.37.el5 Daum 105 k
tomcat5-servlet-2.4-api x86_64 5.5.23-0jpp.37.el5 Daum 165 k
Transaction Summary
====================================================================================================
Install 36 Package(s)
Upgrade 13 Package(s)
Total download size: 82 M
Is this ok [y/N]:
Downloading Packages:
(1/49): geronimo-specs-compat-1.0-0.M2.2jpp.12.el5.centos.x86_64.rpm | 5.5 kB 00:00
(2/49): jakarta-commons-daemon-1.0.1-6jpp.1.x86_64.rpm | 46 kB 00:00
... (생략)
libstdc++-devel.x86_64 0:4.1.2-54.el5
tomcat5-jsp-2.0-api.x86_64 0:5.5.23-0jpp.37.el5
tomcat5-servlet-2.4-api.x86_64 0:5.5.23-0jpp.37.el5
Complete!
[root@jmnote ~]# yum install tomcat5-admin-webapps tomcat5-webapps
... (생략)
====================================================================================================
Package Arch Version Repository Size
====================================================================================================
Installing:
tomcat5-admin-webapps x86_64 5.5.23-0jpp.37.el5 Daum 3.4 M
tomcat5-webapps x86_64 5.5.23-0jpp.37.el5 Daum 1.2 M
Installing for dependencies:
jakarta-commons-validator x86_64 1.1.4-5jpp.1 Daum 170 k
jakarta-oro x86_64 2.0.8-3jpp.1 Daum 194 k
jakarta-taglibs-standard x86_64 1.1.1-7jpp.1 Daum 766 k
struts x86_64 1.2.9-4jpp.5 Daum 1.1 M
Transaction Summary
====================================================================================================
Install 6 Package(s)
Upgrade 0 Package(s)
Total download size: 6.9 M
Is this ok [y/N]:
... (생략)
Installed:
tomcat5-admin-webapps.x86_64 0:5.5.23-0jpp.37.el5 tomcat5-webapps.x86_64 0:5.5.23-0jpp.37.el5
Dependency Installed:
jakarta-commons-validator.x86_64 0:1.1.4-5jpp.1 jakarta-oro.x86_64 0:2.0.8-3jpp.1
jakarta-taglibs-standard.x86_64 0:1.1.1-7jpp.1 struts.x86_64 0:1.2.9-4jpp.5
Complete!
[root@jmnote ~]# service tomcat5 status
/etc/init.d/tomcat5 is stopped
[root@jmnote ~]# service tomcat5 start
Starting tomcat5: [ OK ]
[root@jmnote ~]# netstat -anp | grep 8080
tcp 0 0 :::8080 :::* LISTEN 13261/java
[root@jmnote ~]# netstat -anp | grep java
tcp 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN 13261/java
tcp 0 0 :::8009 :::* LISTEN 13261/java
tcp 0 0 :::8080 :::* LISTEN 13261/java
unix 2 [ ] STREAM CONNECTED 3371880 13261/java
그리고 내용을 읽어보면 보여지고 있는 그 페이지가 다음 경로의 파일이라고 한다.
$CATALINA_HOME/webapps/ROOT/index.jsp
또한 톰캣 웹페이지의 최상위 폴더(ROOT)가 /usr/share/tomcat5/webapps/ROOT 임을 알 수 있다.
[root@jmnote ~]# cd /usr/share/tomcat5/webapps/ROOT
[root@jmnote ROOT]# echo hello > hello.txt
[root@jmnote ROOT]# echo "<%=123*3%>" > hello.jsp
재부팅시 톰캣이 자동시작되도록 설정하자.
[root@jmnote ~]# chkconfig --list tomcat5
tomcat5 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@jmnote ~]# chkconfig tomcat5 on
[root@jmnote ~]# chkconfig --list tomcat5
tomcat5