美文网首页
CentOS 7 下安装 Nginx

CentOS 7 下安装 Nginx

作者: lancely | 来源:发表于2018-01-11 16:13 被阅读5次

一、通过 yum 方式安装

安装 nginx 源

官网下载对应系统的 rpm 文件安装。

shell> wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
shell> yum localinstall nginx-release-centos-7-0.el7.ngx.noarch.rpm

安装并启动 Nginx

安装 nginx,查看版本号信息

shell> yum install nginx
shell> nginx -v

启动 nginx 服务,用 curl 命令访问一次查看是否启动成功

shell> systemctl start nginx
shell> curl localhost

设置开机启动

shell> systemctl enable nginx
# 重载所有修改过的配置文件
shell> systemctl daemon-reload

二、源码安装

待更新

相关文章

网友评论

      本文标题:CentOS 7 下安装 Nginx

      本文链接:https://www.haomeiwen.com/subject/okqtoxtx.html