centos nginx 源代码安装

1、下载依赖库

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

2、检查nginx 版本

nginx -v

3、nginx 命令

启动nginx服务
systemctl start nginx.service

设置开机自启动
systemctl enable nginx.service

停止开机自启动
systemctl disable nginx.service

查看服务当前状态
systemctl status nginx.service

重新启动服务
systemctl restart nginx.service

查看所有已启动的服务
systemctl list-units --type=service

4、查看nginx进程

ps -ef | grep nginx

默认的根目录
/usr/share/nginx/html

5、修改配置文件

vim /etc/nginx/conf.d/default.conf

6、卸载

yum remove nginx
发布了94 篇原创文章 · 获赞 119 · 访问量 68万+

猜你喜欢

转载自blog.csdn.net/haifengid/article/details/102732445