Skip to content

Instantly share code, notes, and snippets.

@prerabale
Last active August 29, 2015 14:08
Show Gist options
  • Select an option

  • Save prerabale/c726ba06fd8cc631a6b9 to your computer and use it in GitHub Desktop.

Select an option

Save prerabale/c726ba06fd8cc631a6b9 to your computer and use it in GitHub Desktop.
git、NodeJS、 MongoDB 2.6.5、 Redis、 ZeroMQ、 nginx、 imagemagick一键安装

###git、NodeJS、 MongoDB 2.6.5、 Redis、 ZeroMQ、 nginx、 imagemagick一键安装

sudo apt-get install wget #####git sudo apt-get install git #####nodejs
wget http://nodejs.org/dist/v0.10.33/node-v0.10.33-linux-x64.tar.gz

tar -xvf node-v0.10.33-linux-x64.tar.gz

vim test1.js

===

  var http = require('http');
  
  http.createServer(function (request, response) {
     response.writeHead(200, {'Content-Type': 'text/plain'});
     response.end('Hello World\n');
  }).listen(8000);
  
  console.log('Server running at http://localhost:8000/');

===

cd node-v0.10.33-linux-x64/bin

./node test1.js #能够在8000端口监听表示可用
如果不能打开,可能是防火墙的问题,开放端口
sudo /sbin/iptables -I INPUT -p tcp --dport 8000 -j ACCEPT

cd

vim .bashrc

===

  export PATH=$PATH:/home/aw/node-v0.10.33-linux-x64/bin #在最后添加node路径

===

source .bashrc

#####redis安装

mkdir redis

cd redis

wget https://redis.googlecode.com/files/redis-2.6.14.tar.gz

tar -zxvf redis-2.6.14.tar.gz

make

sudo make install 如果报错请参考:http://www.cnblogs.com/la-isla-bonita/p/3582751.html以及redis中文网

MongoDB 2.6.5安装(原文出处)

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list

sudo apt-get update

sudo apt-get install -y mongodb-org=2.6.5 mongodb-org-server=2.6.5 mongodb-org-shell=2.6.5 mongodb-org-mongos=2.6.5 mongodb-org-tools=2.6.5

echo "mongodb-org hold" | sudo dpkg --set-selections
echo "mongodb-org-server hold" | sudo dpkg --set-selections
echo "mongodb-org-shell hold" | sudo dpkg --set-selections
echo "mongodb-org-mongos hold" | sudo dpkg --set-selections
echo "mongodb-org-tools hold" | sudo dpkg --set-selections

开启MongoDB服务:

sudo service mongod start

验证MongoDB是否被成功的启动:

默认地址位:/var/log/mongodb/mongod.log,如果有如下文本则说明MongoDB服务已经被成功的启动了:

[initandlisten] waiting for connections on port <port>

使用如下命令可以停止和重启mongodb服务:

sudo service mongod stop sudo service mongod restart

ZeroMQ

wget http://download.zeromq.org/zeromq-4.0.4.tar.gz

tar -xzf zeromq-4.0.4.tar.gz

cd zeromq-4.0.4

./configure

make

sudo make install

sudo ldconfig

nginx

sudo apt-get install nginx

imagemagick

sudo apt-get install imagemagick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment