Giter VIP home page Giter VIP logo

fsp-deployment-guide's Introduction

The Full Stack Python Guide to Deployments

This repository is the code companion to Full Stack Python Guide to Deployments book.

The book is now available on Gumroad!

Tags

The following links take you to each chapter’s corresponding tag as the book builds up the automation scripts progressively:

fsp-deployment-guide's People

Contributors

fredrikhedman avatar mattmakai avatar zevaverbach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fsp-deployment-guide's Issues

Cannot deploy using ansible

I can't run deploy_prod.sh as indicated in step 9 of page 77 of the pdf. I get an error about quotes around brackets, though that doesn't really seem to be the problem.

image

Having issues with fabfile.py

I am trying to configure a Fedora Server, and have made changes to the fabfile respective to it. But I don't know why but script doesn't work from line 46. Also, I believe at line 44; it should look something like this local
('cp {} {}/authorized_keys'.format(env.ssh_key_filepath + ".pub", env.ssh_key_dir)).

root user creation

Most VPS hosting providers don't provide the ability to create the root password like the way you can in Linode. A default install of Ubuntu Server wont even let you SSH in as the root user (you need to set up openssh-server too). It might be worth simplifying this initial part of the guide, adding more generalizable steps, as it's not trivial to jump from Linode to AWS, a local VM, etc.

Deploy Key not being used

I was trying to change from public to private repository but unfortunately when I did this in Chapter 5, Ansible stops working.

Automating Git configuration with ./deploy_prod.sh

Task: ensure deploy key is on remote server.

This is failing and I'm not sure why. I have added deploy_key.pub to the Deploy Keys section on my forked repo of your cyoa repo and followed all other steps too. Do I also need a deploy_key private file on my local machine?

screenshot from 2017-08-13 22-37-31

Can't get playbook to work

Hi Matt,

If I run the playbook the first time I get:

simon@simon-VirtualBox:~/repos/deployment/fsp-deployment-guide$ ./deploy_prod.sh 
 [WARNING]: provided hosts list is empty, only localhost is available


PLAY [apply common configuration to server] ************************************
skipping: no hosts matched

PLAY RECAP *********************************************************************

./deploy_prod.sh: line 3: ./ssh_keys/prod_key: No such file or directory

I realized that when doing the fab bootstrap from the previous chapter, the keys are stored in files named
myip_prod_key
and
myip_prod_key.pub

So I changed the deploy_prod.sh line 3 from
./ssh_keys/prod_key -K -u deployer -i ./prod/hosts

to

./ssh_keys/myIP_prod_key -K -u deployer -i ./prod/hosts

Then I get the error

simon@simon-VirtualBox:~/repos/deployment/fsp-deployment-guide$

./deploy_prod.sh 
[WARNING]: provided hosts list is empty, only localhost is available


PLAY [apply common configuration to server] ************************************
skipping: no hosts matched

PLAY RECAP *********************************************************************

./ssh_keys/myip_prod_key: line 1: -----BEGIN: command not found
./ssh_keys/myip_prod_key: line 2: MIIEpAIBAAKCAQEApIpm/CRgZ06442ry3lCxQuk5S21vGhiBDphMN1EJWshk53mu: No such file or directory
./ssh_keys/myip_prod_key: line 3: SB2I/184kd9v3aUoparG9SxPGnAOWEd5YL8/Uc1ZDPVSmcNtXG50KcCqTqTaX3xV: No such file or directory 

I checked everything 2 and 3 times. Host file is as specified on the place specified. Do you have any Idea what the reason could be?

No response from server

Hi Matt,

I am really enjoying going through the deployment guide, but I am stuck at chapter 8, on page 102. I can not get the application to run, whenever I visit my domain name, the browser displays this site is not available. This is what I have done:

  • I have registered a domain on namecheap, added a record with host: 'fsp' and my server's ip address which is a Linode VPS.
  • ansible runs without any problems
  • There are no errors to be found in access.log and error.log for the nginx
    And this is the content of my nginx coya.conf file

How can I figure out what is happening without getting any logs or messages?

upstream app_server_wsgiapp {
  server localhost:8000 fail_timeout=0;
}

server {
  listen 80;
  server_name fsa.techroomdeploy.site;
  rewrite ^(.*) https://$server_name$1 permanent;
}

server {
  server_name           fsa.techroomdeploy.site;
  listen                443 ssl;
  ssl_certificate       /etc/nginx/cyoa/cyoa.crt;
  ssl_certificate_key   /etc/nginx/cyoa/cyoa.key;
  ssl_session_timeout   1d;
  ssl_session_cache     shared:SSL:50m;
  ssl_protocols         TLSv1.1 TLSv1.2;
  ssl_ciphers           'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
  ssl_prefer_server_ciphers   on;
  access_log            /var/log/nginx/fsa.techroomdeploy.site.access.log;
  error_log             /var/log/nginx/fsa.techroomdeploy.site.error.log info;
  keepalive_timeout     5;

  # nginx serve up static files and never send to the WSGI server
  location /static {
    autoindex on;
    alias /home/deployer/cyoa/cyoa/static;
  }

  location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_redirect off;
      if (!-f $request_filename) {
        proxy_pass http://app_server_wsgiapp;
        break;
    } 
  }

  # this section allows Nginx to reverse proxy for websockets
  location /socket.io {
    proxy_pass http://app_server_wsgiapp/socket.io;
    proxy_redirect off;
    proxy_buffering off;

    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
  }
}

bootstarp

When I try to run the fab bootstrap, there is something wrong, can you help me? Thanks.

The code:

(fspdeploy)➜ prod 😃 fab bootstrap
[45.79.133.206] Executing task 'bootstrap'
[localhost] local: ssh-keygen -t rsa -b 2048 -f ~/Workplace/Linode/fsp-deployment-guide/ssh_keys/45.79.133.206_prod_key
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Saving key "/Users/xuhao/Workplace/Linode/fsp-deployment-guide/ssh_keys/45.79.133.206_prod_key" failed: No such file or directory

Fatal error: local() encountered an error (return code 1) while executing 'ssh-keygen -t rsa -b 2048 -f ~/Workplace/Linode/fsp-deployment-guide/ssh_keys/45.79.133.206_prod_key'

Aborting.

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.