SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Ähnlich wie 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
 

Ähnlich wie 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...
 

Kürzlich hochgeladen

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Kürzlich hochgeladen (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

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

Hinweis der Redaktion

  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