15 Star 42 Fork 29

Spring / init_server

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
nginx.sh 691 Bytes
Copy Edit Web IDE Raw Blame History
廖师兄 authored 2020-01-06 02:41 . update nginx.sh.
#!/usr/bin/env bash
yum install -y zlib-devel openssl openssl-devel
wget http://nginx.org/download/nginx-1.16.1.tar.gz
tar zxvf nginx-1.16.1.tar.gz
cd nginx-1.16.1
./configure --prefix=/usr/local/nginx
make && make install
cd ..
rm -rf nginx-*
echo "export PATH=\$PATH:/usr/local/nginx/sbin" >> /etc/profile
source /etc/profile
nginx
#开机启动
cat > /usr/lib/systemd/system/nginxd.service <<EOF
[Unit]
Description=nginx
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s stop
PrivateTmp=true
[Install]
WantedBy=multi-user.target
EOF
systemctl enable nginxd.service

Comment ( 0 )

Sign in for post a comment

Shell
1
https://gitee.com/liaoshixiong/init_server.git
git@gitee.com:liaoshixiong/init_server.git
liaoshixiong
init_server
init_server
master

Search