《无与伦比》Centos7 安装nginx

  1. #添加CentOS 7 Nginx yum资源库

rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

  1. #使用命令直接安装

yum install nginx

service nginx start

service nginx stop

service nginx reload

//查看进程apache/httpd

ps -ef | grep nginx

//查看服务端口

netstat -anpl | grep 'nginx'

// rpm方式升级并安装某个版本的Nginx

rpm -Uvh http://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.18.0-1.el7.ngx.x86_64.rpm

  1. #配置文件路径

/etc/nginx

  1. #启动,直接nginx即可

  2. 报错:nginx: [error] open() "/var/run/nginx.pid" failed (2: No such file or directory)

cd /usr/local/sbin

nginx

  1. centos卸载nginx

  2. 停止服务

systemctl stop nginx

  1. 删除find查找到的目录

rm -rf /etc/logrotate.d/nginx

rm -rf /etc/nginx

rm -rf /var/lib/nginx

rm -rf /var/log/nginx

rm -rf /usr/sbin/nginx

rm -rf /usr/lib64/nginx

rm -rf /usr/share/nginx

  1. yum清理nginx

yum remove -y nginx

相关推荐
dessler10 分钟前
RabbitMQ-日常运维命令
linux·运维·rabbitmq
samson_www11 分钟前
Debian系统更新实现
运维·debian
要长脑子了95628 分钟前
【论坛系统自动化功能测试报告】
运维·python·功能测试·selenium·pycharm·自动化·模块测试
苹果醋31 小时前
react_05create-react-app脚手架详细解析(export)
java·运维·spring boot·mysql·nginx
G_H_S_3_1 小时前
【网络运维】Linux:简单DHCP服务器的部署
linux·运维·服务器·网络
William.csj7 小时前
服务器——“查询不到显卡驱动,且输入nvidia-smi报错”的解决办法
运维·服务器
LgZhu(Yanker)7 小时前
27、企业维修保养(M&R)全流程管理:从预防性维护到智能运维的进阶之路
大数据·运维·人工智能·erp·设备·维修·保养
sheji1057 小时前
docker启动出现Error response from daemon: Container的问题【已解决】
运维·docker·容器
Sally璐璐10 小时前
LVS-DR模式高性能负载均衡实战
运维
路由侠内网穿透10 小时前
本地部署 SQLite 数据库管理工具 SQLite Browser ( Web ) 并实现外部访问
运维·服务器·开发语言·前端·数据库·sqlite