Tomcat 8安裝部署
本文使用tomcat 8.5.40
操作平臺:Linux
一、下載連結:
二、上傳Linux 伺服器客戶指定目錄
[tm8@gwdata ~]$ pwd
/app/tm8
三、解壓
#gunzip apache-tomcat-8.5.40.tar.gz
#tar -xvf apache-tomcat-8.5.40.tar
四、配置環境變數
#vi .bash_profile
export JAVA_HOME=/app/tm8/jdk1.8.0_121
export JRE_HOME=/app/tm8/jdk1.8.0_121/jre
PATH=$JAVA_HOME/bin:$PATH:$HOME/bin
export PAT
賦權,否則無法啟動tomcat
#chmod +x /app/tm8/jdk1.8.0_121/bin/java
#chmod +x /app/tm8/jdk1.8.0_121/jre/bin/java
五、配置控制檯密碼:
進入配置目錄:
#cd /app/tm8/apache-tomcat-8.5.40/conf
編輯tomcat-users.xml檔案,新增如下:
<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="admin" password="zwch_!QAZxsw2@2019" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui"/>
六、配置訪問限制
修改地址訪問限制/app/tm8/apache-tomcat-8.5.40/webapps/manager/META-IN/context.xml
#vi /app/tm8/apache-tomcat-8.5.40/webapps/manager/META-IN/context.xml
<Context antiResourceLocking="false" privileged="true" >
<!-- <Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
<Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.u
til\.(?:Linked)?HashMap"/>
-->
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
</Context>
或:
/app/tm8/apache-tomcat-8.5.40/webapps/host-manager/META-INF/context.xml
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="\d+.\d+.\d+.\d+|::1|0:0:0:0:0:0:0:1" />
配置遠端訪問manager /app/tm8/apache-tomcat-8.5.40/conf/Catalina/localhost 新增
#vi manager.xml
<Context privileged="true" antiResourceLocking="false"
docBase="${catalina.home}/webapps/manager">
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
</Context>
七、配置開機啟動
1.修改指令碼檔案rc.local:vim /etc/rc.d/rc.local
該檔案中可新增系統自啟後需要執行的指令碼或命令
2.在檔案中加入如下內容:
export JAVA_HOME=/usr/local/jdk1.8
/usr/local/tomcat8/bin/startup.sh
必須要加JAVA_HOME,否則沒法成功。
3.更改檔案許可權:chmod +x /etc/rc.d/rc.local
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30327022/viewspace-2643788/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- CentOS7 Tomcat JSP 安裝部署CentOSTomcatJS
- Linux 安裝tomcat8和tomcat7LinuxTomcat
- Linux下Tomcat8的安裝LinuxTomcat
- Ubuntu下Java、Nginx和Tomcat的安裝部署UbuntuJavaNginxTomcat
- Centos6.3下jdk+tomcat安裝部署CentOSJDKTomcat
- Tomcat手動啟動/部署[非安裝版]Tomcat
- 在CentOS7.8中安裝tomcat8CentOSTomcat
- Centos7安裝jenkins+docker部署tomcatCentOSJenkinsDockerTomcat
- Linux系統安裝tomcat並部署專案。LinuxTomcat
- 使用docker搭建環境:安裝tomcat、部署war包DockerTomcat
- Centos8部署jdk、mysql8、tomcat,並部署專案到tomcat中CentOSJDKMySqlTomcat
- Tomcat安裝Tomcat
- 一 GBase 8a MPP Cluster安裝部署
- k8s_centos7 安裝部署corednsK8SCentOSDNS
- K8s kubernetes安裝部署K8S
- Tomcat—部署配置及優化(安裝部署;虛擬主機配置;優化)Tomcat優化
- Centos8 stream系統編譯安裝Tomcat教程。CentOS編譯Tomcat
- MySQL 8 複製(八)——組複製安裝部署MySql
- Docker 安裝 TomcatDockerTomcat
- tomcat安裝使用Tomcat
- docker 安裝tomcatDockerTomcat
- Tomcat配置安裝Tomcat
- apache tomcat 安裝ApacheTomcat
- tomcat之 JDK8.0安裝、tomcat-8.5.15安裝TomcatJDK
- window系統下安裝openjdk,tomcat部署springboot war包JDKTomcatSpring Boot
- window下tomcat安裝Tomcat
- linux安裝tomcatLinuxTomcat
- Tomcat安裝指令碼Tomcat指令碼
- centos下安裝tomcatCentOSTomcat
- Tomcat之一:安裝Tomcat
- mac下安裝TomcatMacTomcat
- Tomcat安裝與配置Tomcat
- tomcat 下安裝 MantisBTTomcat
- Mac 下安裝tomcatMacTomcat
- Zabbix安裝部署
- canal安裝部署
- Doris安裝部署
- greenplum安裝部署