centos6.x中yum安装nginx

今天装了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.com
base                                                                                                          | 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.rpm
Retrieving http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
warning: /var/tmp/rpm-tmp.EeFe3z: Header V4 RSA/SHA1 Signature,key ID 7bd9bf62: NOKEY
Preparing...                ########################################### [100%]
   1:nginx-release-centos   ########################################### [100%]

2、查看yum的nginx信息:

[root@localhost ~]# yum info nginx
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * extras: mirrors.yun-idc.com
 * updates: mirrors.yun-idc.com
nginx                                                                                                         | 2.9 kB     00:00     
nginx/primary_db                                                                                              |  15 kB     00:00     
可安装的软件包
Name        : nginx
Arch        : x86_64
Version     : 1.10.1
Release     : 1.el6.ngx
Size        : 821 k
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、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 k
Installed 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 k
Installed 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、访问日志按日期分割

相关文章

文章浏览阅读903次。4.清除缓存目录(/var/cache/yum)下的软件...
文章浏览阅读1.5k次。Python 是一种高级解释性编程语言,已被...
文章浏览阅读2.6k次。打开终端或控制台,以root或具有sudo权...
文章浏览阅读744次,点赞24次,收藏26次。目标:通过AppSrv为...
文章浏览阅读1.1w次,点赞8次,收藏26次。chmod命令来自于英...
文章浏览阅读1.2k次。yum源的URL地址,本例中是文件系统的路...