ps -ef | grep nginx
检查一下nginx服务是否在运行。如果在运行就停止运行,需要在nginx的安装目录下的sbin执行,如果配置了环境就不需要了:./nginx -s stop
whereis nginx
find / -name nginx
rm -rf /usr/local/nginx /usr/local/sbin/nginx /usr/local/nginx-1.13.9/objs/nginx
yum remove 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
安装完成之后就可以访问:
比较之前的源码编译安装配置文件都相对分散一些,不容易找到,所以安装的时候还是源码编译安装比较好。编译安装:https://blog.csdn.net/qq_41684621/article/details/101900843