Linux下nginx安装

  • 下载对应当前系统版本的nginx包

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

  • 建立nginx的yum仓库(默认yum是没有nginx的)

rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm

  • 下载并安装nginx

yum install -y nginx

启动nginx服务

  • 启动nginx服务

systemctl start nginx.service

  • 查看启动状态

systemctl status nginx
看到以下字眼说明启动成功!
​Active: active (running) since 六 2016-11-19 13:40:04 CST; 50min ago

你可能感兴趣的:(Linux下nginx安装)