说明:
(1)本篇博客的主要内容是把项目部署到服务器上;
(2)本篇博客中的重点是:
? ? ? ? ? ●?程序打包;这儿是使用maven提供的命令来打包;然后,这儿是打成了jar包;
? ? ? ? ? ●?启动项目;
(3)声明:本篇博客中遇到的诸如,打包(包括打包方式,jar包还是war包等)、多配置文件的选取、项目的启动等内容;是有必要比较全面、深入的了解一下的;为此,自己后续的几篇博客对此进行了说明;
目录
1.程序打包:借助maven,把项目打成jar包;
2.把程序打成的jar包,在cmd命令行中,使用scp命令,上传到服务器;
3.在cmd命令行中,使用scp命令,把商品图片等图片资源,上传到服务器;?
4.确认,使用了8083的本项目,有没有启动:使用【lsof -i:端口号】,查看8083端口号,是否有应用占用;如果有,就清理掉,然后重启项目;
5.使用java命令,启动项目;?
6.访问项目;
1.程序打包:借助maven,把项目打成jar包;



说明:
(1)有关项目打包的问题,可以参考【附加:打包方式;(目前为止,遇到过的所有打包案例; 包括【eclipse || IDEA】、【非web项目 || web项目】、【使用maven || 没有使用Maven】)】;
2.把程序打成的jar包,在cmd命令行中,使用scp命令,上传到服务器;

3.在cmd命令行中,使用scp命令,把商品图片等图片资源,上传到服务器;?


……………………………………………………

……………………………………………………
然后,利用scp命令,把图片文件,上传到服务器;

……………………………………………………

4.确认,使用了8083的本项目,有没有启动:使用【lsof -i:端口号】,查看8083端口号,是否有应用占用;如果有,就清理掉,然后重启项目;

5.使用java命令,启动项目;?
nohup java -jar -Dserver.port=8083 -Dspring.profiles.active=prod /root/mall-0.0.1-SNAPSHOT.jar > /root/null 2>&1 &


6.访问项目;
前台地址:http://服务器ip:8083/#/index

……………………………………………………
后台地址:http://服务器ip:8083/admin/index.html#/

PS:他给的密码是错的;

所以,为了能够登录系统,自己向user表中,插入了一个密码是12345678的管理员用户;

这样一来,我们就可以使用:admin,12345678登录后台系统了;

这儿说明一下:前端的代码自己是没有的,然后前端是部署在其他地方的;

所以,这儿是不是这样的:(1)已知,我们在程序中,引入了一点前端的内容;(2)然后,程序启动后,我们访问这些前端文件;(3)但是,我们引入的这些前端文件,仅仅是前端的一个入口;(4)这些前端文件,会去调用前端所部署的服务器,进而可以调用前端所在的服务器,已展示前端的主体内容;? ? ? ?PS:不太确定是不是这样;但,感觉应该是;
|