国密部署脚本

在home下新建一个文件夹packages,将rpms、rpm_new、python2、python_tassl.tgz、gm_soft.conf、gm_prox上传到/root/packages目录下安装即可

#!/bin/bash

# 变量
OFFLINE_PATH=/home/packages
INSTALLED_PATH=/home/qw


function close_Firewall(){
	echo "-----------------------START-关闭防火墙--------------------------------"
	echo "防火墙关闭中..."
	systemctl stop firewalld.service
	systemctl disable firewalld.service
	echo "防火墙已关闭!"
	echo "-----------------------END-关闭防火墙----------------------------------"
}

function install_gm(){
	if [ ! -d "$INSTALLED_PATH" ]; then mkdir -p $INSTALLED_PATH;fi
	
	echo "-----------------------START-安装配置国密-----------------------------"
	echo "安装国密依赖中..."
	rpm -Uvh --force --nodeps $OFFLINE_PATH/rpms/*.rpm
	rpm -Uvh --force --nodeps $OFFLINE_PATH/rpm_new/*.rpm
	echo "安装完毕!"
	
	echo "如下输出包含openssl:/usr/lib64/openssl /usr/include/openssl则表明openssl安装成功)"
	whereis openssl
	
	echo "安装国密中..."
	tar -xvf $OFFLINE_PATH/python_tassl.tgz -C /
	cd /root/nginx_phpMultiVersionIMG
	source install_nginx+php-1.16.1.sh
	source /alidata/server/nginx/sbin/setting
	mv /alidata/server/nginx/conf/vhosts/gm_card.conf /alidata/server/nginx/conf/vhosts/gm_card
	echo "安装完毕!"
	
	echo "配置国密服务端中..."
	source /alidata/server/nginx/sbin/setting
	mv /alidata/server/nginx/conf/vhosts/gm_soft.conf /alidata/server/nginx/conf/vhosts/gm_soft.conf.bak
	cp $OFFLINE_PATH/gm_soft.conf /alidata/server/nginx/conf/vhosts/gm_soft.conf
	echo "配置完毕!"
	
	echo "启动国密服务端中..."
	nohup /alidata/server/nginx/sbin/nginx &>/dev/null
	echo "国密服务端已启动!"
	
	echo "可使用命令(ps -aux | grep nginx)查看国密服务端状态"
	
	echo "安装国密客户端依赖中..."
	source /alidata/server/nginx/sbin/setting
	cd $OFFLINE_PATH/python2
	cp requirements.txt packages/
	cd packages
	/usr/local/Python-2.7.17/bin/pip install --no-index --find-links=file:./ -r requirements.txt
	echo "安装完毕!"
	
	echo "启动国密客户端中..."
	cp -r $OFFLINE_PATH/gm_prox $INSTALLED_PATH/gm_prox
	cd $INSTALLED_PATH/gm_prox
	nohup /usr/local/Python-2.7.17/bin/gunicorn -w 4 -b 0.0.0.0:2879 manage:app &
	echo "启动国密客户端已启动!"
	echo "-----------------------END-安装配置国密-------------------------------"
}


# 调用函数执行安装
#close_Firewall
install_gm

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值