SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Similaire à 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
 

Similaire à 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...
 

Dernier

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 

Dernier (20)

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 

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

Notes de l'éditeur

  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