官术网_书友最值得收藏!

Deploying the Spring Boot application

To deploy the Spring Boot application, you need to have knowledge of MVN and Tomcat servlets. MVN will be used for building the Web Application Resource or the Web Application Archive (WAR) file, and Apache Tomcat is our application server. Let's see how we can install the Spring Boot application in the application servers:

# Download Tomcat 9.0.13 latest version using below commands:

PacktPub$ curl -O http://www-us.apache.org/dist/tomcat/tomcat-9/v9.0.13/bin/apache-tomcat-9.0.13.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9112k 100 9112k 0 0 799k 0 0:00:11 0:00:11 --:--:-- 1348k

# Extract it and provide sufficient permissions.

$ tar -xvzf apache-tomcat-9.0.13.tar.gz

# Maven clean and package everything into a WAR file.

$ mvn clean package

# Copy WAR created by MVN to Tomcat/webapp, we are renaming WAR to springbootcode.war

$ cp target/PacktPub-spring-boot-example.war apache-tomcat-9.0.13/webapps/springbootcode.war

# Start Tomcat like below

$ ./apache-tomcat-9.0.13/bin/startup.sh
Using CATALINA_BASE: /Users/springbootcode/projects/PacktPub-spring-boot-example/apache-tomcat-9.0.13
Using CATALINA_HOME: /Users/springbootcode/projects/PacktPub-spring-boot-example/apache-tomcat-9.0.13
Using CATALINA_TMPDIR: /Users/springbootcode/projects/PacktPub-spring-boot-example/apache-tomcat-9.0.13/temp
Using JRE_HOME: /Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home
Using CLASSPATH: /Users/springbootcode/projects/PacktPub-spring-boot-example/apache-tomcat-9.0.13/bin/bootstrap.jar:
/Users/springbootcode/projects/PacktPub-spring-boot-example/apache-tomcat-9.0.13/bin/tomcat-juli.jar
Tomcat started.
主站蜘蛛池模板: 浮山县| 桐柏县| 沾益县| 镇康县| 宝丰县| 铜梁县| 南靖县| 马尔康县| 阿拉善右旗| 洪泽县| 余江县| 井冈山市| 基隆市| 射阳县| 荆门市| 墨竹工卡县| 宁波市| 靖边县| 华阴市| 合肥市| 台前县| 建宁县| 四川省| 轮台县| 昌宁县| 深泽县| 鹿邑县| 临江市| 安阳市| 东乡族自治县| 射阳县| 荥经县| 定州市| 兰州市| 芜湖市| 龙山县| 沈丘县| 桐庐县| 潍坊市| 鹿泉市| 米脂县|