SpringBoot打War包上传到阿里云的LINUX服务器的操作方法
作者:听惊雷 时间:2021-09-26 22:27:01
下面的每一步应该都必不可少:
1、启动类
继承这个类,并且重新configure这个方法,return builder.sources(Code007Application.class);
2、pom
跳过测试打包会比较方便
<build>
<finalName>code007</finalName> //这里为你打包后的war包的名字
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork><!--必须添加这个配置-->
</configuration>
</plugin>
</plugins>
</build>
然后把数据库,yml里面的都对应好Linux服务器的路径,就差不多了
yml示例:
然后:
Linux服务器上的操作:
package后就打包好了,然后到项目里的target文件下找到,上传到Linux服务器的tomcat的webapps文件下
如图:
然后到tomcat的conf文件下找到server.xml
打开修改:
在host节点加上这个:<Context path="/" docBase="/home/tomcat/apache-tomcat-8.5.45/webapps/code007" debug="0" reloadable="true"/>
这里
这两个应该要对应好
然后启动tomcat,域名或者ip地址就可以直接访问项目的首页了
总结
以上所述是小编给大家介绍的SpringBoot打War包上传到阿里云的LINUX服务器的操作方法,希望对大家有所帮助!
来源:https://www.cnblogs.com/share-record/archive/2020/02/07/12272689.html
标签:springboot,war包,上传
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
SpringBoot使用注解进行分页的实现示例
2021-08-21 22:45:32
![](https://img.aspxhome.com/file/2023/3/75473_0s.jpg)
java中的常用集合类整理
2022-08-22 10:35:49
简单了解Java编程中线程的创建与守护线程
2023-11-25 06:59:52
浅谈Java中各种修饰符与访问修饰符的说明
2022-10-07 00:49:52
JDK源码之PriorityQueue解析
2022-05-15 17:17:15
![](https://img.aspxhome.com/file/2023/1/63741_0s.png)
基于java构造方法Vector遍历元素源码分析
2023-11-25 05:21:40
C#使用RabbitMq队列(Sample,Work,Fanout,Direct等模式的简单使用)
2023-12-06 10:45:34
![](https://img.aspxhome.com/file/2023/2/83302_0s.png)
一文搞懂SpringBoot如何利用@Async实现异步调用
2022-02-06 12:39:27
![](https://img.aspxhome.com/file/2023/6/63846_0s.png)
SWT(JFace)体验之打开多个Form
2021-11-29 03:19:15
值得Java开发者关注的7款新工具
2023-11-02 23:05:31
![](https://img.aspxhome.com/file/2023/2/58862_0s.jpg)
MyBatis基础支持DataSource实现源码解析
2023-01-16 09:58:07
Java正则验证正整数的方法分析【测试可用】
2022-08-02 21:50:05
![](https://img.aspxhome.com/file/2023/9/66229_0s.jpg)
微信js-sdk+JAVA实现“分享到朋友圈”和“发送给朋友”功能详解
2021-10-20 23:13:51
Java开发中synchronized的定义及用法详解
2021-11-11 07:01:20
![](https://img.aspxhome.com/file/2023/6/62226_0s.png)
Java面向对象基础知识之委托和lambda
2022-07-28 16:51:11
Java使用RedisTemplate如何根据前缀获取key列表
2023-03-05 01:50:40
![](https://img.aspxhome.com/file/2023/9/78909_0s.png)
Springboot启动不检查JPA的数据源配置方式
2022-10-10 06:47:05
![](https://img.aspxhome.com/file/2023/4/68774_0s.jpg)
Spring如何基于注解配置使用ehcache
2022-08-16 03:24:32
@CacheEvict 清除多个key的实现方式
2023-11-21 08:28:04
SpringBoot响应处理之以Json数据返回的实现方法
2023-12-21 12:21:47
![](https://img.aspxhome.com/file/2023/8/61638_0s.png)