CentOS7 Tomcat JSP 安裝部署
安裝JDK
yum install -y java-1.8.0-openjdk
測試安裝
java -version
安裝Tomcat
yum install -y tomcat tomcat-webapps tomcat-admin-webapps tomcat-docs-webapp
編輯tomcat-users.xml
vi /etc/tomcat/tomcat-users.xml
去掉註釋
<role rolename="admin-script"/>
<role rolename="manager"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user name="admin" password="adminadmin" roles="admin,manager,admin-gui,admin-script,manager-gui,manager-script,manager-jmx,manager-status" />
啟動tomcat
systemctl start tomcat
新增自動啟動
systemctl enable tomcat
訪問預設站點
host:8080
部署JSP站點
在webapps下建立目錄並
mkdir /usr/share/tomcat/webapps/myweb
新增測試頁
vi /usr/share/tomcat/webapps/myweb/index.jsp
新增內容(輸出版本號)
<%= getServletContext().getServerInfo() %>
訪問地址
host:8080/myweb
多域名配置
vi /etc/tomcat/server.xml
在Engine節點下新增Host節點,詳細配置參考
<Host name="www.myweb.com" appBase="/home/myweb" unpackWARs="true" autoDeploy="true">
<Context path="" docBase="/home/myweb" debug="0" reloadable="false" />
</Host>
重啟生效
多站點配置
站點不在webapps目錄下
vi /usr/share/tomcat/conf/server.xml
在Host節點下新增Context節點,詳細配置參考
<Context path="myweb" docBase="/home/myweb" debug="0" reloadable="false" />
重啟生效
war 釋出
1.專案匯出 war 檔案
右鍵 -> Export -> Web -> WAR file -> Browse...(選擇匯出目錄+檔名)
2.上傳到伺服器
3.解壓到指定目錄
jar -xvf project.war -d
第三方JAR部署
1.把jar檔案上傳到tomcat/lib目錄
2.增加預設載入目錄
vi /etc/tomcat/catalina.properties
# 追加目錄
common.loader=${catalina.base}/lib...,${catalina.base}/lib/extras/*.jar
相關文章
- Centos7安裝jenkins+docker部署tomcatCentOSJenkinsDockerTomcat
- Centos7安裝安裝部署dockerCentOSDocker
- Tomcat 8安裝部署Tomcat
- CentOS7 docker安裝部署教程CentOSDocker
- Centos7編譯安裝Tomcat教程。CentOS編譯Tomcat
- CentOS7系統GitLab安裝部署教程。CentOSGitlab
- 熱門報導:CentOS7安裝[Mysql,JDK,TomCat]CentOSMySqlJDKTomcat
- tomcat+mysql部署jsp環境!!!!(轉)TomcatMySqlJS
- Ubuntu下Java、Nginx和Tomcat的安裝部署UbuntuJavaNginxTomcat
- Centos6.3下jdk+tomcat安裝部署CentOSJDKTomcat
- Tomcat手動啟動/部署[非安裝版]Tomcat
- 配置Eclpise+tomcat與實現JSP部署TomcatJS
- 求救~~~~~tomcat+mysql部署jsp環境!!!!!(轉)TomcatMySqlJS
- Linux系統安裝tomcat並部署專案。LinuxTomcat
- 使用docker搭建環境:安裝tomcat、部署war包DockerTomcat
- Centos7安裝部署openstack--nova計算服務CentOS
- Tomcat安裝Tomcat
- Liunx(CentOS7)中介軟體Weblogic的安裝與部署CentOSWeb
- Tomcat—部署配置及優化(安裝部署;虛擬主機配置;優化)Tomcat優化
- 安裝centos7最小化安裝CentOS
- CentOS7 安裝 memcacheCentOS
- CentOS7 安裝 dockerCentOSDocker
- CentOS7 安裝 MySQLCentOSMySql
- CentOS7安裝RedisCentOSRedis
- Centos7 安裝ffmpegCentOS
- centos7安裝protobufCentOS
- 4.1 CentOS7安裝CentOS
- CentOS7 安裝NginxCentOSNginx
- centos7 安裝pipCentOS
- Centos7安裝RabbitMQCentOSMQ
- centos7安裝dockerCentOSDocker
- centos7安裝iptablesCentOS
- CentOS7安裝xrdpCentOS
- centos7 安裝rocketmqCentOSMQ
- centos7 安裝 rcloneCentOS
- centos7安裝mysqlCentOSMySql
- Centos7 安裝 NginxCentOSNginx
- centos7安裝nginxCentOSNginx