歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> 在CentOS 中yum 安裝Tomcat 6

在CentOS 中yum 安裝Tomcat 6

日期:2017/3/3 14:15:46   编辑:Linux技術

在linux下部署java開發的web應用,一般采用Tomact+jre環境(可不需要apache),在RHEL和CentOS下,可以采用yum在線自動安裝方式安裝,具體操作如下:1、基礎環境安裝配置如操作系統(我使用Centos6.3)、網絡及主機基本配置等2yum安裝tomcatyum -y install tomcat6 tomcat6-webapps tomcat6-admin-webapps tomcat6-docs-webapp tomcat6-javadocyum安裝tomcat會自動安裝相關的軟件,如jre環境等,因此不需要單獨安裝jre。3yum安裝後的tomcat目錄說明:配置文件目錄:/etc/tomcat6安裝程序主目錄:/var/lib/tomcat6/在Centos使用yum安裝後,Tomcat相關的目錄都已采用符號鏈接到/usr/share/tomcat6目錄,包含webapps等,這很方便我們配置管理[root@tomcattest 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

Copyright © Linux教程網 All Rights Reserved