在CentOS 中yum 安裝Tomcat 6

來源:互聯網
上載者:User

標籤:yum tomcat

在linux下部署java開發的web應用,一般採用Tomact+jre環境(可不需要apache),在RHEL和CentOS下,可以採用yum線上自動安裝方式安裝,具體操作如下:

1、基礎環境安裝配置

   如作業系統(我使用Centos6.3)、網路及主機基本配置等

2yum安裝tomcat

 yum -y install tomcat6 tomcat6-webapps tomcat6-admin-webapps tomcat6-docs-webapp tomcat6-javadoc

    yum安裝tomcat會自動安裝相關的軟體,如jre環境等,因此不需要單獨安裝jre。

3yum安裝後的tomcat目錄說明:

設定檔目錄:/etc/tomcat6

安裝程式主目錄:/var/lib/tomcat6/

在Centos使用yum安裝後,Tomcat相關的目錄都已採用符號連結到/usr/share/tomcat6目錄,包含webapps等,這很方便我們組態管理
[[email protected] tomcat6]# ll  /usr/share/tomcat6
總用量 4
drwxr-xr-x. 2 root root   4096 10月 19 00:44 bin
lrwxrwxrwx. 1 root tomcat   12 10月 19 00:44 conf ->/etc/tomcat6
lrwxrwxrwx. 1 root root     23 10月 19 00:44 lib ->/usr/share/java/tomcat6
lrwxrwxrwx. 1 root root     16 10月 19 00:44 logs ->/var/log/tomcat6
lrwxrwxrwx. 1 root root     23 10月 19 00:44 temp ->/var/cache/tomcat6/temp
lrwxrwxrwx. 1 root root     24 10月 19 00:44 webapps ->/var/lib/tomcat6/webapps
lrwxrwxrwx. 1 root root     23 10月 19 00:44 work ->/var/cache/tomcat6/work

 

4、修改連接埠808080
需80連接埠未被佔用,可以使用netstat -nat查看80連接埠是否在使用。
a)修改vi /etc/tomcat6/server.xml檔案的如下欄位中的8080為80

<Connector port="8080" protocol="HTTP/1.1"

               connectionTimeout="20000"

               redirectPort="8443" />

b)由於在Centos6中,系統不允許tomcat使用者使用1024以下的連接埠,因此還需修改vi /etc/tomcat6/tomcat6.conf

找到CONNECTOR_PORT="8080"並注釋掉,新增如下兩行:

TOMCAT_USER="root"

CONNECTOR_PORT="80"

註:這樣做的安全性有待驗證

 c)使用命令service tomcat6 restart 重啟tomcat服務。以後訪問頁面就可以只需要輸入IP或者主機名稱即可,而不再需要加連接埠號碼。

 

本文出自 “劉軍linux” 部落格,請務必保留此出處http://bluefei.blog.51cto.com/3921428/1768780

在CentOS 中yum 安裝Tomcat 6

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.