美文网首页vue前端技术分享
CentOS 7下安装部署 Nginx

CentOS 7下安装部署 Nginx

作者: 行走的巨象 | 来源:发表于2017-11-24 15:52 被阅读3次

一、开始安装,输入命令
wget http://dl.Fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm
yum install nginx -y
查看确认 是否安装
[root@localhost ~]# rpm -qa | grep nginx
nginx-1.10.2-1.el7.x86_64
nginx-mod-stream-1.10.2-1.el7.x86_64
nginx-mod-http-geoip-1.10.2-1.el7.x86_64
nginx-all-modules-1.10.2-1.el7.noarch
nginx-mod-http-perl-1.10.2-1.el7.x86_64
nginx-mod-http-image-filter-1.10.2-1.el7.x86_64
nginx-mod-mail-1.10.2-1.el7.x86_64
nginx-filesystem-1.10.2-1.el7.noarch
nginx-mod-http-xslt-filter-1.10.2-1.el7.x86_64

二、测试nginx
启动nginx
systemctl start nginx

设置开机启动
systemctl enable nginx

查看nginx 启动状态
systemctl status nginx

查看是否监听

ss -tnl | grep 80
LISTEN 0 128 :80 :
LISTEN 0 128 :::80 :::

测试 nginx
在浏览器中输入 nginx 服务器的ip 地址

安装成功
默认文件安装地址/usr/share/nginx/html/

以上摘抄自http://www.linuxidc.com/Linux/2017-04/142986.htm

相关文章

网友评论

    本文标题:CentOS 7下安装部署 Nginx

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