Last active
December 9, 2015 23:59
-
-
Save dgershman/4348083 to your computer and use it in GitHub Desktop.
added changes for checking for root, since sudo su don't work right
This file contains 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
#!/bin/bash | |
# Danny Gershman | |
# Cinchcast | |
FILE="/tmp/out.$$" | |
# Make sure only root can run our script | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
# First upgrade to python 2.7 | |
# Prepping | |
yum -y groupinstall 'Development Tools' | |
yum -y install openssl-devel* ncurses-devel* zlib*.x86_64 | |
yum -y install bzip2 bzip2-devel bzip2-libs | |
# creating bz2 dependency | |
wget http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz | |
tar xpzf bzip2-1.0.6.tar.gz | |
cd bzip2-1.0.6 | |
make -f Makefile-libbz2_so | |
make | |
make install PREFIX=/usr/local | |
cd .. | |
# Downloading python source | |
wget https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz --no-check-certificate | |
tar xfz Python-2.7.6.tgz | |
# Building python | |
cd Python-2.7.6 | |
export PATH=/usr/local:$PATH | |
./configure --prefix=/usr/local | |
make | |
make install | |
# After doing this close out the ssh session and re-open run | |
python -V # should return 2.7, if not something isn't right | |
cd .. | |
# Download nodejs and unzip | |
yum install openssl-devel | |
cd /usr/local/src | |
wget http://nodejs.org/dist/v0.12.1/node-v0.12.1.tar.gz | |
tar zxvf node-v0.12.1.tar.gz | |
# Build | |
cd node-v0.12.1 | |
# check to make sure that /usr/local/bin is in the $PATH environment variable, and it's before /usr/bin | |
./configure --prefix=/usr/local | |
make | |
make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Things to check on:
sudo su
that /usr/local/bin is in your path. You may need to add to the /root/.bashrc fileexport PATH=/usr/local/bin:$PATH
sudo su
check to see ifnode --version
returns v0.8.16.ulimit -n
should return a value higher than 1024.