Skip to content

Instantly share code, notes, and snippets.

@curtislacy
Forked from mikermcneil/Node.js installation on Rackspace
Last active October 14, 2022 11:53
Show Gist options
  • Save curtislacy/3905950 to your computer and use it in GitHub Desktop.
Save curtislacy/3905950 to your computer and use it in GitHub Desktop.
Installing nodejs, npm, and all their pals on an Ubuntu 12.x server
############################################################################
# Installing nodejs, npm, and all their pals on an Ubuntu 12.x server
############################################################################
# Make sure we're getting the newest packages.
sudo apt-get update
# If this is a local image, you may need sshd set up.
sudo apt-get install openssh-server openssh-client
# Install some system stuff
sudo apt-get install daemontools
# Get your tools together
sudo apt-get install vim git curl libssl-dev make
# Sometimes you have to get stuff so you can compile stuff
sudo apt-get install gcc g++ lib32z1-dev pkg-config ant
sudo apt-get install ruby rubygems
sudo gem install sass
sudo apt-get install python-dev python-setuptools
# Using ZeroMQ?
sudo apt-get install libzmq1 libzmq-dev
sudo easy_install pyzmq
# Now install node and npm
cd /usr/local/src
sudo git clone https://github.com/curtislacy/node.git
cd node
sudo git checkout Stack-Traces-On-Overflow
sudo ./configure
sudo make
sudo make install
Grab Java 1.6.0_37 from http://www.oracle.com/technetwork/java/javase/downloads/jdk6u37-downloads-1859587.html
# Install it manually in /opt/java
sudo mkdir /opt/java
cd /opt/java
sudo ~ubuntu/jdk-6u37-linux-x64.bin
# Add to ~/.bashrc:
# export JAVA_HOME=/opt/java/jdk1.6.0_37
# export PATH=$JAVA_HOME/bin:$PATH
# May need to clean up some strange permissions from the npm install.
sudo chown -R ubuntu ~ubuntu/.npm
sudo chown -R ubuntu ~ubuntu/tmp
# Get NPM and forever, install globally
sudo npm install -g forever
# Make it so that grunt can be used
sudo npm install -g grunt-cli
# Other node-based compilation tools
sudo npm install -g less
sudo npm install -g jshint
# If you want MongoDB
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/10gen.list
sudo apt-get update
sudo apt-get install mongodb-10gen
# Configure git.
git config --global user.name "User Name"
git config --global user.email "user.name@someplace.com"
git config --global core.editor vim
# If you change iptables rules later, you'll need them to persist.
sudo apt-get install iptables-persistent
# May not need to do this step explicitly
sudo update-rc.d iptables-persistent defaults
# If you're setting up on Rackspace, you'll want the monitoring agent.
# Get it here: http://www.rackspace.com/knowledge_center/article/install-the-cloud-monitoring-agent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment