centos6.x中yum安装nginx

来源:互联网 发布:淘宝分享有礼在哪找 编辑:程序博客网 时间:2024/06/06 03:17

今天装了CentOS6.7,直接yum install nginx不行,错误如下:

[root@localhost ~]# yum install nginx已加载插件:fastestmirror设置安装进程Loading mirror speeds from cached hostfile * base: mirror.bit.edu.cn * extras: mirrors.yun-idc.com * updates: mirrors.yun-idc.combase                                                                                                          | 3.7 kB     00:00     extras                                                                                                        | 3.4 kB     00:00     updates                                                                                                       | 3.4 kB     00:00     No package nginx available.错误:无须任何处理

1、首先处理下源,下面是安装完整流程,也十分简单:

[root@localhost ~]# rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpmRetrieving http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpmwarning: /var/tmp/rpm-tmp.EeFe3z: Header V4 RSA/SHA1 Signature, key ID 7bd9bf62: NOKEYPreparing...                ########################################### [100%]   1:nginx-release-centos   ########################################### [100%]

2、查看yum的nginx信息:

[root@localhost ~]# yum info nginx已加载插件:fastestmirrorLoading mirror speeds from cached hostfile * base: mirror.bit.edu.cn * extras: mirrors.yun-idc.com * updates: mirrors.yun-idc.comnginx                                                                                                         | 2.9 kB     00:00     nginx/primary_db                                                                                              |  15 kB     00:00     可安装的软件包Name        : nginxArch        : x86_64Version     : 1.10.1Release     : 1.el6.ngxSize        : 821 kRepo        : nginxSummary     : High performance web serverURL         : http://nginx.org/License     : 2-clause BSD-like licenseDescription : nginx [engine x] is an HTTP and reverse proxy server, as well as            : a mail proxy server.

3、yum install nginx安装

[root@localhost ~]# yum install nginx已加载插件:fastestmirror设置安装进程Loading mirror speeds from cached hostfile * base: mirror.bit.edu.cn * extras: mirrors.yun-idc.com * updates: mirrors.yun-idc.com解决依赖关系--> 执行事务检查---> Package nginx.x86_64 0:1.10.1-1.el6.ngx will be 安装--> 完成依赖关系计算依赖关系解决===================================================================================================================================== 软件包                      架构                         版本                                     仓库                         大小=====================================================================================================================================正在安装: nginx                       x86_64                       1.10.1-1.el6.ngx                         nginx                       821 k事务概要=====================================================================================================================================Install       1 Package(s)总下载量:821 kInstalled size: 2.1 M确定吗?[y/N]:y^H^[[3~^C在用户的命令下退出Your transaction was saved, rerun it with: yum load-transaction /tmp/yum_save_tx-2016-06-14-12-56K4938y.yumtx[root@localhost ~]# yum install nginx已加载插件:fastestmirror设置安装进程Loading mirror speeds from cached hostfile * base: mirror.bit.edu.cn * extras: mirrors.yun-idc.com * updates: mirrors.yun-idc.com解决依赖关系--> 执行事务检查---> Package nginx.x86_64 0:1.10.1-1.el6.ngx will be 安装--> 完成依赖关系计算依赖关系解决===================================================================================================================================== 软件包                      架构                         版本                                     仓库                         大小=====================================================================================================================================正在安装: nginx                       x86_64                       1.10.1-1.el6.ngx                         nginx                       821 k事务概要=====================================================================================================================================Install       1 Package(s)总下载量:821 kInstalled size: 2.1 M确定吗?[y/N]:y下载软件包:nginx-1.10.1-1.el6.ngx.x86_64.rpm                                                                             | 821 kB     00:00     运行 rpm_check_debug 执行事务测试事务测试成功执行事务Warning: RPMDB altered outside of yum.  正在安装   : nginx-1.10.1-1.el6.ngx.x86_64                                                                                     1/1 ----------------------------------------------------------------------Thanks for using nginx!Please find the official documentation for nginx here:* http://nginx.org/en/docs/Commercial subscriptions for nginx are available on:* http://nginx.com/products/----------------------------------------------------------------------  Verifying  : nginx-1.10.1-1.el6.ngx.x86_64                                                                                     1/1 已安装:  nginx.x86_64 0:1.10.1-1.el6.ngx                                                                                                    完毕!

4、运行启动

[root@localhost ~]# service nginx start正在启动 nginx:                                           [确定][root@localhost ~]# 

5、访问,在地址栏输入http://ip

这里写图片描述

6、访问日志按日期分割

0 0
原创粉丝点击