加入收藏 | 设为首页 | 会员中心 | 我要投稿 51站长网 (https://www.51zhanzhang.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
站内搜索:
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

Install Tomcat 6 on CentOS or RHEL --转载

发布时间:2021-01-25 19:19:11 所属栏目:Linux 来源:网络整理
导读:p class="entryContent"? p class="entryContent"source:http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos p class="entryContent"This post will cover installation and configuration of Tomcat 6 on CentOS 5. We will also show how

Change to the /etc/init.d directory and create a script called 'tomcat' as shown below.


<div class="dp-highlighter">
<div class="bar">
<div class="tools">
<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;view plain<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;copy to clipboard<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;print<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;?

  1. [root@blanche?init.d]#?vi?tomcat??

  1. ??
  2. ??
  3. ?JAVA_HOME??
  4. ?PATH??
  5. ??
  6. start)??
  7. ;;???
  8. sh?$CATALINA_HOME/bin/shutdown.sh??
  9. restart)??
  10. sh?$CATALINA_HOME/bin/startup.sh??
  11. esac??????

The above script is simple and contains all of the basic elements you will need to get going.

As you can see,we are simply calling the startup.sh and shutdown.sh
scripts located in the Tomcat bin directory
(/usr/share/apache-tomcat-6.0.32/bin).

You can adjust your script according to your needs and,in subsequent posts,we'll look at additional examples.

CATALINA_HOME is the Tomcat home directory (/usr/share/apache-tomcat-6.0.32)

Now,set the permissions for your script to make it executable:


<div class="dp-highlighter">
<div class="bar">
<div class="tools">
<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;view plain<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;copy to clipboard<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;print<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;?

We now use the chkconfig utility to have Tomcat start at boot time. In
my script above,I am using chkconfig: 244 20 80. 2445 are the run
levels and 20 and 80 are the stop and start priorities respectively. You
can adjust as needed.


<div class="dp-highlighter">
<div class="bar">
<div class="tools">
<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;view plain<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;copy to clipboard<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;print<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;?

  1. [root@blanche?init.d]#?chkconfig?--level?234?tomcat?on??

Verify it:


<div class="dp-highlighter">
<div class="bar">
<div class="tools">
<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;view plain<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;copy to clipboard<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;print<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;?

  1. tomcat??????????0:off???1:off???2:on????3:on????4:on????5:off???6:off??

Now,let's test our script.

Start Tomcat:


<div class="dp-highlighter">
<div class="bar">
<div class="tools">
<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;view plain<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;copy to clipboard<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;print<a href="http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos"&gt;?

  1. Using?CATALINA_BASE:???/usr/share/apache-tomcat-6.0.32??
  2. Using?CATALINA_TMPDIR:?/usr/share/apache-tomcat-6.0.32/temp??
  3. Using?CLASSPATH:???????/usr/share/apache-tomcat-6.0.32/bin/bootstrap.jar??

(编辑:ASP站长)

【免责声明】本站内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。

相关内容
未处理完善
    无相关信息
未处理完善