标签:star 安装nginx dev centos 自带 move eve load ges
# 1.Centos7中添加nginx源
>>> rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
# pip 安装
>>> pip install nginx
# 1.安装nginx依赖包
>>> yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
>>> yum install gcc gcc-c++ make libtool -y
# 2.创建nginxmulu
>>> cd /etc
>>> mkdir nginx
>>> cd nginx
# 3.下载nginx安装包:http://nginx.org/en/download.html
>>> wget http://nginx.org/download/nginx-1.13.7.tar.gz
>>> tar -xvf nginx-1.13.7.tar.g
# 4.安装nginx
>>> cd /etc/nginx
>>> ./configure
>>> make && make install
# 1. 添加ngnx配置文件(yum安装)
>>> cd /etc/nginx/conf.d/
>>> t
# 2. 修改配置文件
>>> vim /etc/nginx/conf/nginx.conf
# 启动
/usr/sbin/nginx
# 关闭
/usr/sbin/nginx -s stop
# 重启
/usr/sbin/nginx -s reload
# 开机自启
systemctl start nginx.service
systemctl enable nginx.service
yum remove nginx
# 1.查看nginx安装目录
>>> whereis nginx
nginx: /usr/sbin/nginx
# 2.删除nginx自启动
>>> chkconfig nginx off
# 3.停止nginx服务
>>> /usr/sbin/nginx -s stop
# 4.删除nginx安装目录
>>> rm -rf /etc/nginx
# 5.检查是否有残余
>>> find / -name nginx
/usr/libexec/initscripts/legacy-actions/nginx
>>> rm -ef /usr/libexec/initscripts/legacy-actions/
标签:star 安装nginx dev centos 自带 move eve load ges
原文地址:https://www.cnblogs.com/bbiu/p/11693239.html