代码改变世界

在RHEL5上安装CouchDB

2012-11-29 14:08  康杜  阅读(261)  评论(0编辑  收藏  举报

简介

本文介绍CouchDB在RHEL5上的安装步骤。

先安装Yum

如果没有Yum,先安装一个Yum。 Yum的安装这里不再敷述。在/etc/yum.repos.d下放一个文件,命名为CentOS-Base.repo, 内容为

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
 
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
 
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=addons
enabled=0
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
 
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
 
[rpmforge]
name = Red Hat Enterprise $releasever - RPMforge.net - dag
baseurl = ftp://ftp.pbone.net/mirror/atrpms.net/el5-x86_64/atrpms/stable
enabled = 1
protect = 0
gpgcheck = 0

安装couchdb依赖的包

yum install libicu-devel openssl-devel make gcc js-devel libtool which

curl安装

首先通过命令which curl查看系统中是否已经安装了curl,如果没有安装就要安装一个。

$ wget http://curl.haxx.se/download/curl-7.20.1.tar.gz
$ tar -xzf curl-7.20.1.tar.gz
$ cd curl-7.20.1
$ ./configure --prefix=/usr/local
$ make
$ make test
# make install

erlang安装

从源文件安装比较麻烦,我们还是下载rpm来安装好了。

# wget apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/erlang-R12B-5.12.el5.rf.x86_64.rpm
# rpm -ivh erlang-R12B-5.12.el5.rf.x86_64.rpm

couchdb安装

从源文件安装比较麻烦,我们还是下载rpm来安装好了。

# wget apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/couchdb-1.0.1-1.el5.rf.x86_64.rpm
# rpm -ivh couchdb-1.0.1-1.el5.rf.x86_64.rpm

启动CouchDB

# service couchdb start
//自动启动
# chkconfig --level 345 couchdb on

配置绑定地址

vi /etc/couchdb/default.ini

把bind_address改成本机的IP,然后重启

#/etc/init.d/couchdb restart

验证

http://yourserverip:5984/_utils

这个网站很重要,什么rpm都能找到

http://rpm.pbone.net