1.安装tomcat,开机启动
◆ wget
http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.29/bin/apache-tomcat-8.5.29.tar.gz
◆ tar -zvxf
apache-tomcat-8.5.29.tar.gz
◆ centos7使用了systemd来管理服务,配置systemd服务;
vim /etc/systemd/system/tomcat.service
[unit]
Description=Apache Tomcat Web Application Container
After=network.target
[Service]
Type=forking
ExecStart=/home/hadoop/project/apache-tomcat-8.5.29/bin/startup.sh
ExecStop=/home/hadoop/project/apache-tomcat-8.5.29/bin/shutdown.sh
[Install]
WantedBy=multi-user.target
◆ 设为开机启动:systemctl enable tomcat;
◆ 启动tomcat:systemctl start tomcat;
◆ 查询当前tomcat的状态:systemctl status tomcat;
◆ 关闭tomcat:systemctl stop tomcat;
2.安装jenkins,开机启动
◆ 移动到tomcat/webapps目录下;
◆ 启动tomcat;
3.配置jenkins(创建python->django项目自动化部署)
◆ 第一次打开网址,需要输入密码(默认在/root/.jenkins/secrets/initialAdminPassword);
◆ 添加插件:svn;
◆ 新建任务;
4.原理图