Coder Social home page Coder Social logo

servers's Introduction

NPR Apps Servers

About Servers

These scripts are designed to turn a brand new Ubuntu 12.04 server image into a fully functional server.

It is expected that AMI snapshots will be taken of each server and used for routine spin-ups, but these scripts allow us to quickly modify the basic recipe. (And track changes.)

Remember: never make a baked AMI public.

Install requirements

Make a virtualenv and install the project requirements:

cd servers
mkvirtualenv servers
pip install -r requirements.txt

Creating servers

If creating servers with the web console isn't fast enough for you, then you can create servers from the command line with the EC2 API tools. Install them with:

brew install ec2-api-tools

At the end of the installation a set of environment variables to be set will be printed. Be sure to add these to your ~/.bash_profile. You will also need to download a private key and X.509 certificate from AWS. Update the EC2_PRIVATE_KEY and EC2_CERT environment variables to point to these files.

Once configured you can create a new server from your command line:

  • Create server: ec2-run-instances ami-1cdd532c -t t1.micro --region us-west-2 --key nprapps
  • Get server DNS name: ec2-describe-instances --region us-west-2 $INSTANCE_ID (keep running until available)

Cron

Creating a new cron/basic server:

  • Install list of live SSH keys: scp -i ~/.ssh/nprapps.pem [email protected]:~/.ssh/authorized_keys ubuntu@$SERVER_DNS_NAME:~/.ssh/
  • SSH in: ssh ubuntu@$SERVER_DNS_NAME
  • Fetch setup script: wget https://raw.github.com/nprapps/servers/master/setup_cron.sh
  • Run setup script: sudo bash setup_cron.sh
  • Type in configuration values and wait for script to complete. The server will reboot.
  • SSH in again (see above)
  • rm setup_cron.sh

TODO

Install/generate .s3cfg

Add Nginx sites

Add your configuration file to the nginx/sites-available/ folder. Use the static and status configurations as examples.

Do not deploy application-specific files with this app. Application-specific files should be added via the application's fab deploy command.

Deploy to EC2

Deploy your new server configurations to EC2.

fab <destination> deploy

The configurations are deployed with rsync, which means that you don't need to specify a branch. Whichever branch you are working in locally will be deployed to the server.

servers's People

Contributors

jeremyjbowers avatar onyxfish avatar

Watchers

James Cloos avatar Gerald Rich avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.