cemtos 7 linux 安裝與卸載 tomcat 7,cemtostomcat

來源:互聯網
上載者:User

cemtos 7 linux 安裝與卸載 tomcat 7,cemtostomcat

一、聲明:

  本文採用作業系統版本: Centos 7 Linux系統  
  版本源:CentOS-7-x86_64-DVD-1708.iso
  官網:http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1708.iso
  安裝包選擇:最小安裝包(且安裝了 jdk,並有 vim 功能)

二、安裝 tomcat 7 前的準備工作

  從 apache 官網 下載 tomcat 安裝包(建議使用 tar 包形式的安裝檔案)

  官網:http://mirror.bit.edu.cn/apache/tomcat/tomcat-7/v7.0.82/bin/apache-tomcat-7.0.82.tar.gz

  2.1 將 tomcat 安裝檔案通過 ftp 軟體上傳到 linux 系統上

    小生放在了 /var/ftp/pub 檔案夾下面。

  2.2 解壓檔案,並剪下到 / 目錄下

    解壓檔案:tar -zxvf apache-tomcat-7.0.82.tar.gz

    移動到根目錄下:mv apache-tomcat-7.0.82.tar.gz /

    重新命名檔案:mv apache-tomcat-7.0.82.tar.gz ./tomcat7

 三、啟動 tomcat

  查看 /tomcat7/bin/ 目錄下的 .sh 檔案是否可執行

  使用 ll 命令查看檔案使用許可權

  如果檔案不可使用,則使用命令:

  chmod 755 ./*.sh

  修改目前的目錄下的所有 .sh 檔案,使其變成可執行檔

  運行 tomcat :./ startup.sh

  關閉 tomcat: ./shutdowm.sh

 四、防火牆配置

   開放 8080 連接埠:

   firewall-cmd --zone=public --add-port=8080/tcp --permanent  

   重啟防火牆:

   firewall-cmd --reload  

 

 五、設定 tomcat 開機自啟動

   4.1 修改 rc.local 檔案配置(檔案最後添加指令碼)

  vim /etc/rc.d/rc.local 

   文本最後增加指令碼:

  JAVA_HOME=/usr/java/jdk1.7.0_80

  export JAVA_HOME

  /tomcat7/bin/startup.sh

   4.2 修改rc.local檔案為可執行,如: chmod +x rc.local

   重啟機器即可。

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.