Last active
January 1, 2016 11:49
-
-
Save japrescott/8140885 to your computer and use it in GitHub Desktop.
Node Mongo Nginx Setup
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/sh | |
# | |
# Install all dependencies on a Debian | |
# | |
apt-get update | |
apt-get upgrade -y | |
apt-get install -y build-essential git-core nginx libssl-dev pkg-config | |
NODEVERSION=0.10.23 | |
MONGOVERSION=2.2.3 | |
# Node.js | |
wget http://nodejs.org/dist/node-v$NODEVERSION.tar.gz | |
tar xvzf node-v$NODEVERSION.tar.gz | |
cd node-v$NODEVERSION | |
./configure | |
make | |
make install | |
cd .. | |
node-v$NODEVERSION.tar.gz | |
# NPM | |
curl http://npmjs.org/install.sh | sh | |
# MongoDB | |
wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-$MONGOVERSION.tgz | |
tar xvzf mongodb-linux-i686-$MONGOVERSION.tgz | |
rm mongodb-linux-i686-$MONGOVERSION.tgz | |
mkdir -p /data/db | |
/root/mongodb-linux-i686-$MONGOVERSION/bin/mongod & | |
# Config | |
adduser --system --shell /bin/bash --gecos 'User for running node.js projects' --group --disabled-passwo$ | |
# Add ubuntu user to the nodejs group | |
# /usr/sbin/usermod -a -G nodejs ubuntu | |
# Setup basic nginx proxy. | |
unlink /etc/nginx/sites-available/default | |
cat > /etc/nginx/sites-available/node_proxy.conf < |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment