tomcat
见阿里云 ECS+CADDY+TOMCAT+MYSQL 搭建 SOLO 博客
准备
- 安装 maven
apt-get install maven
- 安装 git
apt-get install maven
- 克隆项目
mkdir ~/priject cd ~/priject/ git clone https://github.com/b3log/solo.git
- 备份配置
cd solo src/main/resources/local.properties ~/priject/previous/resources/ src/main/resources/latke.properties ~/priject/previous/resources/
部署
- 更新代码
cd ~/priject/solo git stash git pull
- 打包
cp ~/priject/previous/resources/* src/main/resources/ mvn package
- 发布
mv ~/priject/previous/solo/* /tmp mv /opt/tomcat/webapps/solo/* ~/priject/previous/solo/ mv target/solo.war /opt/tomcat/webapps/solo/ cd /opt/tomcat/webapps/solo/ chown -R tomcat:tomcat solo.war jar -xvf solo.war
- 重启 tomcat
systemctl restart tomcat
自动
打开 vim /etc/crontab
添加
30 2 * * 1 root cd /root/priject && ./deploy.sh
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于