Last active
February 16, 2016 13:24
-
-
Save FullStackForger/20e345cf9dff308a7392 to your computer and use it in GitHub Desktop.
Bash script setting up node web server for ubuntu 14.04LT
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
| # install mongodb | |
| sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 | |
| echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list | |
| sudo apt-get update | |
| sudo apt-get install -y mongodb-org |
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
| # install gcc compilers | |
| sudo apt-get install -y gcc g++ | |
| sudo apt-get install -y build-essential | |
| # install node | |
| curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash - | |
| sudo apt-get install -y nodejs | |
| npm install -g npm node-gyp | |
| # configure node path prefix | |
| # https://docs.npmjs.com/getting-started/fixing-npm-permissions | |
| mkdir ~/.npm-global | |
| npm config set prefix '~/.npm-global' | |
| printf "\nexport PATH=~/.npm-global/bin:$PATH\n" >> ~/.profile && source ~/.profile | |
| # install git | |
| sudo apt-get install -y git |
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
| #!upstart | |
| description "Strider upstart job" | |
| start on startup | |
| stop on shutdown | |
| script | |
| echo $$ > /var/run/strider.pid | |
| #export NODE_PATH="/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript" | |
| env PATH="/home/ubuntu/.npm-global/bin:$PATH" | |
| exec sudo -u strider \ | |
| PORT=3000 \ | |
| STRIDER_CLONE_DEST="/home/user/strider-builds/" \ | |
| DB_URI="mongodb://localhost:strider" \ | |
| SERVER_NAME="ci.indieforger.com" \ | |
| PLUGIN_GITHUB_APP_ID="" \ | |
| PLUGIN_GITHUB_APP_SECRET="" \ | |
| SMTP_HOST="" \ | |
| SMTP_PORT="" \ | |
| SMTP_USER="" \ | |
| SMTP_PASS="" \ | |
| strider >> /var/log/strider.log 2>&1 | |
| end script | |
| pre-start script | |
| echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> /var/log/strider.log | |
| end script | |
| pre-stop script | |
| rm /var/run/strider.pid | |
| echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> /var/log/strider.log | |
| end script | |
| ~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment