The operating system selected here is the community version of Debian. The operating instructions of Debian and Ubuntu are in line with each other. In addition, I am familiar with the Raspberry PI that I have played for a while. The following installation process is actually applicable to the Tsark (installing node.js and NPM).
1) Register and select
After registering and binding a signal card on AWS, you can use Amazon's one-year free EC2 host, but the configuration is usually low, usually 0.612Mb (linux) and 1G (Win) memory.
http://aws.amazon.com/
The community version of Debian is Debian-squeeze-amd64-pvm-2014-07-21-ebs)
Type t1.micro
Memory (GiB) 0.613
2) Log in to the cloud host
Unlike Guofeng hosts usually use password to log in, Amazon uses encryption authorization (pem format key certificate generated by openssl) by default to log in.
A copy is automatically downloaded when creating a host instance. Windows Usage first needs to convert it into PPK format (details), which may take a long time.
The second thing to note is that Debian's default login username is admin, not root or ec2:
After logging in, switch to the user and become root
sudo -i
3) Install Node.js and NPM
The latest version of NodeJS and NPM currently require manual download of source code and locally compiled and installed.
The node version installed here is 0.10.30.
Before installation, you need to install some dependencies (deductive tools, manifest), such as curl, GCC (4.2+), GNU make (3.81+). python (2.6 or 2.7) or build-essential (including g++ and make), etc.
apt-get update apt-get install curlapt-get install pythonapt-get install gccapt-get install makeapt-get install build-essential #(g++ and make included in it, detail)apt-get install libssl-dev [optional]
Then run the following installation script, details
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc. ~/.bashrcmkdir ~/localmkdir ~/node-latest-installcd ~/node-latest-installcurl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1./configure --prefix=~/localmake install # ok, fine, this step probably takes more than 30 seconds...curl https://www.npmjs.org/install.sh | sh
Check the version after the run is completed
$node --versionv0.10.30
4) Install OurJS
Choose a suitable directory to run the following script (for example, in the /var/www directory)
npm install ourjscp -r node_modules/ourjs ./chmod 755 ./ourjs/ourjs.sh && ./ourjs/ourjs.sh
The rough process is to download ourjs from npm, then copy it from the node_modules directory, turn ourjs.sh into executable and run the service.
5) Test it at http://localhost:8054
If you want to access this service on the public network, you need to add port 8054 to the security group.
To this end, NodeJS, NPM and ourjs blog system are basically available, but node.js and nginx are more effective in using it. nginx is responsible for static files (CSS, JS, pictures), G-zip, cache (301 cache), which can improve performance and save traffic for your server.