For Intranet Linux systems, if nodejs, NPM, express, MongoDB, forever, and so on are installed

Source: Internet
Author: User
Tags openssl version

For Linux systems on the Intranet, nodejs, express, and other series of frameworks should be installed. Because the system is physically isolated from the Internet through the LAN, it is impossible to install nodejs directly like the installation tutorial on the official website, you can only install it manually. Here we have used our Linux system suse10 as an example:

 

1. Build a 1.1 installation node in the nodejs Environment

1) download the software package from the official website http://www.nodejs.org

2) Installation command

Tar-zxvf node-v0.6.15.tar.gz

./Configure

Make

Make install

 

3) default installation directory

/Usr/local/bin/

/Usr/local/lib/

1.2 OpenSSL not found prompt during installation Solution

1) First, check whether the installation is complete. If the installation is not complete, download and install it.

OpenSSL version

 

2) confirm that OpenSSL has been installed and prompt to find OpenSSL. Take suse10 as an example. Copy libcrypto. PC, libssl. PC, and OpenSSL. PC to the/usr/local/lib/pkgconfig directory.

CP/usr/local/SSL/lib/pkgconfig/libcrypto. PC/usr/local/lib/pkgconfig/libcrypto. PC

CP/usr/local/SSL/lib/pkgconfig/libssl. PC/usr/local/lib/pkgconfig/libssl. PC

CP/usr/local/SSL/lib/pkgconfig/OpenSSL. PC/usr/local/lib/pkgconfig/OpenSSL. PC

2. MongoDB environment setup 2.1 installation

Suse10: only legacy-static version can be installed. Otherwise, the "floating point exception" error will be reported. The official explanation is as follows:

"The Linux legacy-static builds are only recommended for older systems. if you try to run and get a floating point exception, try a legacy-Static build. otherwise you shoshould always use the regular builds."

The version of this Server installation is: http://fastdl.mongodb.org/linux/mongodb-linux-i686-static-2.0.4.tgz

2.2 deployer

Directly decompress the package and use it. Find the decompressed/bin/directory and run the following/bin/mongod to start the server. To change Mongo and mongod to common global shell commands, you can copy the two commands to the/usr/local/bin directory.

2.3 compile the startup configuration file

Save the configuration file for the following example:/etc/MongoDB. CNF

 

# Configuration options for MongoDB

#

# For more information, consider:

#-Configuration parameters: http://www.mongodb.org/display/DOCS/Command+Line+Parameters

#-File Based Configuration: http://www.mongodb.org/display/DOCS/File+Based+Configuration

 

Dbpath =/data/DB/

Logpath =/apps/MongoDB/logs/MongoDB. Log

Logappend = true

 

# Bind_ip = 10.12.16.125

Port = 27017

Fork = true

# Auth = true

Noauth = true

Directoryperdb = true

Journal = true

 

Compile the startup script file:

/Usr/bin/MongoDB-start

#! /Bin/sh

 

/Apps/MongoDB/bin/mongod -- config/etc/MongoDB. CNF

 

Compile the script file for stopping the service:

/Usr/bin/MongoDB-stop

#! /Bin/bash

 

PID = 'ps-o pid, command ax | grep mongod | awk '! /Awk /&&! /Grep/{print $1 }'';

If ["$ {pid }"! = ""]; Then

Kill-2 $ {pid };

Fi

2.4 basic MongoDB Database Service Management

1) start with the Configuration File Script

Run MongoDB-start on the command line.

 

2) Stop MongoDB

A. Find the process ID and kill it directly. The method for searching the process ID is as follows:

PS-C between D-f | grep between d | tr-s ''| cut-D''-F 2

Or

PS aux | grep rjd | grep-V "grep" | awk-F "" '{print $2 }'

 

B. Stop running the script

Run MongoDB-stop on the command line.

3 nodejs Service Management 3.1 about forever

Forever manages node. js backend operations, restarts, and stops service monitoring.Program.

3.2 forever

Start:

Forever start/home/www/index. js

 

Stop:

Forever stop/home/www/index. js

 

Common commands:

Start start script as a daemon

Stop stop the daemon script

Stopall stop all running forever scripts

Restart restart the daemon script

Restartall restart all running forever scripts

List list all running forever scripts

4 NPM Package Manager 4.1 how to install other packages in the NPM test environment

Point the image address of the NPM resource library to a machine on the LAN as follows:

NPM config set registry http: // 10.18.116.43: 3000

Then, according to the NPM log, download and deploy all the 404 files to the LAN server.

Package: http://registry.npmjs.vitecho.com

4.2 common NPM commands

Set proxy (do not set the server)

NPM config set proxy = http://proxy.tencent.com: 8080

 

Set image address

NPM config set registry http://registry.npmjs.vitecho.com

 

Clear HTTP request Cache

NPM cache clean

 

Delete a configuration file

NPM config DeleteKey (Configuration items)

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.