在CentOS 上利用预编译源安装 nginx 和 cherokee 

昨天偶尔从我的一个朋友那里得到了一个闲置的VPS,故而就想尝试一些小想法,一直没敢在自己的VPS上做的操作。

早就听说nginx 提供预编译版本,早就想试试了。还有 cherokee 也是。

不过和nginx 不同的是,cherokee 的预编译包是由EPEL维护和提供的。

果断下载其库的rpm 包,地址在它们的官网都可以找到。
3 wget http://mirrors.sohu.com/fedora-epel/6/i ... noarch.rpm
13 wget http://nginx.org/packages/centos/6/noar ... noarch.rpm

下载文件如下:
[root@ymzx ~]# ls -lh
总用量 24K
-rw-r--r-- 1 root root 14K 10月 14 2010 epel-release-6-5.noarch.rpm
-rw-r--r-- 1 root root 4.3K 10月 14 2011 nginx-release-centos-6-0.el6.ngx.noarch.rpm

依次安装。
[root@ymzx ~]# rpm -i --nosignature epel*
[root@ymzx ~]# rpm -i --nosignature nginx*

必须要加 --nosignature 参数,跳过签名检验,否则会报以下错:

warning: epel-release-6-5.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY


安装完成后,会发现yum 的库多了几个文件,
[root@ymzx ~]# ls -lh /etc/yum.repos.d
总用量 28K
-rw-r--r-- 1 root root 1.9K 7月 3 2011 CentOS-Base.repo
-rw-r--r-- 1 root root 637 7月 3 2011 CentOS-Debuginfo.repo
-rw-r--r-- 1 root root 626 7月 3 2011 CentOS-Media.repo
-rw-r--r-- 1 root root 957 10月 12 2010 epel.repo
-rw-r--r-- 1 root root 1.1K 10月 12 2010 epel-testing.repo
-rw-r--r-- 1 root root 113 10月 14 2011 nginx.repo
-rw-r--r-- 1 root root 219 7月 26 2011 vz.repo

就是 nginx 和 epel 的。

接下来,就可以在 yum 里面搜索到 nginx 和 cherokee 了。

[root@ymzx ~]# yum search nginx cherokee
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.san.fastserv.com
* epel: linux.mirrors.es.net
* extras: mirror.san.fastserv.com
* updates: mirrors.usc.edu
=============================================================== Matched: nginx ===============================================================
nginx-debug.x86_64 : debug version of nginx
nginx-release-centos.noarch : nginx repo configuration and pgp public keys
collectd-nginx.x86_64 : Nginx plugin for collectd
nginx.x86_64 : high performance web server

============================================================= Matched: cherokee ==============================================================
cherokee-devel.i686 : Development files of cherokee
cherokee-devel.x86_64 : Development files of cherokee
cherokee.i686 : Flexible and Fast Webserver
cherokee.x86_64 : Flexible and Fast Webserver

依次 yum install NAME 安装即可。

怎么样?是不是很简单,快捷?

评论