JSP(Java Server Pages)是由Sun Microsystems公司倡导、许多公司一起参与建立的一种基于Java技术的动态网页技术标准。
Apache只是一个Web服务器,不能运行JSP程序。如果要运行JSP程序,还需要安装Tomcat服务器软件,通过整合Tomcat与Apache来运行JSP程序
Tomcat是由Apache-Jakarta子项目支持的开放源代码服务器软件,它得到Sun公司的全力支持,而且Tomcat的运行效率非常高,所以它得到了广泛的应用。
必须TOMCAT配合APACHE才能支持JSP,下面我们来安装tomcat
[root@masterdns ~]# yum install tomcat*
Loading "security" plugin Loading "rhnplugin" plugin Loading "installonlyn" plugin This system is not registered with RHN. RHN support will be disabled. Setting up Install Process Setting up repositories Reading repository metadata in from local files Parsing package install arguments Resolving Dependencies --> Populating transaction set with selected packages. Please wait. ---> Downloading header for tomcat5-webapps to pack into transaction set. tomcat5-webapps-5.5.23-0j 100% |=========================| 114 kB 00:00 ---> Package tomcat5-webapps.i386 0:5.5.23-0jpp.3.0.2.el5 set to be updated ---> Downloading header for tomcat5-common-lib to pack into transaction set. tomcat5-common-lib-5.5.23 100% |=========================| 18 kB 00:00 ---> Package tomcat5-common-lib.i386 0:5.5.23-0jpp.3.0.2.el5 set to be updated ---> Downloading header for tomcat5-jasper-javadoc to pack into transaction set. tomcat5-jasper-javadoc-5. 100% |=========================| 35 kB 00:00 ---> Package tomcat5-jasper-javadoc.i386 0:5.5.23-0jpp.3.0.2.el5 set to be updated ---> Downloading header for tomcat5-jasper to pack into transaction set. tomcat5-jasper-5.5.23-0jp 100% |=========================| 16 kB 00:00 ---> Package tomcat5-jasper.i386 0:5.5.23-0jpp.3.0.2.el5 set to be updated ---> Downloading header for tomcat5-jsp-2.0-api-javadoc to pack into transaction set. tomcat5-jsp-2.0-api-javad 100% |=========================| 28 kB 00:00 ---> Package tomcat5-jsp-2.0-api-javadoc.i386 0:5.5.23-0jpp.3.0.2.el5 set to be updated ---> Downloading header for tomcat5-jsp-2.0-api to pack into transaction set. tomcat5-jsp-2.0-api-5.5.2 100% |=========================| 15 kB 00:00 ---> Package tomcat5-jsp-2.0-api.i386 0:5.5.23-0jpp.3.0.2.el5 set to be updated ---> Downloading header for tomcat5-server-lib to pack into transaction set. tomcat5-server-lib-5.5.23 100% |=========================| 27 kB 00:00 ---> Package tomcat5-server-lib.i386 0:5.5.23-0jpp.3.0.2.el5 set to be updated ---> Downloading header for tomcat5-servlet-2.4-api to pack into transaction set. tomcat5-servlet-2.4-api-5 100% |=========================| 16 kB 00:00 ---> Package tomcat5-servlet-2.4-api.i386 0:5.5.23-0jpp.3.0.2.el5 set to be updated ---> Downloading header for tomcat5 to pack into transaction set. tomcat5-5.5.23-0jpp.3.0.2 100% |=========================| 26 kB 00:00 ---> Package tomcat5.i386 0:5.5.23-0jpp.3.0.2.el5 set to be updated ---> Downloading header for tomcat5-servlet-2.4-api-javadoc to pack into transaction set. tomcat5-servlet-2.4-api-j 100% |=========================| 27 kB 00:00 ---> Package tomcat5-servlet-2.4-api-javadoc.i386 0:5.5.23-0jpp.3.0.2.el5 set to be updated ---> Downloading header for tomcat5-admin-webapps to pack into transaction set. tomcat5-admin-webapps-5.5 100% |=========================| 29 kB 00:00 ---> Package tomcat5-admin-webapps.i386 0:5.5.23-0jpp.3.0.2.el5 set to be updated --> Running transaction check --> Processing Dependency: jakarta-commons-daemon >= 1.0.1 for package: tomcat5 --> Processing Dependency: mx4j >= 0:3.0.1 for package: tomcat5-common-lib --> Processing Dependency: mx4j >= 0:3.0.1 for package: tomcat5-server-lib --> Processing Dependency: jndi-ldap for package: tomcat5 --> Processing Dependency: jakarta-commons-beanutils >= 0:1.7.0 for package: tomcat5-server-lib --> Processing Dependency: jakarta-commons-el >= 0:1.0 for package: tomcat5-common-lib --> Processing Dependency: jakarta-commons-fileupload >= 0:1.0-1jpp for package: tomcat5-server-lib --> Processing Dependency: jakarta-commons-modeler >= 1.1-8jpp.1.0.1 for package: tomcat5-server-lib --> Processing Dependency: jakarta-commons-launcher >= 0:0.9 for package: tomcat5 --> Processing Dependency: jakarta-commons-pool >= 0:1.2 for package: tomcat5-common-lib --> Processing Dependency: javamail >= 0:1.3.1 for package: tomcat5-common-lib --> Processing Dependency: regexp >= 0:1.3 for package: tomcat5-server-lib --> Processing Dependency: eclipse-ecj >= 0:3.1.1 for package: tomcat5-common-lib --> Processing Dependency: xml-commons-apis >= 1.3 for package: tomcat5 --> Processing Dependency: jta >= 0:1.0.1 for package: tomcat5-common-lib --> Processing Dependency: struts >= 0:1.1 for package: tomcat5-admin-webapps --> Processing Dependency: ant >= 0:1.6 for package: tomcat5-common-lib --> Processing Dependency: jakarta-commons-logging >= 0:1.0.4 for package: tomcat5-common-lib --> Processing Dependency: jakarta-commons-dbcp >= 0:1.2.1 for package: tomcat5-common-lib --> Processing Dependency: jakarta-commons-collections >= 0:3.1 for package: tomcat5-common-lib --> Processing Dependency: jaf >= 0:1.0.1 for package: tomcat5-common-lib --> Processing Dependency: jakarta-commons-logging >= 0:1.0.4 for package: tomcat5-server-lib --> Processing Dependency: jakarta-commons-digester >= 0:1.6 for package: tomcat5-server-lib --> Processing Dependency: jakarta-taglibs-standard >= 0:1.1.0 for package: tomcat5-webapps --> Processing Dependency: xerces-j2 >= 0:2.7.1 for package: tomcat5 --> Processing Dependency: jakarta-commons-el >= 0:1.0 for package: tomcat5-server-lib --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages. Please wait. ---> Downloading header for jakarta-commons-pool to pack into transaction set. jakarta-commons-pool-1.3- 100% |=========================| 6.1 kB 00:00 ---> Package jakarta-commons-pool.i386 0:1.3-5jpp.1 set to be updated ---> Downloading header for ant to pack into transaction set. ant-1.6.5-2jpp.2.i386.rpm 100% |=========================| 22 kB 00:00 ---> Package ant.i386 0:1.6.5-2jpp.2 set to be updated ---> Downloading header for jakarta-commons-beanutils to pack into transaction set. jakarta-commons-beanutils 100% |=========================| 8.4 kB 00:00 ---> Package jakarta-commons-beanutils.i386 0:1.7.0-5jpp.1 set to be updated ---> Downloading header for jakarta-commons-modeler to pack into transaction set. jakarta-commons-modeler-1 100% |=========================| 6.4 kB 00:00 ---> Package jakarta-commons-modeler.i386 0:1.1-8jpp.3.el5 set to be updated ---> Downloading header for mx4j to pack into transaction set. mx4j-3.0.1-6jpp.4.i386.rp 100% |=========================| 12 kB 00:00 ---> Package mx4j.i386 1:3.0.1-6jpp.4 set to be updated ---> Downloading header for jakarta-commons-dbcp to pack into transaction set. jakarta-commons-dbcp-1.2. 100% |=========================| 7.1 kB 00:00 ---> Package jakarta-commons-dbcp.i386 0:1.2.1-7jpp.1 set to be updated ---> Downloading header for struts to pack into transaction set. struts-1.2.9-4jpp.5.i386. 100% |=========================| 9.3 kB 00:00 ---> Package struts.i386 0:1.2.9-4jpp.5 set to be updated ---> Downloading header for jakarta-commons-collections to pack into transaction set. jakarta-commons-collectio 100% |=========================| 9.6 kB 00:00 ---> Package jakarta-commons-collections.i386 0:3.1-6jpp.1 set to be updated ---> Downloading header for jakarta-commons-launcher to pack into transaction set. jakarta-commons-launcher- 100% |=========================| 5.7 kB 00:00 ---> Package jakarta-commons-launcher.i386 0:0.9-6jpp.1 set to be updated ---> Downloading header for geronimo-specs-compat to pack into transaction set. geronimo-specs-compat-1.0 100% |=========================| 4.8 kB 00:00 ---> Package geronimo-specs-compat.i386 0:1.0-0.M2.2jpp.12 set to be updated ---> Downloading header for xerces-j2 to pack into transaction set. xerces-j2-2.7.1-7jpp.2.i3 100% |=========================| 13 kB 00:00 ---> Package xerces-j2.i386 0:2.7.1-7jpp.2 set to be updated ---> Downloading header for eclipse-ecj to pack into transaction set. eclipse-ecj-3.2.1-18.el5. 100% |=========================| 15 kB 00:00 ---> Package eclipse-ecj.i386 1:3.2.1-18.el5 set to be updated ---> Downloading header for jakarta-commons-daemon to pack into transaction set. jakarta-commons-daemon-1. 100% |=========================| 7.6 kB 00:00 ---> Package jakarta-commons-daemon.i386 1:1.0.1-6jpp.1 set to be updated ---> Downloading header for jakarta-commons-digester to pack into transaction set. jakarta-commons-digester- 100% |=========================| 7.1 kB 00:00 ---> Package jakarta-commons-digester.i386 0:1.7-5jpp.1 set to be updated ---> Downloading header for jakarta-taglibs-standard to pack into transaction set. jakarta-taglibs-standard- 100% |=========================| 6.6 kB 00:00 ---> Package jakarta-taglibs-standard.i386 0:1.1.1-7jpp.1 set to be updated ---> Downloading header for jakarta-commons-logging to pack into transaction set. jakarta-commons-logging-1 100% |=========================| 7.2 kB 00:00 ---> Package jakarta-commons-logging.i386 0:1.0.4-6jpp.1 set to be updated ---> Downloading header for jakarta-commons-el to pack into transaction set. jakarta-commons-el-1.0-7j 100% |=========================| 6.2 kB 00:00 ---> Package jakarta-commons-el.i386 0:1.0-7jpp.1 set to be updated ---> Downloading header for xml-commons-apis to pack into transaction set. xml-commons-apis-1.3.02-0 100% |=========================| 6.6 kB 00:00 ---> Package xml-commons-apis.i386 0:1.3.02-0.b2.7jpp.10 set to be updated ---> Downloading header for jakarta-commons-fileupload to pack into transaction set. jakarta-commons-fileuploa 100% |=========================| 5.4 kB 00:00 ---> Package jakarta-commons-fileupload.i386 1:1.0-6jpp.1 set to be updated ---> Downloading header for classpathx-jaf to pack into transaction set. classpathx-jaf-1.0-9jpp.1 100% |=========================| 6.3 kB 00:00 ---> Package classpathx-jaf.i386 0:1.0-9jpp.1 set to be updated ---> Downloading header for ldapjdk to pack into transaction set. ldapjdk-4.18-2jpp.3.el5.i 100% |=========================| 6.1 kB 00:00 ---> Package ldapjdk.i386 0:4.18-2jpp.3.el5 set to be updated ---> Downloading header for classpathx-mail to pack into transaction set. classpathx-mail-1.1.1-4jp 100% |=========================| 9.0 kB 00:00 ---> Package classpathx-mail.i386 0:1.1.1-4jpp.2 set to be updated ---> Downloading header for regexp to pack into transaction set. regexp-1.4-2jpp.2.i386.rp 100% |=========================| 7.0 kB 00:00 ---> Package regexp.i386 0:1.4-2jpp.2 set to be updated --> Running transaction check --> Processing Dependency: jaxp_transform_impl for package: jakarta-commons-modeler --> Processing Dependency: bcel >= 0:5.0 for package: mx4j --> Processing Dependency: xml-commons-resolver >= 1.1 for package: xerces-j2 --> Processing Dependency: xml-commons for package: mx4j --> Processing Dependency: oro for package: struts --> Processing Dependency: jakarta-commons-validator for package: struts --> Processing Dependency: axis >= 0:1.1 for package: mx4j --> Processing Dependency: log4j >= 0:1.2.7 for package: mx4j --> Processing Dependency: geronimo-specs = 1.0-0.M2.2jpp.12 for package: geronimo-specs-compat --> Processing Dependency: xml-commons = 0:1.3.02-0.b2.7jpp.10 for package: xml-commons-apis --> Processing Dependency: xalan-j2 >= 2.6.0 for package: jakarta-taglibs-standard --> Processing Dependency: java-devel for package: ant --> Processing Dependency: xml-commons-resolver for package: mx4j --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages. Please wait. ---> Downloading header for jakarta-oro to pack into transaction set. jakarta-oro-2.0.8-3jpp.1. 100% |=========================| 6.9 kB 00:00 ---> Package jakarta-oro.i386 0:2.0.8-3jpp.1 set to be updated ---> Downloading header for xml-commons-resolver to pack into transaction set. xml-commons-resolver-1.1- 100% |=========================| 5.1 kB 00:00 ---> Package xml-commons-resolver.i386 0:1.1-1jpp.12 set to be updated ---> Downloading header for log4j to pack into transaction set. log4j-1.2.13-3jpp.2.i386. 100% |=========================| 9.7 kB 00:00 ---> Package log4j.i386 0:1.2.13-3jpp.2 set to be updated ---> Downloading header for bcel to pack into transaction set. bcel-5.1-8jpp.1.i386.rpm 100% |=========================| 6.5 kB 00:00 ---> Package bcel.i386 0:5.1-8jpp.1 set to be updated ---> Downloading header for java-1.4.2-gcj-compat-devel to pack into transaction set. java-1.4.2-gcj-compat-dev 100% |=========================| 23 kB 00:00 ---> Package java-1.4.2-gcj-compat-devel.i386 0:1.4.2.0-40jpp.112 set to be updated ---> Downloading header for axis to pack into transaction set. axis-1.2.1-2jpp.6.i386.rp 100% |=========================| 8.1 kB 00:00 ---> Package axis.i386 0:1.2.1-2jpp.6 set to be updated ---> Downloading header for jakarta-commons-validator to pack into transaction set. jakarta-commons-validator 100% |=========================| 7.1 kB 00:00 ---> Package jakarta-commons-validator.i386 0:1.1.4-5jpp.1 set to be updated ---> Downloading header for xalan-j2 to pack into transaction set. xalan-j2-2.7.0-6jpp.1.i38 100% |=========================| 14 kB 00:00 ---> Package xalan-j2.i386 0:2.7.0-6jpp.1 set to be updated ---> Downloading header for geronimo-specs to pack into transaction set. geronimo-specs-1.0-0.M2.2 100% |=========================| 8.8 kB 00:00 ---> Package geronimo-specs.i386 0:1.0-0.M2.2jpp.12 set to be updated ---> Downloading header for xml-commons to pack into transaction set. xml-commons-1.3.02-0.b2.7 100% |=========================| 6.1 kB 00:00 ---> Package xml-commons.i386 0:1.3.02-0.b2.7jpp.10 set to be updated --> Running transaction check --> Processing Dependency: jakarta-commons-discovery for package: axis --> Processing Dependency: gcc-java >= 4.0.0-0.42 for package: java-1.4.2-gcj-compat-devel --> Processing Dependency: jakarta-commons-httpclient for package: axis --> Processing Dependency: libgcj-devel >= 4.0.0-0.42 for package: java-1.4.2-gcj-compat-devel --> Processing Dependency: wsdl4j for package: axis --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages. Please wait. ---> Downloading header for jakarta-commons-discovery to pack into transaction set. jakarta-commons-discovery 100% |=========================| 4.8 kB 00:00 ---> Package jakarta-commons-discovery.i386 1:0.3-4jpp.1 set to be updated ---> Downloading header for gcc-java to pack into transaction set. gcc-java-4.1.2-14.el5.i38 100% |=========================| 57 kB 00:00 ---> Package gcc-java.i386 0:4.1.2-14.el5 set to be updated ---> Downloading header for libgcj-devel to pack into transaction set. libgcj-devel-4.1.2-14.el5 100% |=========================| 408 kB 00:00 ---> Package libgcj-devel.i386 0:4.1.2-14.el5 set to be updated ---> Downloading header for wsdl4j to pack into transaction set. wsdl4j-1.5.2-4jpp.1.i386. 100% |=========================| 4.5 kB 00:00 ---> Package wsdl4j.i386 0:1.5.2-4jpp.1 set to be updated ---> Downloading header for jakarta-commons-httpclient to pack into transaction set. jakarta-commons-httpclien 100% |=========================| 8.4 kB 00:00 ---> Package jakarta-commons-httpclient.i386 1:3.0-7jpp.1 set to be updated --> Running transaction check
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size ============================================================================= Installing: tomcat5 i386 5.5.23-0jpp.3.0.2.el5 rhel-Server 335 k tomcat5-admin-webapps i386 5.5.23-0jpp.3.0.2.el5 rhel-Server 3.0 M tomcat5-common-lib i386 5.5.23-0jpp.3.0.2.el5 rhel-Server 197 k tomcat5-jasper i386 5.5.23-0jpp.3.0.2.el5 rhel-Server 981 k tomcat5-jasper-javadoc i386 5.5.23-0jpp.3.0.2.el5 rhel-Server 288 k tomcat5-jsp-2.0-api i386 5.5.23-0jpp.3.0.2.el5 rhel-Server 93 k tomcat5-jsp-2.0-api-javadoc i386 5.5.23-0jpp.3.0.2.el5 rhel-Server 149 k tomcat5-server-lib i386 5.5.23-0jpp.3.0.2.el5 rhel-Server 3.6 M tomcat5-servlet-2.4-api i386 5.5.23-0jpp.3.0.2.el5 rhel-Server 150 k tomcat5-servlet-2.4-api-javadoc i386 5.5.23-0jpp.3.0.2.el5 rhel-Server 156 k tomcat5-webapps i386 5.5.23-0jpp.3.0.2.el5 rhel-Server 1.2 M Installing for dependencies: ant i386 1.6.5-2jpp.2 rhel-Server 2.0 M axis i386 1.2.1-2jpp.6 rhel-Server 2.2 M bcel i386 5.1-8jpp.1 rhel-Server 983 k classpathx-jaf i386 1.0-9jpp.1 rhel-Server 101 k classpathx-mail i386 1.1.1-4jpp.2 rhel-Server 1.1 M eclipse-ecj i386 1:3.2.1-18.el5 rhel-Server 7.9 M gcc-java i386 4.1.2-14.el5 rhel-Server 2.9 M geronimo-specs i386 1.0-0.M2.2jpp.12 rhel-Server 230 k geronimo-specs-compat i386 1.0-0.M2.2jpp.12 rhel-Server 5.5 k jakarta-commons-beanutils i386 1.7.0-5jpp.1 rhel-Server 526 k jakarta-commons-collections i386 3.1-6jpp.1 rhel-Server 1.0 M jakarta-commons-daemon i386 1:1.0.1-6jpp.1 rhel-Server 44 k jakarta-commons-dbcp i386 1.2.1-7jpp.1 rhel-Server 243 k jakarta-commons-digester i386 1.7-5jpp.1 rhel-Server 314 k jakarta-commons-discovery i386 1:0.3-4jpp.1 rhel-Server 134 k jakarta-commons-el i386 1.0-7jpp.1 rhel-Server 240 k jakarta-commons-fileupload i386 1:1.0-6jpp.1 rhel-Server 48 k jakarta-commons-httpclient i386 1:3.0-7jpp.1 rhel-Server 514 k jakarta-commons-launcher i386 0.9-6jpp.1 rhel-Server 88 k jakarta-commons-logging i386 1.0.4-6jpp.1 rhel-Server 106 k jakarta-commons-modeler i386 1.1-8jpp.3.el5 rhel-Server 230 k jakarta-commons-pool i386 1.3-5jpp.1 rhel-Server 128 k jakarta-commons-validator i386 1.1.4-5jpp.1 rhel-Server 155 k jakarta-oro i386 2.0.8-3jpp.1 rhel-Server 173 k jakarta-taglibs-standard i386 1.1.1-7jpp.1 rhel-Server 675 k java-1.4.2-gcj-compat-devel i386 1.4.2.0-40jpp.112 rhel-Server 49 k ldapjdk i386 4.18-2jpp.3.el5 rhel-Server 783 k libgcj-devel i386 4.1.2-14.el5 rhel-Server 1.4 M log4j i386 1.2.13-3jpp.2 rhel-Server 637 k mx4j i386 1:3.0.1-6jpp.4 rhel-Server 2.5 M regexp i386 1.4-2jpp.2 rhel-Server 91 k struts i386 1.2.9-4jpp.5 rhel-Server 1.0 M wsdl4j i386 1.5.2-4jpp.1 rhel-Server 388 k xalan-j2 i386 2.7.0-6jpp.1 rhel-Server 2.7 M xerces-j2 i386 2.7.1-7jpp.2 rhel-Server 1.9 M xml-commons i386 1.3.02-0.b2.7jpp.10 rhel-Server 19 k xml-commons-apis i386 1.3.02-0.b2.7jpp.10 rhel-Server 335 k xml-commons-resolver i386 1.1-1jpp.12 rhel-Server 148 k
Transaction Summary
============================================================================= Install 49 Package(s) Update 0 Package(s) Remove 0 Package(s)
Total download size: 44 M
Is this ok [y/N]: y Downloading Packages: (1/49): tomcat5-jasper-5. 100% |=========================| 981 kB 00:00 (2/49): jakarta-commons-d 100% |=========================| 134 kB 00:00 (3/49): tomcat5-jasper-ja 100% |=========================| 288 kB 00:00 (4/49): jakarta-commons-p 100% |=========================| 128 kB 00:00 (5/49): ant-1.6.5-2jpp.2. 100% |=========================| 2.0 MB 00:00 (6/49): jakarta-commons-b 100% |=========================| 526 kB 00:00 (7/49): jakarta-commons-m 100% |=========================| 230 kB 00:00 (8/49): tomcat5-jsp-2.0-a 100% |=========================| 93 kB 00:00 (9/49): jakarta-oro-2.0.8 100% |=========================| 173 kB 00:00 (10/49): mx4j-3.0.1-6jpp. 100% |=========================| 2.5 MB 00:00 (11/49): jakarta-commons- 100% |=========================| 243 kB 00:00 (12/49): gcc-java-4.1.2-1 100% |=========================| 2.9 MB 00:00 (13/49): xml-commons-reso 100% |=========================| 148 kB 00:00 (14/49): struts-1.2.9-4jp 100% |=========================| 1.0 MB 00:00 (15/49): jakarta-commons- 100% |=========================| 1.0 MB 00:00 (16/49): log4j-1.2.13-3jp 100% |=========================| 637 kB 00:00 (17/49): jakarta-commons- 100% |=========================| 88 kB 00:00 (18/49): geronimo-specs-c 100% |=========================| 5.5 kB 00:00 (19/49): xerces-j2-2.7.1- 100% |=========================| 1.9 MB 00:00 (20/49): eclipse-ecj-3.2. 100% |=========================| 7.9 MB 00:00 (21/49): bcel-5.1-8jpp.1. 100% |=========================| 983 kB 00:00 (22/49): tomcat5-servlet- 100% |=========================| 156 kB 00:00 (23/49): libgcj-devel-4.1 100% |=========================| 1.4 MB 00:01 (24/49): tomcat5-webapps- 100% |=========================| 1.2 MB 00:00 (25/49): tomcat5-common-l 100% |=========================| 197 kB 00:00 (26/49): tomcat5-5.5.23-0 100% |=========================| 335 kB 00:00 (27/49): wsdl4j-1.5.2-4jp 100% |=========================| 388 kB 00:00 (28/49): jakarta-commons- 100% |=========================| 514 kB 00:00 (29/49): jakarta-commons- 100% |=========================| 44 kB 00:00 (30/49): jakarta-commons- 100% |=========================| 314 kB 00:00 (31/49): jakarta-taglibs- 100% |=========================| 675 kB 00:00 (32/49): jakarta-commons- 100% |=========================| 106 kB 00:00 (33/49): tomcat5-admin-we 100% |=========================| 3.0 MB 00:00 (34/49): java-1.4.2-gcj-c 100% |=========================| 49 kB 00:00 (35/49): tomcat5-servlet- 100% |=========================| 150 kB 00:00 (36/49): axis-1.2.1-2jpp. 100% |=========================| 2.2 MB 00:00 (37/49): jakarta-commons- 100% |=========================| 240 kB 00:00 (38/49): jakarta-commons- 100% |=========================| 155 kB 00:00 (39/49): xml-commons-apis 100% |=========================| 335 kB 00:00 (40/49): jakarta-commons- 100% |=========================| 48 kB 00:00 (41/49): classpathx-jaf-1 100% |=========================| 101 kB 00:00 (42/49): xalan-j2-2.7.0-6 100% |=========================| 2.7 MB 00:00 (43/49): tomcat5-jsp-2.0- 100% |=========================| 149 kB 00:00 (44/49): geronimo-specs-1 100% |=========================| 230 kB 00:00 (45/49): ldapjdk-4.18-2jp 100% |=========================| 783 kB 00:00 (46/49): tomcat5-server-l 100% |=========================| 3.6 MB 00:00 (47/49): xml-commons-1.3. 100% |=========================| 19 kB 00:00 (48/49): classpathx-mail- 100% |=========================| 1.1 MB 00:00 (49/49): regexp-1.4-2jpp. 100% |=========================| 91 kB 00:00 Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing: jakarta-commons-logging ####################### [ 1/49] Installing: tomcat5-servlet-2.4-api ####################### [ 2/49] Installing: jakarta-commons-collections ####################### [ 3/49] Installing: jakarta-commons-beanutils ####################### [ 4/49] Installing: jakarta-commons-digester ####################### [ 5/49] Installing: classpathx-jaf ####################### [ 6/49] Installing: classpathx-mail ####################### [ 7/49] Installing: tomcat5-jasper ####################### [ 8/49] Installing: tomcat5-jsp-2.0-api ####################### [ 9/49] Installing: jakarta-commons-fileupload ####################### [10/49] Installing: regexp ####################### [11/49] Installing: xml-commons ####################### [12/49] Installing: xml-commons-apis ####################### [13/49] Installing: jakarta-commons-el ####################### [14/49] Installing: libgcj-devel ####################### [15/49] Installing: eclipse-ecj ####################### [16/49] Installing: jakarta-oro ####################### [17/49] Installing: jakarta-commons-pool ####################### [18/49] Installing: jakarta-commons-dbcp ####################### [19/49] Installing: jakarta-commons-validator ####################### [20/49] Installing: struts ####################### [21/49] Installing: gcc-java ####################### [22/49] Installing: java-1.4.2-gcj-compat-devel ####################### [23/49] Installing: bcel ####################### [24/49] Installing: jakarta-commons-discovery ####################### [25/49] Installing: jakarta-commons-httpclient ####################### [26/49] Installing: ldapjdk ####################### [27/49] Installing: jakarta-commons-daemon ####################### [28/49] Installing: jakarta-commons-launcher ####################### [29/49] Installing: tomcat5-jsp-2.0-api-javadoc ####################### [30/49] Installing: tomcat5-servlet-2.4-api-java ####################### [31/49] Installing: tomcat5-jasper-javadoc ####################### [32/49] Installing: xerces-j2 ####################### [33/49] Installing: log4j ####################### [34/49] Installing: xalan-j2 ####################### [35/49] Installing: xml-commons-resolver ####################### [36/49] Installing: jakarta-taglibs-standard ####################### [37/49] Installing: ant ####################### [38/49] Installing: wsdl4j ####################### [39/49] Installing: axis ####################### [40/49] Installing: mx4j ####################### [41/49] Installing: jakarta-commons-modeler ####################### [42/49] Installing: tomcat5-server-lib ####################### [43/49] Installing: geronimo-specs ####################### [44/49] Installing: geronimo-specs-compat ####################### [45/49] Installing: tomcat5-common-lib ####################### [46/49] Installing: tomcat5 ####################### [47/49] Installing: tomcat5-webapps ####################### [48/49] Installing: tomcat5-admin-webapps ####################### [49/49]
Installed: tomcat5.i386 0:5.5.23-0jpp.3.0.2.el5 tomcat5-admin-webapps.i386 0:5.5.23-0jpp.3.0.2.el5 tomcat5-common-lib.i386 0:5.5.23-0jpp.3.0.2.el5 tomcat5-jasper.i386 0:5.5.23-0jpp.3.0.2.el5 tomcat5-jasper-javadoc.i386 0:5.5.23-0jpp.3.0.2.el5 tomcat5-jsp-2.0-api.i386 0:5.5.23-0jpp.3.0.2.el5 tomcat5-jsp-2.0-api-javadoc.i386 0:5.5.23-0jpp.3.0.2.el5 tomcat5-server-lib.i386 0:5.5.23-0jpp.3.0.2.el5 tomcat5-servlet-2.4-api.i386 0:5.5.23-0jpp.3.0.2.el5 tomcat5-servlet-2.4-api-javadoc.i386 0:5.5.23-0jpp.3.0.2.el5 tomcat5-webapps.i386 0:5.5.23-0jpp.3.0.2.el5
Dependency Installed: ant.i386 0:1.6.5-2jpp.2 axis.i386 0:1.2.1-2jpp.6 bcel.i386 0:5.1-8jpp.1 classpathx-jaf.i386 0:1.0-9jpp.1 classpathx-mail.i386 0:1.1.1-4jpp.2 eclipse-ecj.i386 1:3.2.1-18.el5 gcc-java.i386 0:4.1.2-14.el5 geronimo-specs.i386 0:1.0-0.M2.2jpp.12 geronimo-specs-compat.i386 0:1.0-0.M2.2jpp.12 jakarta-commons-beanutils.i386 0:1.7.0-5jpp.1 jakarta-commons-collections.i386 0:3.1-6jpp.1 jakarta-commons-daemon.i386 1:1.0.1-6jpp.1 jakarta-commons-dbcp.i386 0:1.2.1-7jpp.1 jakarta-commons-digester.i386 0:1.7-5jpp.1 jakarta-commons-discovery.i386 1:0.3-4jpp.1 jakarta-commons-el.i386 0:1.0-7jpp.1 jakarta-commons-fileupload.i386 1:1.0-6jpp.1 jakarta-commons-httpclient.i386 1:3.0-7jpp.1 jakarta-commons-launcher.i386 0:0.9-6jpp.1 jakarta-commons-logging.i386 0:1.0.4-6jpp.1 jakarta-commons-modeler.i386 0:1.1-8jpp.3.el5 jakarta-commons-pool.i386 0:1.3-5jpp.1 jakarta-commons-validator.i386 0:1.1.4-5jpp.1 jakarta-oro.i386 0:2.0.8-3jpp.1 jakarta-taglibs-standard.i386 0:1.1.1-7jpp.1 java-1.4.2-gcj-compat-devel.i386 0:1.4.2.0-40jpp.112 ldapjdk.i386 0:4.18-2jpp.3.el5 libgcj-devel.i386 0:4.1.2-14.el5 log4j.i386 0:1.2.13-3jpp.2 mx4j.i386 1:3.0.1-6jpp.4 regexp.i386 0:1.4-2jpp.2 struts.i386 0:1.2.9-4jpp.5 wsdl4j.i386 0:1.5.2-4jpp.1 xalan-j2.i386 0:2.7.0-6jpp.1 xerces-j2.i386 0:2.7.1-7jpp.2 xml-commons.i386 0:1.3.02-0.b2.7jpp.10 xml-commons-apis.i386 0:1.3.02-0.b2.7jpp.10 xml-commons-resolver.i386 0:1.1-1jpp.12 Complete! [root@masterdns ~]# |
启动tomcat
启动完成后,就可以访问了,端口8080
点左边的tomcaot admin可以登陆,ID自己设置,jk安装比较麻烦,测试就不用了,JSP用的少,一般的企业不会用,网站php多,如果要功能多的,比如管理的网站就是CGI,安全和功能都要求高的才是jsp
整合Apache和Tomcat
1.下载mod_jk
2.安装和配置mod_jk
① 将mod_jk-1.2.23-apache-2.2.x-linux-i686.so拷贝到/etc/httpd/modules目录中,并将它重命名为mod_jk.so。
② 在/usr/share/tomcat5/conf目录中新建子目录jk,并新建文件workers.properties,内容如下。
workers.tomcat_home=/usr/share/tomcat5
workers.java_home=/usr/lib/jvm/java
ps=/
worker.list= ajp13
worker.ajp13.port=8009
worker.ajp13.host=127.0.0.1
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
③ 修改/usr/share/tomcat5/conf/server.xml文件,在
<Engine name=“Catalina” defaultHost=“localhost”>
语句下添加语句
<Listener className=“org.apache.jk.config.ApacheConfig” modJk=“/etc/httpd/modules/mod_jk.so” />
④ 重新启动Tomcat服务,这时将自动生成目录/usr/share/tomcat5/conf/auto和文件/usr/share/tomcat5/conf/auto/mod_jk.conf。
将文件/usr/share/tomcat5/conf/auto/mod_jk.conf拷贝到/usr/share/tomcat5/conf/jk目录中,
并重命名为mod_jk.conf-auto。
⑤ 修改mod_jk.conf-auto文件,修改后内容如下。
<IfModule !mod_jk.c>
LoadModule jk_module "/etc/httpd/modules/mod_jk.so"
</IfModule>
JkWorkersFile "/usr/share/tomcat5/conf/jk/workers.properties"
JkLogFile "/usr/share/tomcat5/logs/mod_jk.log"
JkLogLevel emerg
<VirtualHost *:80>
ServerName localhost
JkMount /*.jsp ajp13
</VirtualHost>
3.配置Tomcat
要实现Apache和Tomcat整合,需要设置Apache和Tomcat的主目录一致。
由于Tomcat默认的主目录是/var/lib/tomcat5/webapps/ROOT,因此应编辑
Tomcat的主配置文件/usr/share/tomcat5/conf/server.xml,找到如下语句:
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
在其后添加以下语句:
<Context path="" docBase="/var/www/html" debug="0"/>
4.配置Apache
编辑文件/etc/httpd/conf/httpd.conf,在文件末尾添加如下语句:
Include /usr/share/tomcat5/conf/jk/mod_jk.conf-auto
5.重新启动Apache和Tomcat
6.测试Apache和Tomcat整合
在主目录/var/www/html/中建立一个名为test.jsp的文件,该文件的内容如下:
Hello! The time is <%= new java.util.Date() %>
在客户端的浏览器中访问“[url]http://Linux[/url]服务器的IP地址/test.jsp”,如果出现右如图所示的“Hello! The time is 当前时间”的信息,则表示Apache和Tomcat整合成功。
1.下载mod_jk
2.安装和配置mod_jk
① 将mod_jk-1.2.23-apache-2.2.x-linux-i686.so拷贝到/etc/httpd/modules目录中,并将它重命名为mod_jk.so。
② 在/usr/share/tomcat5/conf目录中新建子目录jk,并新建文件workers.properties,内容如下。
workers.tomcat_home=/usr/share/tomcat5
workers.java_home=/usr/lib/jvm/java
ps=/
worker.list= ajp13
worker.ajp13.port=8009
worker.ajp13.host=127.0.0.1
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
③ 修改/usr/share/tomcat5/conf/server.xml文件,在
<Engine name=“Catalina” defaultHost=“localhost”>
语句下添加语句
<Listener className=“org.apache.jk.config.ApacheConfig” modJk=“/etc/httpd/modules/mod_jk.so” />
④ 重新启动Tomcat服务,这时将自动生成目录/usr/share/tomcat5/conf/auto和文件/usr/share/tomcat5/conf/auto/mod_jk.conf。
将文件/usr/share/tomcat5/conf/auto/mod_jk.conf拷贝到/usr/share/tomcat5/conf/jk目录中,
并重命名为mod_jk.conf-auto。
⑤ 修改mod_jk.conf-auto文件,修改后内容如下。
<IfModule !mod_jk.c>
LoadModule jk_module "/etc/httpd/modules/mod_jk.so"
</IfModule>
JkWorkersFile "/usr/share/tomcat5/conf/jk/workers.properties"
JkLogFile "/usr/share/tomcat5/logs/mod_jk.log"
JkLogLevel emerg
<VirtualHost *:80>
ServerName localhost
JkMount /*.jsp ajp13
</VirtualHost>
3.配置Tomcat
要实现Apache和Tomcat整合,需要设置Apache和Tomcat的主目录一致。
由于Tomcat默认的主目录是/var/lib/tomcat5/webapps/ROOT,因此应编辑
Tomcat的主配置文件/usr/share/tomcat5/conf/server.xml,找到如下语句:
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
在其后添加以下语句:
<Context path="" docBase="/var/www/html" debug="0"/>
4.配置Apache
编辑文件/etc/httpd/conf/httpd.conf,在文件末尾添加如下语句:
Include /usr/share/tomcat5/conf/jk/mod_jk.conf-auto
5.重新启动Apache和Tomcat
6.测试Apache和Tomcat整合
在主目录/var/www/html/中建立一个名为test.jsp的文件,该文件的内容如下:
Hello! The time is <%= new java.util.Date() %>
在客户端的浏览器中访问“[url]http://Linux[/url]服务器的IP地址/test.jsp”,如果出现右如图所示的“Hello! The time is 当前时间”的信息,则表示Apache和Tomcat整合成功。
要安装jk的自己去安装模块吧
##################Michael分割线######################
本文转自redking51CTO博客,原文链接:http://blog.51cto.com/redking/154276,如需转载请自行联系原作者