黑帽联盟

 找回密码
 会员注册
查看: 1973|回复: 0

[基础服务] centos服务器下yum安装nginx

[复制链接]

908

主题

38

听众

3382

积分

管理员

Rank: 9Rank: 9Rank: 9

  • TA的每日心情
    难过
    6 天前
  • 签到天数: 1704 天

    [LV.Master]伴坛终老

    Ubuntu下安装nginx,直接apt-get install nginx就行了,很方便。

    但是今天装了CentOS6.5,直接yum install nginx不行,要先处理下源,下面是安装完整流程,也十分简单:
    1、CentOS 6,先执行:

    2,查看yum的nginx信息
    Loaded plugins: fastestmirror, refresh-packagekit
    Loading mirror speeds from cached hostfile
    * base: mirrors.cn99.com
    * extras: mirrors.cn99.com
    * updates: mirrors.cn99.com
    Installed Packages
    Name        : nginx
    Arch        : x86_64
    Version     : 1.10.2
    Release     : 1.el6.ngx
    Size        : 2.1 M
    Repo        : installed
    From repo   : nginx
    Summary     : High performance web server
    URL         : http://nginx.org/
    License     : 2-clause BSD-like license
    Description : nginx [engine x] is an HTTP and reverse proxy server, as well as
                : a mail proxy server.

    3,安装并启动nignx
    [root@server ~]# yum install nginx
    [root@server ~]# service nginx start
    Starting nginx:                                            [  OK  ]

    4,然后进入浏览器,输入http://192.168.129.128/测试,如果看到

    nginx安装

    nginx安装


    恭喜你,你成功了!

    如果不能连接到nginx,原因很多,但是可以先检查 1,nginx服务是否真的起来了;2,linux服务器防火墙是否打开;3,selinux有没有关闭

    您需要登录后才可以回帖 登录 | 会员注册

    发布主题 !fastreply! 收藏帖子 返回列表 搜索
    回顶部