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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Linux下Tomcat8的安裝LinuxTomcat
- Linux系統安裝tomcat並部署專案。LinuxTomcat
- Centos7安裝jenkins+docker部署tomcatCentOSJenkinsDockerTomcat
- 在CentOS7.8中安裝tomcat8CentOSTomcat
- 使用docker搭建環境:安裝tomcat、部署war包DockerTomcat
- Tomcat安裝Tomcat
- Centos8部署jdk、mysql8、tomcat,並部署專案到tomcat中CentOSJDKMySqlTomcat
- K8s kubernetes安裝部署K8S
- window系統下安裝openjdk,tomcat部署springboot war包JDKTomcatSpring Boot
- docker 安裝tomcatDockerTomcat
- tomcat安裝使用Tomcat
- Docker 安裝 TomcatDockerTomcat
- linux安裝tomcatLinuxTomcat
- Tomcat—部署配置及優化(安裝部署;虛擬主機配置;優化)Tomcat優化
- 一 GBase 8a MPP Cluster安裝部署
- Centos8 stream系統編譯安裝Tomcat教程。CentOS編譯Tomcat
- k8s_centos7 安裝部署corednsK8SCentOSDNS
- window下tomcat安裝Tomcat
- MySQL 8 複製(八)——組複製安裝部署MySql
- K8s(Kubernetes)簡介及安裝部署K8S
- docker使用大全 tomcat安裝DockerTomcat
- Tomcat安裝與優化Tomcat優化
- windows下Tomcat安裝配置WindowsTomcat
- 下載tomcat與安裝Tomcat
- 安裝Tomcat伺服器Tomcat伺服器
- CentOS下tomcat安裝配置CentOSTomcat
- Tomcat安裝SSL證書Tomcat
- K8S 部署 ingress-nginx (二) 部署後端為 tomcatK8SNginx後端Tomcat
- Linux伺服器—安裝TomcatLinux伺服器Tomcat
- Linux(jdk+tomcat配置安裝)LinuxJDKTomcat
- windows下安裝Tomcat服務WindowsTomcat
- Tomcat安裝目錄解釋Tomcat
- Tomcat的下載與安裝Tomcat
- Linux安裝部署Linux
- ELK安裝部署
- chromedriver安裝部署Chrome
- canal安裝部署
- SQOOP安裝部署OOP