七、启动服务
- # /usr/local/apache2/bin/apachectl start
- # service tomcat start
- Using CATALINA_BASE: /usr/local/tomcat
- Using CATALINA_HOME: /usr/local/tomcat
- Using CATALINA_TMPDIR: /usr/local/tomcat/temp
- Using JRE_HOME: /usr/java/jdk1.5.0_06
- Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar
- 出现这些说明tomcat启动成功
八、测试
http://127.0.0.1 出现“It works”
http://127.0.0.1:8080 出现一个“猫”的log说明成功
九、整合apache与tomcat
# vi /usr/local/tomcat/conf/server.xml
- 找到如下一段:
- 128 <Host name="localhost" appBase="webapps"
- 129 unpackWARs="true" autoDeploy="true"
- 130 xmlValidation="false" xmlNamespaceAware="false">
- 在下面添加一行:定义主目录与apache相同
- <Context path="" docBase="/usr/local/apache2/htdocs" debug="0"/>
重启服务<顺序不能乱>
- # /usr/local/apache2/bin/apachectl stop
- # service tomcat stop
- # /usr/local/apache2/bin/apachectl start
- # service tomcat start
建立测试页面
# vi /usr/local/apache2/htdocs/time.jsp
填入: Hello! The time is <%= new java.util.Date() %>
链接测试:
访问http://127.0.0.1/time.jsp与http://127.0.0.1:8080/time.jsp
http://127.0.0.1/与http://127.0.0.1:8080/
出现各自相同的页面
......................
说明成功! 本文出自 “学习linux” 博客,请务必保留此出处http://tonychiu.blog.51cto.com/656605/583327
|