注意:前提已經(jīng)安裝好Oracle8.0的JDK
1童擎、從官方網(wǎng)站找到Tomcat8,下載安裝包;
http://tomcat.apache.org/download-80.cgi
找到安裝包后底扳,下載相應版本的Tomcat,本文下載的是8.0版本
tomcat官網(wǎng)
2贡耽、然后進入Centos衷模,進行如下操作:
# cd /usr/local
# wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.8/bin/apache-tomcat-8.5.8.tar.gz
# tar -zvxf apache-tomcat-8.5.8.tar.gz
# mv apache-tomcat-8.5.8 tomcat
3、修改/usr/local/tomcat/conf/tomcat-users.xml,在后面加上
內(nèi)容如下:
<role rolename="manager"/>
<role rolename="manager-gui"/>
<role rolename="admin"/>
<user username="tomcat" password="tomcat" roles="admin,manager,manager-gui"/>
4蒲赂、同時還需要進入/usr/local/tomcat/conf/Catalina/localhost/中查看有無manager.xml這個文件算芯,沒有的話新建一個,添加如下內(nèi)容:
內(nèi)容如下:
<Context privileged="true" antiResourceLocking="false"
docBase="${catalina.home}/webapps/manager">
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
</Context>
5凳宙、運行Tomcat
# cd /usr/local/tomcat/bin
# ./startup.sh
顯示如下內(nèi)容熙揍,表示tomcat已經(jīng)啟動;
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/java/jre1.8.0_111
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
或者輸入
# ./catalina.sh run
6氏涩、通過本機輸入IP
http://192.168.239.130:8080
則會進入tomcat界面届囚,
tomcat界面
7、點擊Manager APP是尖,輸入第3步中創(chuàng)建的用戶名:tomcat和密碼:tomcat意系;密碼輸入正確則會進入tomcat操作界面;
操作界面