平博pinnacle平博pinnacle

平博pinnacle
平博在线

centos7通过yum安装nginx

centos7通过yum安装nginx

nginx不支持centos7通过yum直接安装~~~

1、查看操作系统位数[root@-jenkins ~]# rpm -aq|grep centos-releasecentos-release-7-4.1708.el7.centos.x86_64/

2、创建nginx的yum源[root@-jenkins ~]# cat  /etc/yum.repos.d/nginx.repo[nginx]name=nginx repobaseurl=http://nginx.org/packages/centos/7/x86_64/gpgcheck=0enabled=1注意:上面的x86_64改为你自己的操作系统位数。3、yum命令安装[root@-jenkins ~]# yum install -y nginx4、启动服务[root@-jenkins ~]# service nginx start或者[root@-jenkins ~]# systemctl start nginxRedirecting to /bin/systemctl start nginx.serviceYou have new mail in /var/spool/mail/root5、查看端口默认为80[root@-jenkins ~]# ss -lntp|grep 80LISTEN     0      128          *:80                       *:*                   users:(("nginx",pid=23806,fd=6),("nginx",pid=23805,fd=6))

6、发布路径

[root@-jenkins ~]#/usr/share/nginx/html/

访问: http://IP

 

欢迎阅读本文章: 杨睿

平博博彩公司

平博pinnacle