SlideShare ist ein Scribd-Unternehmen logo
1 von 76
Downloaden Sie, um offline zu lesen
Rock Solid Deployment
     of PHP Applications
         Pablo Godel @pgodel - codeworks.phparch.com
                 Oct 3rd 2012 - Boca Raton, FL




Wednesday, October 3, 2012
Who Am I?

    ⁃ Born in Argentina, living in the US since 1999
    ⁃ PHP & Symfony developer
    ⁃ Founder of the original PHP mailing list in spanish
    ⁃ Master of the parrilla




Wednesday, October 3, 2012
Wednesday, October 3, 2012
Wednesday, October 3, 2012
ServerGrove!


     ⁃ Founded ServerGrove Networks in 2005

     ⁃ Provider of web hosting specialized in PHP,
       Symfony, ZendFramework, MongoDB and others

     ⁃ Servers in USA (right here in Miami) and Europe!




Wednesday, October 3, 2012
Community is our teacher
           ⁃ Very active open source supporter through code
             contributions and usergroups/conference sponsoring




Wednesday, October 3, 2012
Deployment



                               ?
Wednesday, October 3, 2012
Deployment
               Software deployment is all of the activities that make
               a software system available for use.




                             http://en.wikipedia.org/wiki/Software_deployment
Wednesday, October 3, 2012
Deployment


                         A very important part of
                         the application life-cycle



Wednesday, October 3, 2012
Deployment


                A very important critical part
                of the application life-cycle



Wednesday, October 3, 2012
Deployment


                             It should not be an
                                 after thought



Wednesday, October 3, 2012
Deployment


                             It should be predictable



Wednesday, October 3, 2012
Deployment


                             The more you do it the
                                 better it goes



Wednesday, October 3, 2012
Wednesday, October 3, 2012
Deployment: Goals




Wednesday, October 3, 2012
Deployment: Goals




          One-click deploys




Wednesday, October 3, 2012
Deployment: Goals




   Continuous deploys




Wednesday, October 3, 2012
PHP Apps
                             Deployment




Wednesday, October 3, 2012
PHP Apps
                             Deployment




Wednesday, October 3, 2012
PHP Apps
                             Deployment




Wednesday, October 3, 2012
Deployment: Goals




                                        Anytime & Anywhere



Wednesday, October 3, 2012
Deployment: Goals




             Anyone




Wednesday, October 3, 2012
Deployment: Goals




                                             Reliable




Wednesday, October 3, 2012
Deployment: Goals




              Rollbacks




Wednesday, October 3, 2012
Deployment: Goals




                                           No downtime




Wednesday, October 3, 2012
Deployment: Goals




             Reusable




Wednesday, October 3, 2012
Deployment: Goals




                                            Scalable




Wednesday, October 3, 2012
Deployment: Goals


                             • One-click / continuous deploys
                             • Anytime & Anywhere
                             • Anyone
                             • No downtime
                             • Predictable & Reliable
                             • Rollbacks
                             • Reusable
                             • Scalable

Wednesday, October 3, 2012
Deployment Facts




Wednesday, October 3, 2012
Deployment: Fact #1


     Deployment starts with the developer

      • Setup development environment to be as close
        as possible to productions servers
      • Setup test/qa/staging servers
      • Use Vagrant to manage VMs
      • Use Puppet/Chef to manage OS packages/
        configuration



Wednesday, October 3, 2012
Deployment: Fact #2


     Success linked to server OS setup

      • Use Puppet/Chef to manage OS packages/
        configuration
      • Create OS packages for 3rd party software
      • Setup your own package repositories



Wednesday, October 3, 2012
Deployment: Fact #3


     Monitoring is uptime

      • Use monitoring tools to know what is going on
        with your servers (Ganglia, Cacti, Zabbix, etc.)
      • Add monitoring and metrics to your app
        (Graphite, StatsD, New Relic)
      • Use your logs wisely (Graylog, Logstash, Kibana)


Wednesday, October 3, 2012
Deployment Methodologies




Wednesday, October 3, 2012
Deployment Methodologies


                   • VIM-style
                   • FTP uploads
                   • rsync
                   • source control (svn, git)
                   • Build tools (ant, phing)
                   • Specialized tools (capistrano, fabric, etc)
                   • Package based (rpm, deb, etc)


Wednesday, October 3, 2012
Web Apps Deployment:
                       Steps overview




Wednesday, October 3, 2012
Web Apps Deployment:
                         First time


                      • Copy files to server(s)
                      • Set server-side configurations
                      • Load DB fixtures
                      • Process and install assets
                      • Warm up cache
                      • “Enable” site


Wednesday, October 3, 2012
Web Apps Deployment:
                      Subsequent times


                         • Copy files to server(s)
                         • Apply DB updates (migrations)
                         • Process and install assets
                         • Warm up cache
                         • “Enable” site


Wednesday, October 3, 2012
Deployment: Challenges




Wednesday, October 3, 2012
Deployment: Challenges

      Challenge:
      Fast & reliable copy of files


      Solutions:
      • rsync
      • git pull
      • setup git repo on local network to save
        bandwidth and avoid issues if git server is down
        (i.e. github)

Wednesday, October 3, 2012
Deployment: Challenges

      Challenge:
      Scalable


      Solutions:
      • use a tool that allows to go from 1 to n servers
        easily (i.e. capistrano)
      • pssh allows to send commands to n servers in
        parallel
      • package your app in OS packages
        like .rpm/.deb to easily install across n servers
Wednesday, October 3, 2012
Deployment: Challenges

      Challenge:
      Rollbacks


      Solutions:
      • test!
      • tag releases
      • dedicated branches (master for production)
      • deploy each release in its own directory


Wednesday, October 3, 2012
Deployment: Challenges

      Challenge:
      Secure


      Solutions:
      • use ssh based connections
      • donʼt store passwords on source control
      • store sensitive strings (passwords) in server
        environment variables


Wednesday, October 3, 2012
Deployment: Challenges

      Challenge:
      DB migrations


     Solutions:
     • Doctrine Migrations
     • Consider document oriented DBs like
       MongoDB

        “The best migrations are the ones you don’t have to do”

Wednesday, October 3, 2012
Deployment: Challenges

      Challenge:
      Static assets


      Solutions:
      • YUICompress shrinks JS and CSS file sizes
      • Enable web server compression
      • Add versioning to static assets links (code.js?v=1)
      • Assetic combines multiple files into one
      • Run utilities locally or in a staging server, deploy
        result
Wednesday, October 3, 2012
Deployment: Challenges

      Challenge:
      Caching


       Solutions:
      • Update one server while others handle load
      • Group servers and update group at a time
      • execute commands on “finalize” to clear up APC
           cache


Wednesday, October 3, 2012
Deployment: Challenges

      Challenge:
      File permission conflicts


      Solutions:
      • Run Apache/PHP with same user
      • Use php-fpm instead of mod_php
      • Create “deploy” user and add web server to the
        group
      • Use setfacl to give write access to multiple users

Wednesday, October 3, 2012
PHP Apps Deployment:
                     Other common pitfalls




Wednesday, October 3, 2012
PHP Apps Deployment:
                     Other common pitfalls
       • Case sensitive filesystems
       • Configuration differences
       • Outdated 3rd party software
       • Github down

        $ git daemon --base-path=/git/repo/path/ --
        export-all

        $ git clone git://127.0.0.1/repo

                             http://ozmm.org/posts/when_github_goes_down.html
Wednesday, October 3, 2012
PHP Apps Deployment:
                           Examples




Wednesday, October 3, 2012
PHP Apps Deployment:
                           Examples
                   Simplest continuous deployment ever!
    hook.php
         <?php

         exec(ʻ/usr/bin/env -i HOME=/var/www git pullʼ);
         echo “All done!”;


                             screenshot


Wednesday, October 3, 2012
PHP Apps Deployment:
                           Examples
                                        Capistrano

                     • Ruby based
                     • Very extensible
                     • Large number of extensions
                     • Simple client side installation


                             $ gem install capistrano


Wednesday, October 3, 2012
PHP Apps Deployment:
                           Examples
                              Capistrano

    set :application, "myapp" # Application name
    set :deploy_to, "/var/www/myapp"

    set :user, "deployer"
    set :use_sudo, false # sudo isn't required

    set :deploy_via, :remote_cache
    set :repository, "git@github.com:user/repo.git"

    role :web, "server.example.com", “server2.example.com”

Wednesday, October 3, 2012
PHP Apps Deployment:
                           Examples
                                       Capistrano




                             $ cap deploy
                             $ cap deploy:migrations
                             $ cap deploy:rollback




Wednesday, October 3, 2012
PHP Apps Deployment:
                           Examples
                             Capifony (Symfony2)

                     • Extension of Capistrano
                     • Implements lots of needed features
                       for Symfony
                     • Great documentation




Wednesday, October 3, 2012
PHP Apps Deployment:
                           Examples
                                  Capifony (Symfony2)




                             $ capifony .




Wednesday, October 3, 2012
PHP Apps Deployment:
                           Examples
                             Capifony (Symfony2)
    set :keep_releases, 3

    # directories that will be shared between all deployments
    set :shared_children, [ app_path + "/logs", web_path + "/
    uploads"]

    set :update_vendors, true
    # set :use_composer, true

    set :dump_assetic_assets, true


Wednesday, October 3, 2012
PHP Apps Deployment:
                           Examples
                                  Capifony (Symfony2)




                             $ cap deploy:setup




Wednesday, October 3, 2012
PHP Apps Deployment:
                           Examples
                                   Capifony (Symfony2)


                             |-- httpdocs
                             | `-- index.php
                             |-- releases
                             `-- shared
                                 |-- logs
                                 `-- uploads

                             5 directories, 1 file
Wednesday, October 3, 2012
PHP Apps Deployment:
                           Examples
                                  Capifony (Symfony2)




                             $ cap deploy
                             $ cap deploy:migrations
                             $ cap deploy:rollback




Wednesday, October 3, 2012
PHP Apps Deployment:
                         Other options

                     • Fabric
                     • WePloy
                     • Phing
                     • Magallanes
                     • Jenkins




Wednesday, October 3, 2012
PHP Apps Deployment:
                            Tools




Wednesday, October 3, 2012
PHP Apps Deployment:
                            Tools
                             App Metrics: StatsD & Graphite




Wednesday, October 3, 2012
PHP Apps Deployment:
                            Tools
                             Logging: Logstash
               Ship logs from any source, parse them, get the right
               timestamp, index them, and search them




Wednesday, October 3, 2012
PHP Apps Deployment:
                            Tools
                                 Logging: Logstash
 Configure Apache to log json
  LogFormat "{ "@timestamp": "%{%Y-%m-%dT%H:%M:%S%z}t", "@fields": { "client": "%a",
  "duration_usec": %D, "status": %s, "request": "%U%q", "method": "%m", "referrer": "%
  {Referer}i" } }" logstash_json


  # Write our 'logstash_json' logs to logs/access_json.log
  CustomLog logs/access_json.log logstash_json




  Result
  { "@timestamp": "2012-08-22T14:35:19-0700", "client": "127.0.0.1",
  "duration_usec": 532, "status": 404, "request": "/favicon.ico",
  "method": "GET", "referrer": "-" }



Wednesday, October 3, 2012
PHP Apps Deployment:
                            Tools
                             Logging: Graylog




Wednesday, October 3, 2012
PHP Apps Deployment:
                            Tools
                             Logging: Kibana
  Kibana is a user friendly way to view, search and visualize
  your log data




Wednesday, October 3, 2012
PHP Apps Deployment:
                            Tools
                                      Packaging: fpm
             Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.



               fpm -s dir -t rpm -n "myapp" -v 1.0 /var/www/myapp

               fpm -s dir -t deb -a all -n myapp -v 1.0 /etc/apache2/
               conf.d/my.conf /var/www/myapp



                             https://github.com/jordansissel/fpm

Wednesday, October 3, 2012
PHP Apps Deployment:
                        Time for demo




Wednesday, October 3, 2012
PHP Apps Deployment:
                           Summary




Wednesday, October 3, 2012
•Stop using FTP



Wednesday, October 3, 2012
•Stop using FTP
                             •Plan early



Wednesday, October 3, 2012
•Stop using FTP
                             •Plan early
                             •Practice


Wednesday, October 3, 2012
•Stop using FTP
                             •Plan early
                             •Practice
                             •Monitor


Wednesday, October 3, 2012
•Stop using FTP
                             •Plan early
                             •Practice
                             •Monitor
                             •AUTOMATE!

Wednesday, October 3, 2012
QUESTIONS?




                         Feedback: http://joind.in/event/view/1062
                            Slides: http://slideshare.net/pgodel
                                     Twitter: @pgodel
                             E-mail: pablo@servergrove.com
Wednesday, October 3, 2012
Thank you!




                               Feedback: https://joind.in/7227
                             Slides: http://slideshare.net/pgodel
                                      Twitter: @pgodel
                              E-mail: pablo@servergrove.com
Wednesday, October 3, 2012

Weitere ähnliche Inhalte

Andere mochten auch

Discussion continuum - Who pays for drug development?
Discussion continuum - Who pays for drug development?Discussion continuum - Who pays for drug development?
Discussion continuum - Who pays for drug development?Xplore Health
 
China, Brazil and agricultural development in Africa. Trends and contrasts
China, Brazil and agricultural development in Africa. Trends and contrastsChina, Brazil and agricultural development in Africa. Trends and contrasts
China, Brazil and agricultural development in Africa. Trends and contrastsfutureagricultures
 
I’m going to talk about
I’m going to talk aboutI’m going to talk about
I’m going to talk aboutteacherisela
 
Steve Wiggins: Rural Transformation and Transitions
Steve Wiggins: Rural Transformation and TransitionsSteve Wiggins: Rural Transformation and Transitions
Steve Wiggins: Rural Transformation and Transitionsfutureagricultures
 
Juego con vene
Juego con veneJuego con vene
Juego con veneDaisneidy
 
Мой город - Кострома, №11
Мой город - Кострома, №11Мой город - Кострома, №11
Мой город - Кострома, №11Мой город
 
Outland res. brochure 2014
Outland res. brochure 2014Outland res. brochure 2014
Outland res. brochure 2014Jessica Luth
 
Cornell Notes Parts 1 & 2
Cornell Notes Parts 1 & 2Cornell Notes Parts 1 & 2
Cornell Notes Parts 1 & 2jmori1
 
Doublerbuxtutorial
DoublerbuxtutorialDoublerbuxtutorial
Doublerbuxtutorialcutiekate78
 
الفيروسات
الفيروساتالفيروسات
الفيروساتlmooo
 
Back 2 School Night 2011
Back 2 School Night 2011Back 2 School Night 2011
Back 2 School Night 2011jmori1
 
Java peresentation new soft
Java peresentation new softJava peresentation new soft
Java peresentation new softMohamed Refaat
 

Andere mochten auch (19)

Discussion continuum - Who pays for drug development?
Discussion continuum - Who pays for drug development?Discussion continuum - Who pays for drug development?
Discussion continuum - Who pays for drug development?
 
Fails!
Fails!Fails!
Fails!
 
China, Brazil and agricultural development in Africa. Trends and contrasts
China, Brazil and agricultural development in Africa. Trends and contrastsChina, Brazil and agricultural development in Africa. Trends and contrasts
China, Brazil and agricultural development in Africa. Trends and contrasts
 
I’m going to talk about
I’m going to talk aboutI’m going to talk about
I’m going to talk about
 
Bailey
BaileyBailey
Bailey
 
Steve Wiggins: Rural Transformation and Transitions
Steve Wiggins: Rural Transformation and TransitionsSteve Wiggins: Rural Transformation and Transitions
Steve Wiggins: Rural Transformation and Transitions
 
Elastic Intelligence
Elastic IntelligenceElastic Intelligence
Elastic Intelligence
 
Juego con vene
Juego con veneJuego con vene
Juego con vene
 
Мой город - Кострома, №11
Мой город - Кострома, №11Мой город - Кострома, №11
Мой город - Кострома, №11
 
Outland res. brochure 2014
Outland res. brochure 2014Outland res. brochure 2014
Outland res. brochure 2014
 
Cornell Notes Parts 1 & 2
Cornell Notes Parts 1 & 2Cornell Notes Parts 1 & 2
Cornell Notes Parts 1 & 2
 
C 5
C 5C 5
C 5
 
Doublerbuxtutorial
DoublerbuxtutorialDoublerbuxtutorial
Doublerbuxtutorial
 
บทที่ 44
บทที่ 44บทที่ 44
บทที่ 44
 
FOCUS#5
FOCUS#5FOCUS#5
FOCUS#5
 
الفيروسات
الفيروساتالفيروسات
الفيروسات
 
How to be the employee your company can not do without
How to be the employee your company can not do withoutHow to be the employee your company can not do without
How to be the employee your company can not do without
 
Back 2 School Night 2011
Back 2 School Night 2011Back 2 School Night 2011
Back 2 School Night 2011
 
Java peresentation new soft
Java peresentation new softJava peresentation new soft
Java peresentation new soft
 

Ähnlich wie Codeworks'12 Rock Solid Deployment of PHP Apps

MongoDB - Who, What & Where!
MongoDB - Who, What & Where!MongoDB - Who, What & Where!
MongoDB - Who, What & Where!Mark Hillick
 
PFCongres 2012 - Rock Solid Deployment of PHP Apps
PFCongres 2012 - Rock Solid Deployment of PHP AppsPFCongres 2012 - Rock Solid Deployment of PHP Apps
PFCongres 2012 - Rock Solid Deployment of PHP AppsPablo Godel
 
David Glasser in Chicago - Meteor: Past, Present, & Future
David Glasser in Chicago - Meteor: Past, Present, & Future David Glasser in Chicago - Meteor: Past, Present, & Future
David Glasser in Chicago - Meteor: Past, Present, & Future yaliceme
 
Análisis de ataques APT
Análisis de ataques APT Análisis de ataques APT
Análisis de ataques APT linenoise
 
WordCamp Milwaukee 2012 - Contributing to Open Source
WordCamp Milwaukee 2012 - Contributing to Open SourceWordCamp Milwaukee 2012 - Contributing to Open Source
WordCamp Milwaukee 2012 - Contributing to Open Sourcejclermont
 
So what's a web app? introduction to the chrome web store
So what's a web app? introduction to the chrome web storeSo what's a web app? introduction to the chrome web store
So what's a web app? introduction to the chrome web storeEric Bidelman
 
Continuous Integration with Docker on AWS
Continuous Integration with Docker on AWSContinuous Integration with Docker on AWS
Continuous Integration with Docker on AWSAndrew Heifetz
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentDiego Delon
 
Amazon WorkSpaces – Fully Managed Desktops in the Cloud
Amazon WorkSpaces – Fully Managed Desktops in the CloudAmazon WorkSpaces – Fully Managed Desktops in the Cloud
Amazon WorkSpaces – Fully Managed Desktops in the CloudAmazon Web Services
 
Qualitätssicherung von Container-Images
Qualitätssicherung von Container-ImagesQualitätssicherung von Container-Images
Qualitätssicherung von Container-ImagesNicholas Dille
 
Building A SaaS with CoreOS, Docker, and Etcd
Building A SaaS with CoreOS, Docker, and EtcdBuilding A SaaS with CoreOS, Docker, and Etcd
Building A SaaS with CoreOS, Docker, and EtcdRoss Kukulinski
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentDiego Delon
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentDiego Delon
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentDiego Delon
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentDiego Delon
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentDiego Delon
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentDiego Delon
 
Tame your test environment with Docker Compose
Tame your test environment with Docker ComposeTame your test environment with Docker Compose
Tame your test environment with Docker ComposeKevin Bell
 
Intro to PHP Testing
Intro to PHP TestingIntro to PHP Testing
Intro to PHP TestingRan Mizrahi
 
Engineering culture
Engineering cultureEngineering culture
Engineering culturePamela Fox
 

Ähnlich wie Codeworks'12 Rock Solid Deployment of PHP Apps (20)

MongoDB - Who, What & Where!
MongoDB - Who, What & Where!MongoDB - Who, What & Where!
MongoDB - Who, What & Where!
 
PFCongres 2012 - Rock Solid Deployment of PHP Apps
PFCongres 2012 - Rock Solid Deployment of PHP AppsPFCongres 2012 - Rock Solid Deployment of PHP Apps
PFCongres 2012 - Rock Solid Deployment of PHP Apps
 
David Glasser in Chicago - Meteor: Past, Present, & Future
David Glasser in Chicago - Meteor: Past, Present, & Future David Glasser in Chicago - Meteor: Past, Present, & Future
David Glasser in Chicago - Meteor: Past, Present, & Future
 
Análisis de ataques APT
Análisis de ataques APT Análisis de ataques APT
Análisis de ataques APT
 
WordCamp Milwaukee 2012 - Contributing to Open Source
WordCamp Milwaukee 2012 - Contributing to Open SourceWordCamp Milwaukee 2012 - Contributing to Open Source
WordCamp Milwaukee 2012 - Contributing to Open Source
 
So what's a web app? introduction to the chrome web store
So what's a web app? introduction to the chrome web storeSo what's a web app? introduction to the chrome web store
So what's a web app? introduction to the chrome web store
 
Continuous Integration with Docker on AWS
Continuous Integration with Docker on AWSContinuous Integration with Docker on AWS
Continuous Integration with Docker on AWS
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Amazon WorkSpaces – Fully Managed Desktops in the Cloud
Amazon WorkSpaces – Fully Managed Desktops in the CloudAmazon WorkSpaces – Fully Managed Desktops in the Cloud
Amazon WorkSpaces – Fully Managed Desktops in the Cloud
 
Qualitätssicherung von Container-Images
Qualitätssicherung von Container-ImagesQualitätssicherung von Container-Images
Qualitätssicherung von Container-Images
 
Building A SaaS with CoreOS, Docker, and Etcd
Building A SaaS with CoreOS, Docker, and EtcdBuilding A SaaS with CoreOS, Docker, and Etcd
Building A SaaS with CoreOS, Docker, and Etcd
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Tame your test environment with Docker Compose
Tame your test environment with Docker ComposeTame your test environment with Docker Compose
Tame your test environment with Docker Compose
 
Intro to PHP Testing
Intro to PHP TestingIntro to PHP Testing
Intro to PHP Testing
 
Engineering culture
Engineering cultureEngineering culture
Engineering culture
 

Mehr von Pablo Godel

SymfonyCon Cluj 2017 - Symfony at OpenSky
SymfonyCon Cluj 2017 - Symfony at OpenSkySymfonyCon Cluj 2017 - Symfony at OpenSky
SymfonyCon Cluj 2017 - Symfony at OpenSkyPablo Godel
 
Symfony Live San Francisco 2017 - Symfony @ OpenSky
Symfony Live San Francisco 2017 - Symfony @ OpenSkySymfony Live San Francisco 2017 - Symfony @ OpenSky
Symfony Live San Francisco 2017 - Symfony @ OpenSkyPablo Godel
 
DeSymfony 2017 - Symfony en OpenSky
DeSymfony 2017 - Symfony en OpenSkyDeSymfony 2017 - Symfony en OpenSky
DeSymfony 2017 - Symfony en OpenSkyPablo Godel
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony AppsSymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony AppsPablo Godel
 
La Caja de Herramientas del Desarrollador Moderno PHPConferenceAR
La Caja de Herramientas del Desarrollador Moderno PHPConferenceARLa Caja de Herramientas del Desarrollador Moderno PHPConferenceAR
La Caja de Herramientas del Desarrollador Moderno PHPConferenceARPablo Godel
 
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 -  Rock Solid Deployment of Symfony AppsSymfony Live NYC 2014 -  Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony AppsPablo Godel
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer ToolboxPablo Godel
 
PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...
PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...
PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...Pablo Godel
 
PHP Conference Argentina 2013 - Deployment de aplicaciones PHP a prueba de balas
PHP Conference Argentina 2013 - Deployment de aplicaciones PHP a prueba de balasPHP Conference Argentina 2013 - Deployment de aplicaciones PHP a prueba de balas
PHP Conference Argentina 2013 - Deployment de aplicaciones PHP a prueba de balasPablo Godel
 
php[architect] Summit Series DevOps 2013 - Rock solid deployment of PHP apps
php[architect] Summit Series DevOps 2013 - Rock solid deployment of PHP appsphp[architect] Summit Series DevOps 2013 - Rock solid deployment of PHP apps
php[architect] Summit Series DevOps 2013 - Rock solid deployment of PHP appsPablo Godel
 
Lone Star PHP 2013 - Sysadmin Skills for PHP Developers
Lone Star PHP 2013 - Sysadmin Skills for PHP DevelopersLone Star PHP 2013 - Sysadmin Skills for PHP Developers
Lone Star PHP 2013 - Sysadmin Skills for PHP DevelopersPablo Godel
 
Lone StarPHP 2013 - Building Web Apps from a New Angle
Lone StarPHP 2013 - Building Web Apps from a New AngleLone StarPHP 2013 - Building Web Apps from a New Angle
Lone StarPHP 2013 - Building Web Apps from a New AnglePablo Godel
 
deSymfony 2013 - Creando aplicaciones web desde otro ángulo con Symfony y A...
deSymfony 2013 -  Creando aplicaciones web desde otro ángulo con Symfony y A...deSymfony 2013 -  Creando aplicaciones web desde otro ángulo con Symfony y A...
deSymfony 2013 - Creando aplicaciones web desde otro ángulo con Symfony y A...Pablo Godel
 
Creating Mobile Apps With PHP & Symfony2
Creating Mobile Apps With PHP & Symfony2Creating Mobile Apps With PHP & Symfony2
Creating Mobile Apps With PHP & Symfony2Pablo Godel
 
Tek13 - Creating Mobile Apps with PHP and Symfony
Tek13 - Creating Mobile Apps with PHP and SymfonyTek13 - Creating Mobile Apps with PHP and Symfony
Tek13 - Creating Mobile Apps with PHP and SymfonyPablo Godel
 
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSTek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSPablo Godel
 
Soflophp 2013 - SysAdmin skills for PHP developers
Soflophp 2013 - SysAdmin skills for PHP developersSoflophp 2013 - SysAdmin skills for PHP developers
Soflophp 2013 - SysAdmin skills for PHP developersPablo Godel
 
Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013   Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013 Pablo Godel
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsPablo Godel
 

Mehr von Pablo Godel (20)

SymfonyCon Cluj 2017 - Symfony at OpenSky
SymfonyCon Cluj 2017 - Symfony at OpenSkySymfonyCon Cluj 2017 - Symfony at OpenSky
SymfonyCon Cluj 2017 - Symfony at OpenSky
 
Symfony Live San Francisco 2017 - Symfony @ OpenSky
Symfony Live San Francisco 2017 - Symfony @ OpenSkySymfony Live San Francisco 2017 - Symfony @ OpenSky
Symfony Live San Francisco 2017 - Symfony @ OpenSky
 
DeSymfony 2017 - Symfony en OpenSky
DeSymfony 2017 - Symfony en OpenSkyDeSymfony 2017 - Symfony en OpenSky
DeSymfony 2017 - Symfony en OpenSky
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony AppsSymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
 
La Caja de Herramientas del Desarrollador Moderno PHPConferenceAR
La Caja de Herramientas del Desarrollador Moderno PHPConferenceARLa Caja de Herramientas del Desarrollador Moderno PHPConferenceAR
La Caja de Herramientas del Desarrollador Moderno PHPConferenceAR
 
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 -  Rock Solid Deployment of Symfony AppsSymfony Live NYC 2014 -  Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...
PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...
PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...
 
PHP Conference Argentina 2013 - Deployment de aplicaciones PHP a prueba de balas
PHP Conference Argentina 2013 - Deployment de aplicaciones PHP a prueba de balasPHP Conference Argentina 2013 - Deployment de aplicaciones PHP a prueba de balas
PHP Conference Argentina 2013 - Deployment de aplicaciones PHP a prueba de balas
 
php[architect] Summit Series DevOps 2013 - Rock solid deployment of PHP apps
php[architect] Summit Series DevOps 2013 - Rock solid deployment of PHP appsphp[architect] Summit Series DevOps 2013 - Rock solid deployment of PHP apps
php[architect] Summit Series DevOps 2013 - Rock solid deployment of PHP apps
 
Lone Star PHP 2013 - Sysadmin Skills for PHP Developers
Lone Star PHP 2013 - Sysadmin Skills for PHP DevelopersLone Star PHP 2013 - Sysadmin Skills for PHP Developers
Lone Star PHP 2013 - Sysadmin Skills for PHP Developers
 
Lone StarPHP 2013 - Building Web Apps from a New Angle
Lone StarPHP 2013 - Building Web Apps from a New AngleLone StarPHP 2013 - Building Web Apps from a New Angle
Lone StarPHP 2013 - Building Web Apps from a New Angle
 
deSymfony 2013 - Creando aplicaciones web desde otro ángulo con Symfony y A...
deSymfony 2013 -  Creando aplicaciones web desde otro ángulo con Symfony y A...deSymfony 2013 -  Creando aplicaciones web desde otro ángulo con Symfony y A...
deSymfony 2013 - Creando aplicaciones web desde otro ángulo con Symfony y A...
 
Creating Mobile Apps With PHP & Symfony2
Creating Mobile Apps With PHP & Symfony2Creating Mobile Apps With PHP & Symfony2
Creating Mobile Apps With PHP & Symfony2
 
Tek13 - Creating Mobile Apps with PHP and Symfony
Tek13 - Creating Mobile Apps with PHP and SymfonyTek13 - Creating Mobile Apps with PHP and Symfony
Tek13 - Creating Mobile Apps with PHP and Symfony
 
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSTek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJS
 
Soflophp 2013 - SysAdmin skills for PHP developers
Soflophp 2013 - SysAdmin skills for PHP developersSoflophp 2013 - SysAdmin skills for PHP developers
Soflophp 2013 - SysAdmin skills for PHP developers
 
Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013   Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web Applications
 

Kürzlich hochgeladen

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 

Kürzlich hochgeladen (20)

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

Codeworks'12 Rock Solid Deployment of PHP Apps

  • 1. Rock Solid Deployment of PHP Applications Pablo Godel @pgodel - codeworks.phparch.com Oct 3rd 2012 - Boca Raton, FL Wednesday, October 3, 2012
  • 2. Who Am I? ⁃ Born in Argentina, living in the US since 1999 ⁃ PHP & Symfony developer ⁃ Founder of the original PHP mailing list in spanish ⁃ Master of the parrilla Wednesday, October 3, 2012
  • 5. ServerGrove! ⁃ Founded ServerGrove Networks in 2005 ⁃ Provider of web hosting specialized in PHP, Symfony, ZendFramework, MongoDB and others ⁃ Servers in USA (right here in Miami) and Europe! Wednesday, October 3, 2012
  • 6. Community is our teacher ⁃ Very active open source supporter through code contributions and usergroups/conference sponsoring Wednesday, October 3, 2012
  • 7. Deployment ? Wednesday, October 3, 2012
  • 8. Deployment Software deployment is all of the activities that make a software system available for use. http://en.wikipedia.org/wiki/Software_deployment Wednesday, October 3, 2012
  • 9. Deployment A very important part of the application life-cycle Wednesday, October 3, 2012
  • 10. Deployment A very important critical part of the application life-cycle Wednesday, October 3, 2012
  • 11. Deployment It should not be an after thought Wednesday, October 3, 2012
  • 12. Deployment It should be predictable Wednesday, October 3, 2012
  • 13. Deployment The more you do it the better it goes Wednesday, October 3, 2012
  • 16. Deployment: Goals One-click deploys Wednesday, October 3, 2012
  • 17. Deployment: Goals Continuous deploys Wednesday, October 3, 2012
  • 18. PHP Apps Deployment Wednesday, October 3, 2012
  • 19. PHP Apps Deployment Wednesday, October 3, 2012
  • 20. PHP Apps Deployment Wednesday, October 3, 2012
  • 21. Deployment: Goals Anytime & Anywhere Wednesday, October 3, 2012
  • 22. Deployment: Goals Anyone Wednesday, October 3, 2012
  • 23. Deployment: Goals Reliable Wednesday, October 3, 2012
  • 24. Deployment: Goals Rollbacks Wednesday, October 3, 2012
  • 25. Deployment: Goals No downtime Wednesday, October 3, 2012
  • 26. Deployment: Goals Reusable Wednesday, October 3, 2012
  • 27. Deployment: Goals Scalable Wednesday, October 3, 2012
  • 28. Deployment: Goals • One-click / continuous deploys • Anytime & Anywhere • Anyone • No downtime • Predictable & Reliable • Rollbacks • Reusable • Scalable Wednesday, October 3, 2012
  • 30. Deployment: Fact #1 Deployment starts with the developer • Setup development environment to be as close as possible to productions servers • Setup test/qa/staging servers • Use Vagrant to manage VMs • Use Puppet/Chef to manage OS packages/ configuration Wednesday, October 3, 2012
  • 31. Deployment: Fact #2 Success linked to server OS setup • Use Puppet/Chef to manage OS packages/ configuration • Create OS packages for 3rd party software • Setup your own package repositories Wednesday, October 3, 2012
  • 32. Deployment: Fact #3 Monitoring is uptime • Use monitoring tools to know what is going on with your servers (Ganglia, Cacti, Zabbix, etc.) • Add monitoring and metrics to your app (Graphite, StatsD, New Relic) • Use your logs wisely (Graylog, Logstash, Kibana) Wednesday, October 3, 2012
  • 34. Deployment Methodologies • VIM-style • FTP uploads • rsync • source control (svn, git) • Build tools (ant, phing) • Specialized tools (capistrano, fabric, etc) • Package based (rpm, deb, etc) Wednesday, October 3, 2012
  • 35. Web Apps Deployment: Steps overview Wednesday, October 3, 2012
  • 36. Web Apps Deployment: First time • Copy files to server(s) • Set server-side configurations • Load DB fixtures • Process and install assets • Warm up cache • “Enable” site Wednesday, October 3, 2012
  • 37. Web Apps Deployment: Subsequent times • Copy files to server(s) • Apply DB updates (migrations) • Process and install assets • Warm up cache • “Enable” site Wednesday, October 3, 2012
  • 39. Deployment: Challenges Challenge: Fast & reliable copy of files Solutions: • rsync • git pull • setup git repo on local network to save bandwidth and avoid issues if git server is down (i.e. github) Wednesday, October 3, 2012
  • 40. Deployment: Challenges Challenge: Scalable Solutions: • use a tool that allows to go from 1 to n servers easily (i.e. capistrano) • pssh allows to send commands to n servers in parallel • package your app in OS packages like .rpm/.deb to easily install across n servers Wednesday, October 3, 2012
  • 41. Deployment: Challenges Challenge: Rollbacks Solutions: • test! • tag releases • dedicated branches (master for production) • deploy each release in its own directory Wednesday, October 3, 2012
  • 42. Deployment: Challenges Challenge: Secure Solutions: • use ssh based connections • donʼt store passwords on source control • store sensitive strings (passwords) in server environment variables Wednesday, October 3, 2012
  • 43. Deployment: Challenges Challenge: DB migrations Solutions: • Doctrine Migrations • Consider document oriented DBs like MongoDB “The best migrations are the ones you don’t have to do” Wednesday, October 3, 2012
  • 44. Deployment: Challenges Challenge: Static assets Solutions: • YUICompress shrinks JS and CSS file sizes • Enable web server compression • Add versioning to static assets links (code.js?v=1) • Assetic combines multiple files into one • Run utilities locally or in a staging server, deploy result Wednesday, October 3, 2012
  • 45. Deployment: Challenges Challenge: Caching Solutions: • Update one server while others handle load • Group servers and update group at a time • execute commands on “finalize” to clear up APC cache Wednesday, October 3, 2012
  • 46. Deployment: Challenges Challenge: File permission conflicts Solutions: • Run Apache/PHP with same user • Use php-fpm instead of mod_php • Create “deploy” user and add web server to the group • Use setfacl to give write access to multiple users Wednesday, October 3, 2012
  • 47. PHP Apps Deployment: Other common pitfalls Wednesday, October 3, 2012
  • 48. PHP Apps Deployment: Other common pitfalls • Case sensitive filesystems • Configuration differences • Outdated 3rd party software • Github down $ git daemon --base-path=/git/repo/path/ -- export-all $ git clone git://127.0.0.1/repo http://ozmm.org/posts/when_github_goes_down.html Wednesday, October 3, 2012
  • 49. PHP Apps Deployment: Examples Wednesday, October 3, 2012
  • 50. PHP Apps Deployment: Examples Simplest continuous deployment ever! hook.php <?php exec(ʻ/usr/bin/env -i HOME=/var/www git pullʼ); echo “All done!”; screenshot Wednesday, October 3, 2012
  • 51. PHP Apps Deployment: Examples Capistrano • Ruby based • Very extensible • Large number of extensions • Simple client side installation $ gem install capistrano Wednesday, October 3, 2012
  • 52. PHP Apps Deployment: Examples Capistrano set :application, "myapp" # Application name set :deploy_to, "/var/www/myapp" set :user, "deployer" set :use_sudo, false # sudo isn't required set :deploy_via, :remote_cache set :repository, "git@github.com:user/repo.git" role :web, "server.example.com", “server2.example.com” Wednesday, October 3, 2012
  • 53. PHP Apps Deployment: Examples Capistrano $ cap deploy $ cap deploy:migrations $ cap deploy:rollback Wednesday, October 3, 2012
  • 54. PHP Apps Deployment: Examples Capifony (Symfony2) • Extension of Capistrano • Implements lots of needed features for Symfony • Great documentation Wednesday, October 3, 2012
  • 55. PHP Apps Deployment: Examples Capifony (Symfony2) $ capifony . Wednesday, October 3, 2012
  • 56. PHP Apps Deployment: Examples Capifony (Symfony2) set :keep_releases, 3 # directories that will be shared between all deployments set :shared_children, [ app_path + "/logs", web_path + "/ uploads"] set :update_vendors, true # set :use_composer, true set :dump_assetic_assets, true Wednesday, October 3, 2012
  • 57. PHP Apps Deployment: Examples Capifony (Symfony2) $ cap deploy:setup Wednesday, October 3, 2012
  • 58. PHP Apps Deployment: Examples Capifony (Symfony2) |-- httpdocs | `-- index.php |-- releases `-- shared |-- logs `-- uploads 5 directories, 1 file Wednesday, October 3, 2012
  • 59. PHP Apps Deployment: Examples Capifony (Symfony2) $ cap deploy $ cap deploy:migrations $ cap deploy:rollback Wednesday, October 3, 2012
  • 60. PHP Apps Deployment: Other options • Fabric • WePloy • Phing • Magallanes • Jenkins Wednesday, October 3, 2012
  • 61. PHP Apps Deployment: Tools Wednesday, October 3, 2012
  • 62. PHP Apps Deployment: Tools App Metrics: StatsD & Graphite Wednesday, October 3, 2012
  • 63. PHP Apps Deployment: Tools Logging: Logstash Ship logs from any source, parse them, get the right timestamp, index them, and search them Wednesday, October 3, 2012
  • 64. PHP Apps Deployment: Tools Logging: Logstash Configure Apache to log json LogFormat "{ "@timestamp": "%{%Y-%m-%dT%H:%M:%S%z}t", "@fields": { "client": "%a", "duration_usec": %D, "status": %s, "request": "%U%q", "method": "%m", "referrer": "% {Referer}i" } }" logstash_json # Write our 'logstash_json' logs to logs/access_json.log CustomLog logs/access_json.log logstash_json Result { "@timestamp": "2012-08-22T14:35:19-0700", "client": "127.0.0.1", "duration_usec": 532, "status": 404, "request": "/favicon.ico", "method": "GET", "referrer": "-" } Wednesday, October 3, 2012
  • 65. PHP Apps Deployment: Tools Logging: Graylog Wednesday, October 3, 2012
  • 66. PHP Apps Deployment: Tools Logging: Kibana Kibana is a user friendly way to view, search and visualize your log data Wednesday, October 3, 2012
  • 67. PHP Apps Deployment: Tools Packaging: fpm Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity. fpm -s dir -t rpm -n "myapp" -v 1.0 /var/www/myapp fpm -s dir -t deb -a all -n myapp -v 1.0 /etc/apache2/ conf.d/my.conf /var/www/myapp https://github.com/jordansissel/fpm Wednesday, October 3, 2012
  • 68. PHP Apps Deployment: Time for demo Wednesday, October 3, 2012
  • 69. PHP Apps Deployment: Summary Wednesday, October 3, 2012
  • 70. •Stop using FTP Wednesday, October 3, 2012
  • 71. •Stop using FTP •Plan early Wednesday, October 3, 2012
  • 72. •Stop using FTP •Plan early •Practice Wednesday, October 3, 2012
  • 73. •Stop using FTP •Plan early •Practice •Monitor Wednesday, October 3, 2012
  • 74. •Stop using FTP •Plan early •Practice •Monitor •AUTOMATE! Wednesday, October 3, 2012
  • 75. QUESTIONS? Feedback: http://joind.in/event/view/1062 Slides: http://slideshare.net/pgodel Twitter: @pgodel E-mail: pablo@servergrove.com Wednesday, October 3, 2012
  • 76. Thank you! Feedback: https://joind.in/7227 Slides: http://slideshare.net/pgodel Twitter: @pgodel E-mail: pablo@servergrove.com Wednesday, October 3, 2012