卸载nginx
- 首先输入命令
ps -ef | grep nginx
检查一下nginx服务是否在运行。如果在运行就停止运行,需要在nginx的安装目录下的sbin执行,如果配置了环境就不需要了:
./nginx -s stop
- 查找、删除Nginx相关文件
whereis nginx

find / -name nginx

rm -rf /usr/local/nginx /usr/local/sbin/nginx /usr/local/nginx-1.13.9/objs/nginx
- 再使用yum清理
yum remove nginx
安装nginx
rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum install -y nginx
systemctl start nginx.service
systemctl enable nginx.service
- nginx的配置文件在/etc/nginx/nginx.conf,目录在/etc/nginx


- 自定义的配置文件放在/etc/nginx/conf.d
- 项目文件存放在/usr/share/nginx/html/
- 日志文件存放在/var/log/nginx/
- 还有一些其他的安装文件都在/etc/nginx
- 安装完成之后就可以访问:
