mup with CentOS 6

Server Settings

centos

yum -y update  
yum -y install gcc-c++ openssl-devel  
ln -s /sbin/stop /usr/local/bin/stop  
ln -s /sbin/start /usr/local/bin/start    

nodejs

curl --silent --location https://rpm.nodesource.com/setup | bash -
yum -y install nodejs

mongodb

/etc/yum.repos.d/mongodb-org-2.6.repo

[mongodb-org-2.6]
name=MongoDB 2.6 Repository  
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/  
gpgcheck=0  
enabled=1  
yum install -y mongodb-org  
service mongod start  

nginx

/etc/yum.repos.d/nginx.repo

[nginx]
name=nginx repo  
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/  
gpgcheck=0  
enabled=1  
yum install nginx  

mup

mup setup  
mup deploy  

Simple Meteor Deployment for CentOS 6+

– 출처: https://github.com/creatorkuang/meteor-please

meteor-please for centos 6

npm version

Simple Meteor Deployment for CentOS 6+

Installation

npm install -g mplzc6

Usage

1. Initialise

Simply run in your Meteor project’s directory:

mplzc6

You’ll get a prompt to automatically configure a mplz.json for your project.

2. Setup Your Environment

Once you’ve got a configuration file, you can spin up your server, then use this command inside your project directory to install the production environment (nodejs, mongodb, nginx):

mplzc6 setup

Now go grab a coffee, because it will probably take some time for all the things to install.

3. Deploy Your App

After the server setup is done, you can run this command to deploy your app:

mplzc6 deploy

Easy!

Commands

mplzc6 init Reconfigures your app’s mplz.json settings file.

mplzc6 setup Sets up your server according to your mplz.json settings.

mplzc6 deploy Deploys your app according to your mplz.json settings.

mplzc6 reconfig Apply any configuration changes if your mplz.json has been modified since last setup.

mplzc6 start Starts your app. (systemd)

mplzc6 stop Stops your app. (systemd)

mplzc6 restart Restarts your app. (systemd)

mplzc6 delete Deletes your app from the deployment directory.

TODOs

  • SSL
  • Multiple instances/load balancing/oplog tailing
  • Prompt cleanup/validation
  • Support for node apps
  • Exclude folders

Installing Node.js via package manager

– 출처: https://nodejs.org/en/download/package-manager/

Enterprise Linux and Fedora

Including Red Hat® Enterprise Linux® / RHEL, CentOS and Fedora.

Node.js is available from the NodeSource Enterprise Linux and Fedora binary distributions repository. Support for this repository, along with its scripts, can be found on GitHub at nodesource/distributions.

Note that the Node.js packages for EL 5 (RHEL5 and CentOS 5) depend on the EPEL repository being available. The setup script will check and provide instructions if it is not installed.

Run as root on RHEL, CentOS or Fedora, for Node.js v4 LTS Argon:

curl --silent --location https://rpm.nodesource.com/setup_4.x | bash -

Alternatively for Node.js v5:

curl --silent --location https://rpm.nodesource.com/setup_5.x | bash -

Alternatively for Node.js 0.10:

curl --silent --location https://rpm.nodesource.com/setup | bash -

Then install, as root:

yum -y install nodejs

How To Install Node.js on a CentOS 7 server

– 출처: https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-a-centos-7-server

Install Node Using the Node Version Manager

Another way of installing Node.js that is particularly flexible is through NVM, the Node version manager. This piece of software allows you to install and maintain many different independent versions of Node.js, and their associated Node packages, at the same time.

To install NVM on your CentOS 7 machine, visit the project’s GitHub page. Copy the curl or wgetcommand from the README file that displays on the main page. This will point you towards the most recent version of the installation script.

Before piping the command through to bash, it is always a good idea to audit the script to make sure it isn’t doing anything you don’t agree with. You can do that by removing the | bash segment at the end of the curl command:

curl https://raw.githubusercontent.com/creationix/nvm/v0.13.1/install.sh

Take a look and make sure you are comfortable with the changes it is making. When you are satisfied, run the command again with | bash appended at the end. The URL you use will change depending on the latest version of NVM, but as of right now, the script can be downloaded and executed by typing:

curl https://raw.githubusercontent.com/creationix/nvm/v0.13.1/install.sh | bash

This will install the nvm script to your user account. To use it, you must first source your .bash_profile:

source ~/.bash_profile

Now, you can ask NVM which versions of Node it knows about:

nvm list-remote
. . .
v0.10.29
v0.10.30
 v0.11.0
 v0.11.1
 v0.11.2
 v0.11.3
 v0.11.4
 v0.11.5
 v0.11.6
 v0.11.7
 v0.11.8
 v0.11.9
v0.11.10
v0.11.11
v0.11.12
v0.11.13

You can install a version of Node by typing any of the releases you see. For instance, to get version 0.10.30, you can type:

nvm install v0.10.30

You can see the different versions you have installed by typing:

nvm list
->  v0.10.30
      system

You can switch between them by typing:

nvm use v0.10.30
Now using node v0.10.30

To set this version as the default, type:

nvm alias default v0.10.30
default -> v0.10.30

You can verify that the install was successful using the same technique from the other sections, by typing:

node --version
v0.10.30

From the version number output, we can tell that Node is installed on our machine as we expected.