标签:stat 依赖 下载 get centos 7 lib 装包 listen oca
1、安装依赖组件2、 下载安装包
wget https://nginx.org/download/nginx-1.16.0.tar.gz
3、编译安装
tar zxvf nginx-1.16.0.tar.gz
cd nginx-1.16.0
./configure --prefix=/usr/local/nginx
make && make install
4、启动nginx服务
cd /usr/local/nginx/sbin
./nginx
5、验证服务是否启动成功
[root@localhost sbin]# netstat -ntlp | grep nginx
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 130245/nginx: master
6、添加nginx服务
vi /lib/systemd/system/nginx.service
文件内容:
[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 quit
PrivateTmp=true
[Install]
WantedBy=multi-user.target*
7、使用systemd管理
pkill nginx
systemctl start nginx
systemctl status nginx
centos 7.5 1804编译安装nginx 1.16.0
标签:stat 依赖 下载 get centos 7 lib 装包 listen oca
原文地址:https://blog.51cto.com/11058442/2475823