Ali cloud centos nginx and set up the whole process node

hundreds 版本: CentOS release 6.8 (Final)

  1. ssh login
    1
    ssh [email protected]

Then enter the password

  1. yum update

    1
    yum -y update
  2. Compile the source code development tools

    1
    yum -y groupinstall "Development Tools"

Installation node.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Into the / usr / src folder, this folder is usually used to store software source code 
cd / usr / src

# Get the source code archive from Node.js site, I chose the version v0.10.18
wget http://nodejs.org/dist/v0.10.18/node-v0.10.18.tar.gz

# Decompressed source file, and into the compressed file in the folder to
the tar zxf Node-v0.10.18.tar.gz
CD-Node v0.10.18

# Perform pre-configuration script to compile
./configure
the make & the make install

# Test installation Node.js module manager npm
npm install -g Express

# A hyperlink, or will report "command not found" when the Node sudo
sudo LN -s / usr / local / bin / the Node / usr / bin / the Node
sudo LN -s / usr / local / lib / the Node / usr / lib / the Node
sudo LN -s / usr / local / bin / npm / usr / bin / npm

Install Nginx

1
2
3
4
5
6
7
8
9
# Install some additional software repository 
sudo yum -y install EPEL-Release
RPM -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx. noarch.rpm

# Package management tool to install nginx
sudo yum -y install nginx

# Start
service nginx start

Ip (local via localhost / or 127.0.0.1) to view information service nginx returned by the public:
is available for purchase to nginx!

Where the boot process error:

1
2
Big Box   Ali cloud centos nginx and set up the whole process node "Line"> Starting nginx: nginx: [emerg] socket () [::]: failed The 80 (97: Family not Supported by Protocol Address) 
[FAILED]

Solution:

1
vim /etc/nginx/conf.d/default.conf

will

1
2
listen       80 default_server;
listen [::]:80 default_server;

Read:

1
2
listen       80;
#listen [::]:80 default_server;

Restart nginx tried to kill nginx process, closed for modification ipv6 do not work

Installation mongodb

Installation Notes:

  • System Environment: Centos-6.8
  • Installing the software: mongodb-linux-x86_64-2.4.9.tgz
  • Download: http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.9.tgz
  • Upload Location: / usr / local /
  • Software installation location: / usr / local / mongodb
  • Data storage location: / var / mongodb / data - log storage location: / var / mongodb / logs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Into the folder / usr / local, download the source code mongodb 
cd / usr / local
wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.9.tgz

# Extract the installation package, rename folder MongoDB
the tar-Linux-x86_64-2.4.9.tgz zxvf MongoDB
MongoDB MongoDB-Linux-x86_64-2.4.9 Music Videos

# Build var folder mongodb folder, and folders data are established for storing data, logs for storing log
mkdir / var / mongodb
mkdir / var / mongodb / data
mkdir / var / mongodb / logs

# Open rc.local file, add CentOS boot entry
vim /etc/rc.d/rc.local

# Mongodb start command will be appended to this document, let mongodb boot from the start
/ usr / local / mongodb / bin / mongod --dbpath = / var / mongodb / data --logpath /var/mongodb/logs/log.log - fork

#启动mongodb
/usr/local/mongodb/bin/mongod --dbpath=/var/mongodb/data --logpath /var/mongodb/logs/log.log -fork

# See the following explanation has been installed and successfully started
forked Process: 18394
All going to the Output: /var/mongodb/logs/log.log

Guess you like

Origin www.cnblogs.com/wangziqiang123/p/11711175.html