Installing the mean environment on EC2

Source: Internet
Author: User

This article on the personal blog address is a URL, welcome to taste.

After setting up the decision Tree Project extranet demo try several places, finally select EC2 (Amazon Elastic Compute Cloud). Choose the cheapest Amazon Linux ami system t2.micro type (upfront free). Because it is a system based on the Red Hat release, the operation is similar to the CentOS in the lab, this article combines the previous article to build the NODEJS environment, and includes the installation of MongoDB, of course, also includes the security mechanism of the annoying Amazon remote connection.

  1. Connect using putty

    You first need to convert the EC2 generated private key (. Pem) to the Putty supported format (. PPK). Open the Puttygen and follow the diagram or official documentation.

    After generating the key, use putty to connect to the host remotely, write [email protected]_dns_name or public_ip in the ellipse block (both of which can be found in the generated instance), and note that the values in the two squares are correct.

    Open the Connection->ssh->auth on the left and import the **.PPK you just created.

    In the first configuration, the remote host always denies my private key, and the online recommendation is to import the host image to a new instance. But I was simply rude to create a new instance. After entering the console, you can enter root mode to install some packages.

  2. Install Nodejs

    First, be careful not to install Nodejs directly in the previous article, because Amazon's gcc version above 4.8,make nodejs error V8 compilation errors (./deps/v8/src/ Checks.h:271:5: note:in expansion of macro ' SEMI static join ' SEMI static join (Staticasserttypedef, Line), so you need to install the lower version of GCC, which I installed is 4.7.3. The command is as follows

     # wget-c http://ftp.gnu.org/gnu/gcc/ Gcc-4.7.3/gcc-4.7.3.tar.gz# tar zxvf gcc-4.7.3.tar.gz # cd gcc-4.7.3#./contrib/download_prerequisites< Span class= "Hljs-preprocessor" >#./configure--enable-checking=release--enable-languages=c,c++--disable-multilib< Span class= "Hljs-preprocessor" ># make this make time is very long, stay patient # make install         

    Check the version, install Nodejs (v0.10.35, high version installation Bcrypt package is not friendly) will be successful, Of course here, because bash cannot find the GCC command configuration bash also fails, I simply rudely create a new instance.

  3. Installing MongoDB

    The next installation will be smoother.

     # wget http://fastdl.mongodb.org/linux/ Mongodb-linux-x86_64-2.6.7.tgz# tar zxvf Mongodb-linux-x86_64-2.6.7.tgz# mv Mongodb-linux-x86_64-2.6.7/usr/local/mongodb# cd/usr/ Local/mongodb start--smallfiles Avoid error:insufficient free space for Journal Files#./bin/mongod--smallfiles--dbpath=/usr/local/mongodb/data/db--logpath=/usr/local/mongodb/ Logs/mongodb.log--fork boot from # echo "/usr/local/mongodb/bin/mongod--smallfiles-- dbpath=/usr/local/mongodb/data/db--logpath=/usr/local/mongodb/logs/mongodb.log--fork ">>/etc/rc.local 
  4. Source Run Server

    Using WINSCP to transfer files, remember to import the **.PPK private key into SSH authentication in the advanced settings, the host list uses Public_dns_name is good. The source is ready to install dependencies (NPM install), run (using nohup ndoe Add & command to stay running), but close it requires a direct kill program.

The intermittent workload is roughly 1 days, with the most time-consuming setup of connecting and installing GCC. It takes patience and encouragement to do Linux. The cover puts a picture that's irrelevant to the content.

Installing the mean environment on EC2

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.