Last active
December 19, 2015 07:58
-
-
Save willread/5921944 to your computer and use it in GitHub Desktop.
Configure a debian 7.0 server to run multiple node.js apps
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
su root | |
cd ~ | |
# Install dependencies | |
apt-get update | |
apt-get install git-core curl build-essential openssl libssl-dev sudo vi | |
# Build node | |
git clone https://github.com/joyent/node.git | |
cd node | |
./configure --openssl-libpath=/usr/lib/ssl | |
make | |
make install | |
# Install utilities | |
npm install -g forever | |
# Create node user | |
adduser node | |
su node | |
cd ~ | |
# Configure proxy | |
git clone https://github.com/collectivecognition/reverseproxy.js proxy | |
cd proxy | |
su root | |
cp -R ./etc / | |
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 | |
su node | |
vi ./reverseproxy.js | |
npm install http-proxy | |
# Configure app | |
cd ~ | |
git clone https://github.com/collectivecognition/app | |
cd app | |
npm install | |
forever start app.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment