SSM 项目从搭建爬坑到 CentOS 服务器部署 - 速查手册

SSM 项目从搭建爬坑到 CentOS 服务器部署 - 速查手册

提示:
(1)CSDN 博客左边有操作工具条上有文章目录
(2)SSM 指 Spring,Spring MVC,MyBatis

SSM 项目搭建

(1)按照博客详细操作(含查询实例):

(2)使用我的 Github 模板(含查询实例):

Maven 的 pom.xml 配置合集

提示: 如果想查看当前最新版本,可以拷贝 xml 注解中的链接

基础配置:

fastjson 1.2.54
spring-webmvc 5.1.4
spring-jdbc 5.1.4
mybatis 3.4.6
mybatis-spring 1.3.2
mysql-connector-java 8.0.13

    <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
    <dependency>
      <groupId>com.alibaba</groupId>
      <artifactId>fastjson</artifactId>
      <version>1.2.54</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc -->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
      <version>5.1.4.RELEASE</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
      <version>5.1.4.RELEASE</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
    <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis</artifactId>
      <version>3.4.6</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
    <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis-spring</artifactId>
      <version>1.3.2</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>8.0.13</version>
    </dependency>

其他扩展:

javax.servlet-api 4.0.1
commons-email 1.5
commons-fileupload 1.4
druid 1.1.12
junit 4.11

<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>4.0.1</version>
            <scope>provided</scope>
        </dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-email -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-email</artifactId>
            <version>1.5</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload -->
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>1.4</version>
        </dependency>
    <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>    

CentOS 云服务器环境搭建

(1)CentOS 云服务器从购买到 JDK,Tomcat 及 MySQL 安装及环境配置

(2)CentOS 云服务器安装 MySQL 8.0 及使用(所有的坑我走了一遍)

(3)xftp 介绍与安装步骤(提供安装包)

(4)XShell 6 中文破解版安装(免费提供安装包)

CentOS 云服务器上部署 SSM 项目

(1)数据库复制(建议使用 Navicat 12 可以直接连接),如果是在本机的数据库需要连接服务器的数据库进行同样的搭建,转出 SQL,在服务器新建数据库,运行 SQL

(2)将 resources 中 jdbc.url 中的 localhost 改成服务器公网 ip

(3)将项目打包成 war 的形式,拷贝到 Tomcat 根目录/webapps 目录下

提示:

  • war 不需要解压,Tomcat 在运行时会自动检测,自动解压。Tomcat 运行的时候部署 war 时不能删除 war 包,会同时删除。
  • 如果不想要 war 包,可以先关闭 Tomcat,再拷贝进去,手动解压
  • war 的名称可以修改,但是在访问的时候要用新改名称的作为路径

(4)访问路径(自动匹配 index.html 的方式):

http://公网ip:8080/war包解压后的目录名/

加载自定义包下的 Mapper.xml 文件的一些问题

MyBatis 实现模糊查询 *Mapper.xml 的几种配置方式

JAVA 实现 QQ 邮箱发送验证码功能

Java 后台实现 发送手机短信的功能(中国网建)

IDEA 项目部署运行后,弹框:Windows找不到文件 ‘C:\Users\Administrator…Chrome.ink’

IDEA 中读取 properties 文件中文乱码

IDEA Maven 项目中 dependencies 红色波浪线

IDEA 项目 web.xml 中 Servlet 配置红色波浪线报错:cannot resolve servlet ‘springmvc’

Linux 下 MySQL 8.0 忘记密码找回流程(8.0 版本没有 password)

Navicat Premium 12.1.16.0 安装与激活(图文教程)

PyCharm & IDEA & WebStorm 通用激活破解方法(2019更新)

JAVA 开发与 IDEA 使用爬坑记录

一键加入 QQ 技术朋友群

  • 2
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

肖朋伟

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值