SlideShare a Scribd company logo
1 of 74
Configuring WordPress for
         Multiple Environments



#WCChicago 7/30 - 7/31/11
Who am I?
      Jason McCreary
      jmccreary@viastudio.com
      @gonedark


      •   Louisville, KY

      •   Production Lead at VIA Studio

      •   Web Developer since 1999

      •   PHP since version 3

      •   Active StackOverflow member

      •   http://jason.pureconcepts.net (shhh!
          It’s not WordPress, yet...)


#WCChicago 7/30 - 7/31/11
Who are you?




#WCChicago 7/30 - 7/31/11
Who are you?
        • How many people...




#WCChicago 7/30 - 7/31/11
Who are you?
        • How many people...
         • Use WordPress?



#WCChicago 7/30 - 7/31/11
Who are you?
        • How many people...
         • Use WordPress?
         • Responsible for managing your install?


#WCChicago 7/30 - 7/31/11
Who are you?
        • How many people...
         • Use WordPress?
         • Responsible for managing your install?
         • Use a development or test environment?

#WCChicago 7/30 - 7/31/11
Who are you?
        • How many people...
         • Use WordPress?
         • Responsible for managing your install?
         • Use a development or test environment?
         • WordPress in a distributed enviroment?
#WCChicago 7/30 - 7/31/11
The Talk




#WCChicago 7/30 - 7/31/11
The Talk
        • Configuring WordPress for Multiple Environments




#WCChicago 7/30 - 7/31/11
The Talk
        • Configuring WordPress for Multiple Environments
        • It’s not that advanced, really!




#WCChicago 7/30 - 7/31/11
The Talk
        • Configuring WordPress for Multiple Environments
        • It’s not that advanced, really!
        • Examine WordPress component parts



#WCChicago 7/30 - 7/31/11
The Talk
        • Configuring WordPress for Multiple Environments
        • It’s not that advanced, really!
        • Examine WordPress component parts
        • Some slides


#WCChicago 7/30 - 7/31/11
The Talk
        • Configuring WordPress for Multiple Environments
        • It’s not that advanced, really!
        • Examine WordPress component parts
        • Some slides
        • Some demos

#WCChicago 7/30 - 7/31/11
The Talk
        • Configuring WordPress for Multiple Environments
        • It’s not that advanced, really!
        • Examine WordPress component parts
        • Some slides
        • Some demos
        • Please ask questions
#WCChicago 7/30 - 7/31/11
“We have to be careful [...] people might think
       WordPress is a real CMS, useful for more than just
                            a blog.”




#WCChicago 7/30 - 7/31/11
“We have to be careful [...] people might think
       WordPress is a real CMS, useful for more than just
                            a blog.”
                                  Matt Mullenburg
                                  WordPress Wins CMS Award




#WCChicago 7/30 - 7/31/11
“We have to be careful [...] people might think
       WordPress is a real CMS, useful for more than just
                            a blog.”
                                    Matt Mullenburg
                                    WordPress Wins CMS Award

        “[...] instances of the phrase ‘WordPress blog’ are
        gone from the core source files, replaced with the
             all-encompassing phrase ‘WordPress site.’”
                                    Andrew Nacin
                                    Changeset 14315

#WCChicago 7/30 - 7/31/11
“Any serious development project should follow a
        software development lifecycle.This implies source
       code management and at least a development and
        production environment. Unfortunately WordPress
       doesn’t really scale well in this area out of the box.”




#WCChicago 7/30 - 7/31/11
“Any serious development project should follow a
        software development lifecycle.This implies source
       code management and at least a development and
        production environment. Unfortunately WordPress
       doesn’t really scale well in this area out of the box.”
                                        Jason McCreary
                                        http://bit.ly/r8jFm3



#WCChicago 7/30 - 7/31/11
Demo: 5 minute install...


#WCChicago 7/30 - 7/31/11
#WCChicago 7/30 - 7/31/11
#WCChicago 7/30 - 7/31/11
• We setup WordPress for one environment...




#WCChicago 7/30 - 7/31/11
• We setup WordPress for one environment...
        • But I have other environments...



#WCChicago 7/30 - 7/31/11
• We setup WordPress for one environment...
        • But I have other environments...
        • Do I have to do the install again?


#WCChicago 7/30 - 7/31/11
• We setup WordPress for one environment...
        • But I have other environments...
        • Do I have to do the install again?
        • What happens after install?

#WCChicago 7/30 - 7/31/11
• We setup WordPress for one environment...
        • But I have other environments...
        • Do I have to do the install again?
        • What happens after install?
        • I’m confused...
#WCChicago 7/30 - 7/31/11
Multiple Environments




#WCChicago 7/30 - 7/31/11
Multiple Environments




#WCChicago 7/30 - 7/31/11
Multiple Environments



               }
   Production


         Staging



Development


 #WCChicago 7/30 - 7/31/11
Multiple Environments



               }{
   Production


         Staging



Development


 #WCChicago 7/30 - 7/31/11
Multiple Environments



               }{
   Production


         Staging



Development


 #WCChicago 7/30 - 7/31/11   Version Control
Multiple Environments



               }{
   Production


         Staging



Development


 #WCChicago 7/30 - 7/31/11   wp-config   Version Control
Multiple Environments



               }{
   Production


         Staging



Development


 #WCChicago 7/30 - 7/31/11   wp-config   Version Control
Multiple Environments



               }{
   Production


         Staging



Development


 #WCChicago 7/30 - 7/31/11   wp-config   Version Control
Multiple Environments



               }{
   Production


         Staging



Development


 #WCChicago 7/30 - 7/31/11   wp-config   Version Control
Database Configuration




#WCChicago 7/30 - 7/31/11
Database Configuration
         // MySQL settings
         /** The name of the database for WordPress */
         define('DB_NAME', 'database_name_dev');

         /** MySQL database username */
         define('DB_USER', 'dbuser');

         /** MySQL database password */
         define('DB_PASSWORD', 'dbpass');

         /** MySQL hostname */
         define('DB_HOST', 'localhost');




#WCChicago 7/30 - 7/31/11
Database Configuration
         // MySQL settings
         /** The name of the database for WordPress */
         define('DB_NAME', 'database_name_dev');

         /** MySQL database username */
         define('DB_USER', 'dbuser');

         /** MySQL database password */
         define('DB_PASSWORD', 'dbpass');

         /** MySQL hostname */
         define('DB_HOST', 'localhost');




#WCChicago 7/30 - 7/31/11
Demo: wp-config-env.php


#WCChicago 7/30 - 7/31/11
What have we done...




#WCChicago 7/30 - 7/31/11
What have we done...

            By sniffing out the runtime environment we’ve
             extended wp-config.php with a configuration
            specific for that environment. This allows us to
               run a production-ready WordPress install
             smoothly on multiple, different environments.



#WCChicago 7/30 - 7/31/11
“As part of the WordPress installation, you must
           modify the wp-config.php file to define the
               WordPress configuration settings...”




#WCChicago 7/30 - 7/31/11
“As part of the WordPress installation, you must
           modify the wp-config.php file to define the
               WordPress configuration settings...”
                                         Codex




#WCChicago 7/30 - 7/31/11
Development




#WCChicago 7/30 - 7/31/11
Development
        • CONSTANTS for environment awareness




#WCChicago 7/30 - 7/31/11
Development
        • CONSTANTS for environment awareness
 /** wp-config-dev.php **/
 // used to determine environment from easily accessible constant
 define('VIA_ENVIRONMENT', 'dev');




#WCChicago 7/30 - 7/31/11
Development
        • CONSTANTS for environment awareness
 /** wp-config-dev.php **/
 // used to determine environment from easily accessible constant
 define('VIA_ENVIRONMENT', 'dev');


        • Configuring Plugins


#WCChicago 7/30 - 7/31/11
Development
        • CONSTANTS for environment awareness
 /** wp-config-dev.php **/
 // used to determine environment from easily accessible constant
 define('VIA_ENVIRONMENT', 'dev');


        • Configuring Plugins
 /** wp-config-prod.php **/
 // turn on caching
 define('WP_CACHE', true);




#WCChicago 7/30 - 7/31/11
Demo: Development


#WCChicago 7/30 - 7/31/11
Deployment




#WCChicago 7/30 - 7/31/11
Deployment
        •   Database




#WCChicago 7/30 - 7/31/11
Deployment
        •   Database
            •   mysqldump entire database




#WCChicago 7/30 - 7/31/11
Deployment
        •   Database
            •   mysqldump entire database

            •   WordPress Import/Export




#WCChicago 7/30 - 7/31/11
Deployment
        •   Database
            •   mysqldump entire database

            •   WordPress Import/Export
        •   WordPress Files




#WCChicago 7/30 - 7/31/11
Deployment
        •   Database
            •   mysqldump entire database

            •   WordPress Import/Export
        •   WordPress Files
            •   Version Control (SVN, Git, etc)




#WCChicago 7/30 - 7/31/11
Deployment
        •   Database
            •   mysqldump entire database

            •   WordPress Import/Export
        •   WordPress Files
            •   Version Control (SVN, Git, etc)
            •   FTP sFTP/SSH




#WCChicago 7/30 - 7/31/11
Deployment
        •   Database
            •   mysqldump entire database

            •   WordPress Import/Export
        •   WordPress Files
            •   Version Control (SVN, Git, etc)
            •   FTP sFTP/SSH
        •   Resource Files



#WCChicago 7/30 - 7/31/11
Deployment
        •   Database
            •   mysqldump entire database

            •   WordPress Import/Export
        •   WordPress Files
            •   Version Control (SVN, Git, etc)
            •   FTP sFTP/SSH
        •   Resource Files
            •   FTP sFTP/SSH

#WCChicago 7/30 - 7/31/11
Other Tips




#WCChicago 7/30 - 7/31/11
Other Tips
        • Avoid absolute paths




#WCChicago 7/30 - 7/31/11
Other Tips
        • Avoid absolute paths
        • Use symlinks for shared directories (e.g.
            uploads/)




#WCChicago 7/30 - 7/31/11
Other Tips
        • Avoid absolute paths
        • Use symlinks for shared directories (e.g.
            uploads/)
        • Just move what you need (e.g. wp_posts)


#WCChicago 7/30 - 7/31/11
Other Tips
        • Avoid absolute paths
        • Use symlinks for shared directories (e.g.
            uploads/)
        • Just move what you need (e.g. wp_posts)
        • Don’t forget your environment constant
            (e.g. VIA_ENVIRONMENT)



#WCChicago 7/30 - 7/31/11
Other Tips
        • Avoid absolute paths
        • Use symlinks for shared directories (e.g.
            uploads/)
        • Just move what you need (e.g. wp_posts)
        • Don’t forget your environment constant
            (e.g. VIA_ENVIRONMENT)

        • Migration scripts are your friend
#WCChicago 7/30 - 7/31/11
The Process




#WCChicago 7/30 - 7/31/11
The Process
        1. Do the 5 minute production install




#WCChicago 7/30 - 7/31/11
The Process
        1. Do the 5 minute production install
        2. Include environment specific wp-config.php




#WCChicago 7/30 - 7/31/11
The Process
        1. Do the 5 minute production install
        2. Include environment specific wp-config.php
        3. Setup your environments




#WCChicago 7/30 - 7/31/11
The Process
        1. Do the 5 minute production install
        2. Include environment specific wp-config.php
        3. Setup your environments
        4. Develop




#WCChicago 7/30 - 7/31/11
The Process
        1. Do the 5 minute production install
        2. Include environment specific wp-config.php
        3. Setup your environments
        4. Develop
        5. Deploy



#WCChicago 7/30 - 7/31/11
The Process
        1. Do the 5 minute production install
        2. Include environment specific wp-config.php
        3. Setup your environments
        4. Develop
        5. Deploy
        6. Repeat 4 and 5

#WCChicago 7/30 - 7/31/11
Questions


#WCChicago 7/30 - 7/31/11

More Related Content

Similar to Configuring WordPress for Multiple Environments

(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins PipelinesSteffen Gebert
 
Deep-dive into APIs in a Microservice Architecture
Deep-dive into APIs in a Microservice ArchitectureDeep-dive into APIs in a Microservice Architecture
Deep-dive into APIs in a Microservice ArchitectureWSO2
 
Diet Pills, SEO & Theme Frameworks: There are no magic bullets.
Diet Pills, SEO & Theme Frameworks: There are no magic bullets.Diet Pills, SEO & Theme Frameworks: There are no magic bullets.
Diet Pills, SEO & Theme Frameworks: There are no magic bullets.Andy Stratton
 
Developing for Success -or- Any Fool Can Do This
Developing for Success -or- Any Fool Can Do ThisDeveloping for Success -or- Any Fool Can Do This
Developing for Success -or- Any Fool Can Do ThisBrian Richards
 
Developer: You are the Project Manager
Developer: You are the Project ManagerDeveloper: You are the Project Manager
Developer: You are the Project ManagerRachel Baker
 
Creating Scalable JVM/Java Apps on Heroku
Creating Scalable JVM/Java Apps on HerokuCreating Scalable JVM/Java Apps on Heroku
Creating Scalable JVM/Java Apps on HerokuJoe Kutner
 
Debugging WordPress Core and Plugins!
Debugging WordPress Core and Plugins!Debugging WordPress Core and Plugins!
Debugging WordPress Core and Plugins!Bronson Quick
 
Ahmadabad mule soft_meetup_6march2021_azure_CICD
Ahmadabad mule soft_meetup_6march2021_azure_CICDAhmadabad mule soft_meetup_6march2021_azure_CICD
Ahmadabad mule soft_meetup_6march2021_azure_CICDShekh Muenuddeen
 
Front End Development for Back End Developers - Devoxx UK 2017
 Front End Development for Back End Developers - Devoxx UK 2017 Front End Development for Back End Developers - Devoxx UK 2017
Front End Development for Back End Developers - Devoxx UK 2017Matt Raible
 
Building a production-ready, fully-scalable Docker Swarm using Terraform & Pa...
Building a production-ready, fully-scalable Docker Swarm using Terraform & Pa...Building a production-ready, fully-scalable Docker Swarm using Terraform & Pa...
Building a production-ready, fully-scalable Docker Swarm using Terraform & Pa...Outlyer
 
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins PipelinesAn Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins PipelinesSteffen Gebert
 
Java sur Azure: OpenJDK mieux que vous n'avez jamais osé le demander ...
Java sur Azure: OpenJDK mieux que vous n'avez jamais osé le demander ...Java sur Azure: OpenJDK mieux que vous n'avez jamais osé le demander ...
Java sur Azure: OpenJDK mieux que vous n'avez jamais osé le demander ...Microsoft
 
No More “Cowboy Coding”: A Best Practices Guide to Local Development & Migration
No More “Cowboy Coding”: A Best Practices Guide to Local Development & MigrationNo More “Cowboy Coding”: A Best Practices Guide to Local Development & Migration
No More “Cowboy Coding”: A Best Practices Guide to Local Development & Migrationpodsframework
 
Vagrant and puppet: Deployment made easy
Vagrant and puppet: Deployment made easyVagrant and puppet: Deployment made easy
Vagrant and puppet: Deployment made easyGeronimo Orozco
 
Containers: DevOp Enablers of Technical Solutions
Containers: DevOp Enablers of Technical SolutionsContainers: DevOp Enablers of Technical Solutions
Containers: DevOp Enablers of Technical SolutionsJules Pierre-Louis
 
CoreOS at Carnival
CoreOS at CarnivalCoreOS at Carnival
CoreOS at CarnivalToby Cox
 
CoreOS at Carnival
CoreOS at CarnivalCoreOS at Carnival
CoreOS at CarnivalToby Cox
 
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...Publicis Sapient Engineering
 

Similar to Configuring WordPress for Multiple Environments (20)

(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
 
Deep-dive into APIs in a Microservice Architecture
Deep-dive into APIs in a Microservice ArchitectureDeep-dive into APIs in a Microservice Architecture
Deep-dive into APIs in a Microservice Architecture
 
Diet Pills, SEO & Theme Frameworks: There are no magic bullets.
Diet Pills, SEO & Theme Frameworks: There are no magic bullets.Diet Pills, SEO & Theme Frameworks: There are no magic bullets.
Diet Pills, SEO & Theme Frameworks: There are no magic bullets.
 
Developing for Success -or- Any Fool Can Do This
Developing for Success -or- Any Fool Can Do ThisDeveloping for Success -or- Any Fool Can Do This
Developing for Success -or- Any Fool Can Do This
 
Developer: You are the Project Manager
Developer: You are the Project ManagerDeveloper: You are the Project Manager
Developer: You are the Project Manager
 
Creating Scalable JVM/Java Apps on Heroku
Creating Scalable JVM/Java Apps on HerokuCreating Scalable JVM/Java Apps on Heroku
Creating Scalable JVM/Java Apps on Heroku
 
Debugging WordPress Core and Plugins!
Debugging WordPress Core and Plugins!Debugging WordPress Core and Plugins!
Debugging WordPress Core and Plugins!
 
Ahmadabad mule soft_meetup_6march2021_azure_CICD
Ahmadabad mule soft_meetup_6march2021_azure_CICDAhmadabad mule soft_meetup_6march2021_azure_CICD
Ahmadabad mule soft_meetup_6march2021_azure_CICD
 
Front End Development for Back End Developers - Devoxx UK 2017
 Front End Development for Back End Developers - Devoxx UK 2017 Front End Development for Back End Developers - Devoxx UK 2017
Front End Development for Back End Developers - Devoxx UK 2017
 
Pp docker-swarm-doxlon-28th-march-2017
Pp docker-swarm-doxlon-28th-march-2017Pp docker-swarm-doxlon-28th-march-2017
Pp docker-swarm-doxlon-28th-march-2017
 
Building a production-ready, fully-scalable Docker Swarm using Terraform & Pa...
Building a production-ready, fully-scalable Docker Swarm using Terraform & Pa...Building a production-ready, fully-scalable Docker Swarm using Terraform & Pa...
Building a production-ready, fully-scalable Docker Swarm using Terraform & Pa...
 
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins PipelinesAn Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
 
Java sur Azure: OpenJDK mieux que vous n'avez jamais osé le demander ...
Java sur Azure: OpenJDK mieux que vous n'avez jamais osé le demander ...Java sur Azure: OpenJDK mieux que vous n'avez jamais osé le demander ...
Java sur Azure: OpenJDK mieux que vous n'avez jamais osé le demander ...
 
No More “Cowboy Coding”: A Best Practices Guide to Local Development & Migration
No More “Cowboy Coding”: A Best Practices Guide to Local Development & MigrationNo More “Cowboy Coding”: A Best Practices Guide to Local Development & Migration
No More “Cowboy Coding”: A Best Practices Guide to Local Development & Migration
 
Vagrant and puppet: Deployment made easy
Vagrant and puppet: Deployment made easyVagrant and puppet: Deployment made easy
Vagrant and puppet: Deployment made easy
 
Containers: DevOp Enablers of Technical Solutions
Containers: DevOp Enablers of Technical SolutionsContainers: DevOp Enablers of Technical Solutions
Containers: DevOp Enablers of Technical Solutions
 
CoreOS at Carnival
CoreOS at CarnivalCoreOS at Carnival
CoreOS at Carnival
 
CoreOS at Carnival
CoreOS at CarnivalCoreOS at Carnival
CoreOS at Carnival
 
Web Apps
Web AppsWeb Apps
Web Apps
 
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...
 

Recently uploaded

2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxFIDO Alliance
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxjbellis
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireExakis Nelite
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfalexjohnson7307
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!Memoori
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfAnubhavMangla3
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...ScyllaDB
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Skynet Technologies
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimaginedpanagenda
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Paige Cruz
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهMohamed Sweelam
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityVictorSzoltysek
 

Recently uploaded (20)

2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهله
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 

Configuring WordPress for Multiple Environments

  • 1. Configuring WordPress for Multiple Environments #WCChicago 7/30 - 7/31/11
  • 2. Who am I? Jason McCreary jmccreary@viastudio.com @gonedark • Louisville, KY • Production Lead at VIA Studio • Web Developer since 1999 • PHP since version 3 • Active StackOverflow member • http://jason.pureconcepts.net (shhh! It’s not WordPress, yet...) #WCChicago 7/30 - 7/31/11
  • 3. Who are you? #WCChicago 7/30 - 7/31/11
  • 4. Who are you? • How many people... #WCChicago 7/30 - 7/31/11
  • 5. Who are you? • How many people... • Use WordPress? #WCChicago 7/30 - 7/31/11
  • 6. Who are you? • How many people... • Use WordPress? • Responsible for managing your install? #WCChicago 7/30 - 7/31/11
  • 7. Who are you? • How many people... • Use WordPress? • Responsible for managing your install? • Use a development or test environment? #WCChicago 7/30 - 7/31/11
  • 8. Who are you? • How many people... • Use WordPress? • Responsible for managing your install? • Use a development or test environment? • WordPress in a distributed enviroment? #WCChicago 7/30 - 7/31/11
  • 10. The Talk • Configuring WordPress for Multiple Environments #WCChicago 7/30 - 7/31/11
  • 11. The Talk • Configuring WordPress for Multiple Environments • It’s not that advanced, really! #WCChicago 7/30 - 7/31/11
  • 12. The Talk • Configuring WordPress for Multiple Environments • It’s not that advanced, really! • Examine WordPress component parts #WCChicago 7/30 - 7/31/11
  • 13. The Talk • Configuring WordPress for Multiple Environments • It’s not that advanced, really! • Examine WordPress component parts • Some slides #WCChicago 7/30 - 7/31/11
  • 14. The Talk • Configuring WordPress for Multiple Environments • It’s not that advanced, really! • Examine WordPress component parts • Some slides • Some demos #WCChicago 7/30 - 7/31/11
  • 15. The Talk • Configuring WordPress for Multiple Environments • It’s not that advanced, really! • Examine WordPress component parts • Some slides • Some demos • Please ask questions #WCChicago 7/30 - 7/31/11
  • 16. “We have to be careful [...] people might think WordPress is a real CMS, useful for more than just a blog.” #WCChicago 7/30 - 7/31/11
  • 17. “We have to be careful [...] people might think WordPress is a real CMS, useful for more than just a blog.” Matt Mullenburg WordPress Wins CMS Award #WCChicago 7/30 - 7/31/11
  • 18. “We have to be careful [...] people might think WordPress is a real CMS, useful for more than just a blog.” Matt Mullenburg WordPress Wins CMS Award “[...] instances of the phrase ‘WordPress blog’ are gone from the core source files, replaced with the all-encompassing phrase ‘WordPress site.’” Andrew Nacin Changeset 14315 #WCChicago 7/30 - 7/31/11
  • 19. “Any serious development project should follow a software development lifecycle.This implies source code management and at least a development and production environment. Unfortunately WordPress doesn’t really scale well in this area out of the box.” #WCChicago 7/30 - 7/31/11
  • 20. “Any serious development project should follow a software development lifecycle.This implies source code management and at least a development and production environment. Unfortunately WordPress doesn’t really scale well in this area out of the box.” Jason McCreary http://bit.ly/r8jFm3 #WCChicago 7/30 - 7/31/11
  • 21. Demo: 5 minute install... #WCChicago 7/30 - 7/31/11
  • 22. #WCChicago 7/30 - 7/31/11
  • 23. #WCChicago 7/30 - 7/31/11
  • 24. • We setup WordPress for one environment... #WCChicago 7/30 - 7/31/11
  • 25. • We setup WordPress for one environment... • But I have other environments... #WCChicago 7/30 - 7/31/11
  • 26. • We setup WordPress for one environment... • But I have other environments... • Do I have to do the install again? #WCChicago 7/30 - 7/31/11
  • 27. • We setup WordPress for one environment... • But I have other environments... • Do I have to do the install again? • What happens after install? #WCChicago 7/30 - 7/31/11
  • 28. • We setup WordPress for one environment... • But I have other environments... • Do I have to do the install again? • What happens after install? • I’m confused... #WCChicago 7/30 - 7/31/11
  • 31. Multiple Environments } Production Staging Development #WCChicago 7/30 - 7/31/11
  • 32. Multiple Environments }{ Production Staging Development #WCChicago 7/30 - 7/31/11
  • 33. Multiple Environments }{ Production Staging Development #WCChicago 7/30 - 7/31/11 Version Control
  • 34. Multiple Environments }{ Production Staging Development #WCChicago 7/30 - 7/31/11 wp-config Version Control
  • 35. Multiple Environments }{ Production Staging Development #WCChicago 7/30 - 7/31/11 wp-config Version Control
  • 36. Multiple Environments }{ Production Staging Development #WCChicago 7/30 - 7/31/11 wp-config Version Control
  • 37. Multiple Environments }{ Production Staging Development #WCChicago 7/30 - 7/31/11 wp-config Version Control
  • 39. Database Configuration // MySQL settings /** The name of the database for WordPress */ define('DB_NAME', 'database_name_dev'); /** MySQL database username */ define('DB_USER', 'dbuser'); /** MySQL database password */ define('DB_PASSWORD', 'dbpass'); /** MySQL hostname */ define('DB_HOST', 'localhost'); #WCChicago 7/30 - 7/31/11
  • 40. Database Configuration // MySQL settings /** The name of the database for WordPress */ define('DB_NAME', 'database_name_dev'); /** MySQL database username */ define('DB_USER', 'dbuser'); /** MySQL database password */ define('DB_PASSWORD', 'dbpass'); /** MySQL hostname */ define('DB_HOST', 'localhost'); #WCChicago 7/30 - 7/31/11
  • 42. What have we done... #WCChicago 7/30 - 7/31/11
  • 43. What have we done... By sniffing out the runtime environment we’ve extended wp-config.php with a configuration specific for that environment. This allows us to run a production-ready WordPress install smoothly on multiple, different environments. #WCChicago 7/30 - 7/31/11
  • 44. “As part of the WordPress installation, you must modify the wp-config.php file to define the WordPress configuration settings...” #WCChicago 7/30 - 7/31/11
  • 45. “As part of the WordPress installation, you must modify the wp-config.php file to define the WordPress configuration settings...” Codex #WCChicago 7/30 - 7/31/11
  • 47. Development • CONSTANTS for environment awareness #WCChicago 7/30 - 7/31/11
  • 48. Development • CONSTANTS for environment awareness /** wp-config-dev.php **/ // used to determine environment from easily accessible constant define('VIA_ENVIRONMENT', 'dev'); #WCChicago 7/30 - 7/31/11
  • 49. Development • CONSTANTS for environment awareness /** wp-config-dev.php **/ // used to determine environment from easily accessible constant define('VIA_ENVIRONMENT', 'dev'); • Configuring Plugins #WCChicago 7/30 - 7/31/11
  • 50. Development • CONSTANTS for environment awareness /** wp-config-dev.php **/ // used to determine environment from easily accessible constant define('VIA_ENVIRONMENT', 'dev'); • Configuring Plugins /** wp-config-prod.php **/ // turn on caching define('WP_CACHE', true); #WCChicago 7/30 - 7/31/11
  • 53. Deployment • Database #WCChicago 7/30 - 7/31/11
  • 54. Deployment • Database • mysqldump entire database #WCChicago 7/30 - 7/31/11
  • 55. Deployment • Database • mysqldump entire database • WordPress Import/Export #WCChicago 7/30 - 7/31/11
  • 56. Deployment • Database • mysqldump entire database • WordPress Import/Export • WordPress Files #WCChicago 7/30 - 7/31/11
  • 57. Deployment • Database • mysqldump entire database • WordPress Import/Export • WordPress Files • Version Control (SVN, Git, etc) #WCChicago 7/30 - 7/31/11
  • 58. Deployment • Database • mysqldump entire database • WordPress Import/Export • WordPress Files • Version Control (SVN, Git, etc) • FTP sFTP/SSH #WCChicago 7/30 - 7/31/11
  • 59. Deployment • Database • mysqldump entire database • WordPress Import/Export • WordPress Files • Version Control (SVN, Git, etc) • FTP sFTP/SSH • Resource Files #WCChicago 7/30 - 7/31/11
  • 60. Deployment • Database • mysqldump entire database • WordPress Import/Export • WordPress Files • Version Control (SVN, Git, etc) • FTP sFTP/SSH • Resource Files • FTP sFTP/SSH #WCChicago 7/30 - 7/31/11
  • 62. Other Tips • Avoid absolute paths #WCChicago 7/30 - 7/31/11
  • 63. Other Tips • Avoid absolute paths • Use symlinks for shared directories (e.g. uploads/) #WCChicago 7/30 - 7/31/11
  • 64. Other Tips • Avoid absolute paths • Use symlinks for shared directories (e.g. uploads/) • Just move what you need (e.g. wp_posts) #WCChicago 7/30 - 7/31/11
  • 65. Other Tips • Avoid absolute paths • Use symlinks for shared directories (e.g. uploads/) • Just move what you need (e.g. wp_posts) • Don’t forget your environment constant (e.g. VIA_ENVIRONMENT) #WCChicago 7/30 - 7/31/11
  • 66. Other Tips • Avoid absolute paths • Use symlinks for shared directories (e.g. uploads/) • Just move what you need (e.g. wp_posts) • Don’t forget your environment constant (e.g. VIA_ENVIRONMENT) • Migration scripts are your friend #WCChicago 7/30 - 7/31/11
  • 68. The Process 1. Do the 5 minute production install #WCChicago 7/30 - 7/31/11
  • 69. The Process 1. Do the 5 minute production install 2. Include environment specific wp-config.php #WCChicago 7/30 - 7/31/11
  • 70. The Process 1. Do the 5 minute production install 2. Include environment specific wp-config.php 3. Setup your environments #WCChicago 7/30 - 7/31/11
  • 71. The Process 1. Do the 5 minute production install 2. Include environment specific wp-config.php 3. Setup your environments 4. Develop #WCChicago 7/30 - 7/31/11
  • 72. The Process 1. Do the 5 minute production install 2. Include environment specific wp-config.php 3. Setup your environments 4. Develop 5. Deploy #WCChicago 7/30 - 7/31/11
  • 73. The Process 1. Do the 5 minute production install 2. Include environment specific wp-config.php 3. Setup your environments 4. Develop 5. Deploy 6. Repeat 4 and 5 #WCChicago 7/30 - 7/31/11

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. Environments\nSingle WordPress Install\nSeparate Files, managed with SVN\napache vhosts\n
  26. Environments\nSingle WordPress Install\nSeparate Files, managed with SVN\napache vhosts\n
  27. Environments\nSingle WordPress Install\nSeparate Files, managed with SVN\napache vhosts\n
  28. Environments\nSingle WordPress Install\nSeparate Files, managed with SVN\napache vhosts\n
  29. Environments\nSingle WordPress Install\nSeparate Files, managed with SVN\napache vhosts\n
  30. Environments\nSingle WordPress Install\nSeparate Files, managed with SVN\napache vhosts\n
  31. Environments\nSingle WordPress Install\nSeparate Files, managed with SVN\napache vhosts\n
  32. Environments\nSingle WordPress Install\nSeparate Files, managed with SVN\napache vhosts\n
  33. Environments\nSingle WordPress Install\nSeparate Files, managed with SVN\napache vhosts\n
  34. Environments\nSingle WordPress Install\nSeparate Files, managed with SVN\napache vhosts\n
  35. Environments\nSingle WordPress Install\nSeparate Files, managed with SVN\napache vhosts\n
  36. Environments\nSingle WordPress Install\nSeparate Files, managed with SVN\napache vhosts\n
  37. Environments\nSingle WordPress Install\nSeparate Files, managed with SVN\napache vhosts\n
  38. Environments\nSingle WordPress Install\nSeparate Files, managed with SVN\napache vhosts\n
  39. Environments\nSingle WordPress Install\nSeparate Files, managed with SVN\napache vhosts\n
  40. Environments\nSingle WordPress Install\nSeparate Files, managed with SVN\napache vhosts\n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n