Created
November 28, 2014 21:09
-
-
Save samartioli/325bdc864d9f157b631f to your computer and use it in GitHub Desktop.
Setting up Centos 6.5 with node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo su # become root | |
# yum -y install http://mirror.pnl.gov/epel/6/i386/epel-release-6-8.noarch.rpm | |
yum -y install http://mirror.pnl.gov/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
yum -y update | |
# #exclude=kernel necessary in order to build npm package. | |
# If you skip this step 'yum install npm' will fail | |
sed -i 's/exclude=kernel/#exclude=kernel/' /etc/yum.conf | |
yum -y install git nodejs npm redis multitail | |
useradd -p $(perl -e'print crypt("node", "salty")') node | |
useradd -G node -p $(perl -e'print crypt("newuser", "salty")') newuser | |
mkdir -p /opt/node/npm-global | |
chown -R node:node /opt/node | |
chmod -R 750 /opt/node | |
/etc/init.d/redis start | |
su - node # become node | |
echo 'umask 0022' >> ${HOME}/.bashrc ; | |
echo 'alias vib="vi ~/.bash_profile"' >> ${HOME}/.bash_profile ; | |
echo 'alias sb="source ~/.bash_profile"' >> ${HOME}/.bash_profile ; | |
echo 'alias ls="ls -al"' >> ${HOME}/.bash_profile ; | |
echo 'alias lsl="ls -alrt"' >> ${HOME}/.bash_profile ; | |
echo 'alias npmg="npm install --prefix=/opt/node/npm-global -g"' >> ${HOME}/.bash_profile ; | |
source ~/.bash_profile ; | |
vib # Change | |
PATH=$PATH:$HOME/bin | |
# to: | |
PATH=$PATH:$HOME/bin:/opt/node/npm-global/bin | |
sb # alias to source ~/.bash_profile | |
echo 'prefix = /opt/node/npm-global' > ${HOME}/.npmrc | |
npm install bower grunt-cli forever --prefix=/opt/node/npm-global -g | |
# control-d to root | |
su - newuser # become newuser | |
echo 'alias vib="vi ~/.bash_profile"' >> ${HOME}/.bash_profile ; | |
echo 'alias sb="source ~/.bash_profile"' >> ${HOME}/.bash_profile ; | |
echo 'alias ls="ls -al"' >> ${HOME}/.bash_profile ; | |
echo 'alias lsl="ls -alrt"' >> ${HOME}/.bash_profile ; | |
source ~/.bash_profile | |
vib # Change | |
PATH=$PATH:$HOME/bin | |
# to: | |
PATH=$PATH:$HOME/bin:/opt/node/npm-global/bin | |
sb # alias to source ~/.bash_profile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment