返回列表

CentOS 6.4 下安装 Nodejs mongdb redis

默认分类 2015/04/30 00:35

命令记录如下

yum install -y gcc-c++ net-snmp tcl lrzsz

mkdir -p ~/tmp
cd ~/tmp/
wget http://nodejs.org/dist/v0.10.36/node-v0.10.36.tar.gz
tar -zxf node-v0.10.36.tar.gz 
cd ~/tmp/node-v0.10.36
./configure 
make
make install
node -v
npm -v

cd ~/tmp/
wget http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-rhel62-2.6.7.tgz
tar -zxf mongodb-linux-x86_64-enterprise-rhel62-2.6.7.tgz 
mkdir -p /usr/local/mongodb/bin/
mv ~/tmp/mongodb-linux-x86_64-enterprise-rhel62-2.6.7/bin/* /usr/local/mongodb/bin/
mkdir -p ~/web/mongodb/db
mkdir -p ~/web/mongodb/logs

cd ~/tmp/
wget http://download.redis.io/redis-stable.tar.gz
tar zxf redis-stable.tar.gz 
cd redis-stable
make
make test
mkdir -p /usr/local/redis/bin
cd src/
mv mkreleasehdr.sh redis-check-aof redis-cli redis-server redis-benchmark redis-check-dump redis-sentinel /usr/local/redis/bin/
mkdir -p ~/web/redis
cp ~/tmp/redis-stable/redis.conf ~/web/redis/

>vi /etc/rc.d/rc.local

/usr/local/mongodb/bin/mongod  -f /root/web/mongodb/mongodb.conf
/usr/local/redis/bin/redis-server /root/web/redis/redis.conf

>vi /etc/profile

export PATH=$PATH:/usr/local/mongodb/bin
export PATH=$PATH:/usr/local/redis/bin

>vi /root/web/mongodb/mongodb.conf

dbpath=/root/web/mongodb/db
logpath=/root/web/mongodb/logs/mongodb.log
port=27017
fork=true
nohttpinterface=true

reboot

远程访问:

redis-cli.exe -h 127.0.0.1 -p 6379