feat: 增加nginx安装,去除dlhl

main
huangfeng 1 year ago
parent 586747ce8c
commit 8c0aa222f3

Binary file not shown.

@ -1,14 +1,20 @@
### 安装根目录 ### ### 安装根目录 ###
BASE_DIR=/home/xydl BASE_DIR=/home/xydl
### 数据库配置 ### ### 数据库配置 ###
DB_IP=127.0.0.1 DB_IP=127.0.0.1
DB_PORT=3306 DB_PORT=3306
DB_INS=cacdb DB_INS=cacdb
DB_USER=root DB_USER=root
DB_PASS=123456 DB_PASS=123456
### Redis的密码 ###
REDIS_PASS=123456
### 是否安装自带的Redis ###
REDIS_INS=1
### 是否加入开机启动 ### ### 是否加入开机启动 ###
AUTO_START=1 AUTO_START=1
### 是否安装自带的Nginx ###
NGINX_INS=0
### 是否安装自带的Redis ###
REDIS_INS=0
### Redis的密码 ###
REDIS_PASS=123456

@ -32,13 +32,35 @@ installJDK(){
source /etc/profile source /etc/profile
fi fi
else else
echo ${JDK_HOME}" found, 跳过." echo ${JDK_HOME}" found, 跳过JDK."
fi fi
JAVA_PATH=${JDK_HOME}/bin/java JAVA_PATH=${JDK_HOME}/bin/java
echo "" echo ""
sleep 1 sleep 1
} }
#################### 安装Nginx ################################################
installNginx(){
echo "************[prepare to install Nginx]准备开始装Nginx >>>>>>>>>>>>>"
NGX_HOME=${BASE_DIR}/nginx
if [ ! -d ${NGX_HOME} ]; then
tar -zxf package/nginx.tar.gz -C ${BASE_DIR}
echo ${NGX_HOME}" installed."
cp package/cac.conf ${NGX_HOME}/conf.d/
sed -i 's#/etc/nginx#'${NGX_HOME}'#g' ${NGX_HOME}/conf/nginx.conf
sed -i 's#static#'${CAC_DIR}'/static#g' ${NGX_HOME}/conf.d/cac.conf
echo ${NGX_HOME}'/sbin/nginx -c '${NGX_HOME}'/conf/nginx.conf' > ${BIN_DIR}/startNginx.sh
echo ${NGX_HOME}'/sbin/nginx -s stop' > ${BIN_DIR}/stopNginx.sh
chmod +x ${BIN_DIR}/startNginx.sh
chmod +x ${BIN_DIR}/stopNginx.sh
else
echo ${NGX_HOME}" found, 跳过Nginx."
fi
echo ""
sleep 1
}
#################### 安装Redis ################################################ #################### 安装Redis ################################################
installRedis(){ installRedis(){
echo "************[prepare to install Redis]准备开始安装Redis >>>>>>>>>>>>>" echo "************[prepare to install Redis]准备开始安装Redis >>>>>>>>>>>>>"
@ -63,7 +85,7 @@ installRedis(){
chmod +x ${BIN_DIR}/startRedis.sh chmod +x ${BIN_DIR}/startRedis.sh
chmod +x ${BIN_DIR}/stopRedis.sh chmod +x ${BIN_DIR}/stopRedis.sh
else else
echo ${REDIS_HOME}" found, 跳过." echo ${REDIS_HOME}" found, 跳过Redis."
fi fi
echo "" echo ""
sleep 1 sleep 1
@ -150,15 +172,27 @@ installDLHL(){
setAutoStartCac(){ setAutoStartCac(){
if [ `grep -c ${BIN_DIR}/startCac.sh /etc/rc.d/rc.local` -eq '0' ]; then if [ `grep -c ${BIN_DIR}/startCac.sh /etc/rc.d/rc.local` -eq '0' ]; then
echo '#NewCAC' >> /etc/rc.d/rc.local echo '#NewCAC' >> /etc/rc.d/rc.local
if [ $REDIS_INS == 1 ]; then
echo ${BIN_DIR}/startRedis.sh >> /etc/rc.d/rc.local
fi
echo ${BIN_DIR}/startCac.sh >> /etc/rc.d/rc.local echo ${BIN_DIR}/startCac.sh >> /etc/rc.d/rc.local
echo ${BIN_DIR}/startDlhl.sh >> /etc/rc.d/rc.local
fi fi
echo "CAC已加入开机启动." echo "CAC已加入开机启动."
echo "" echo ""
} }
setAutoStartRedis(){
if [ `grep -c ${BIN_DIR}/startRedis.sh /etc/rc.d/rc.local` -eq '0' ]; then
echo '#Redis' >> /etc/rc.d/rc.local
echo ${BIN_DIR}/startRedis.sh >> /etc/rc.d/rc.local
fi
echo "Redis已加入开机启动."
echo ""
}
setAutoStartNginx(){
if [ `grep -c ${BIN_DIR}/startNginx.sh /etc/rc.d/rc.local` -eq '0' ]; then
echo '#Nginx' >> /etc/rc.d/rc.local
echo ${BIN_DIR}/startNginx.sh >> /etc/rc.d/rc.local
fi
echo "Nginx已加入开机启动."
echo ""
}
@ -174,22 +208,28 @@ DLHL_DIR=${BASE_DIR}/dlhl
### 创建默认的目录 ### 创建默认的目录
mkdir -p ${BIN_DIR} mkdir -p ${BIN_DIR}
mkdir -p ${CAC_DIR} mkdir -p ${CAC_DIR}
mkdir -p ${DLHL_DIR}
if [ $JDK_INS == 1 ]; then if [ $JDK_INS == 1 ]; then
installJDK installJDK
else
echo ${JAVA_PATH}" found, 跳过JDK."
fi fi
if [ $REDIS_INS == 1 ]; then if [ $REDIS_INS == 1 ]; then
installRedis installRedis
setAutoStartRedis
fi fi
installNewCAC installNewCAC
installDLHL
if [ $AUTO_START == 1 ]; then if [ $AUTO_START == 1 ]; then
setAutoStartCac setAutoStartCac
fi fi
if [ $NGINX_INS == 1 ]; then
installNginx
setAutoStartNginx
fi
echo "************[install finished.]安装完成. >>>>>>>>>>>>>" echo "************[install finished.]安装完成. >>>>>>>>>>>>>"
sleep 1 sleep 1

Loading…
Cancel
Save