nginx一键部署脚本
#!/bin/bash
#function: Centos7一键安装nginx
#author:999vip 20211117
yum -y install gcc gcc-c++ autoconf automake libtool make openssl openssl-devel pcre pcre-devel
cd /usr/local/src/
wget http://nginx.org/download/nginx-1.8.1.tar.gz
tar -zxvf nginx-1.8.1.tar.gz
cd nginx-1.8.1
./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre
make && make install
cd /usr/local/nginx
sed -i '14s/nginx/BDQN/' /usr/local/nginx/html/index.html
/usr/local/nginx/sbin/nginx
echo nginx部署完成,请测试web页面
echo 接下来将部署nfs并映射html,请确认是否继续
echo 键入任意值将继续操作,如需中断请按Ctrl+c
read a
yum install nfs-utils rpcbind -y
systemctl enable nfs
systemctl enable rpcbind
systemctl start nfs
systemctl start rpcbind
echo nfs服务安装完成,接下来将进行挂载操作
echo 键入任意值将继续操作,如需中断请按Ctrl+c
echo 请输入nfs服务器ip
read b
mount -t nfs $b:/app/file /usr/local/nginx/html/
#function: Centos7一键安装nginx
#author:999vip 20211117
yum -y install gcc gcc-c++ autoconf automake libtool make openssl openssl-devel pcre pcre-devel
cd /usr/local/src/
wget http://nginx.org/download/nginx-1.8.1.tar.gz
tar -zxvf nginx-1.8.1.tar.gz
cd nginx-1.8.1
./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre
make && make install
cd /usr/local/nginx
sed -i '14s/nginx/BDQN/' /usr/local/nginx/html/index.html
/usr/local/nginx/sbin/nginx
echo nginx部署完成,请测试web页面
echo 接下来将部署nfs并映射html,请确认是否继续
echo 键入任意值将继续操作,如需中断请按Ctrl+c
read a
yum install nfs-utils rpcbind -y
systemctl enable nfs
systemctl enable rpcbind
systemctl start nfs
systemctl start rpcbind
echo nfs服务安装完成,接下来将进行挂载操作
echo 键入任意值将继续操作,如需中断请按Ctrl+c
echo 请输入nfs服务器ip
read b
mount -t nfs $b:/app/file /usr/local/nginx/html/
上一技术:case防火墙
下一技术:redis一键部署脚本