SlideShare a Scribd company logo
1 of 21
Download to read offline
Deploying WP Multisite
to Heroku
WordCamp Finland 2016
Helsinki 15.4.2016
Jussi Kinnula <jussi.kinnula@frantic.com>
https://github.com/jussikinnula
Prerequisites
- Mac OS X (latest)
- Note! Most of the tools are available also on Linux systems
- Homebrew:
- http://brew.sh/
- Heroku toolbelt:
- https://toolbelt.heroku.com/
- ClearDB dump (Heroku utility):
- https://github.com/josepfrantic/heroku-cleardbdump
- Bedrock (boilerplate):
- Original version (without Heroku-specific configuration): https://github.com/roots/bedrock
- Fork with Heroku & multisite related configuration: https://github.com/frc/bedrock-on-heroku
Installing tools, part I
After installing Homebrew & Heroku toolbelt & ClearDB dump utility, we need to
install some packages that WordPress and Heroku Local needed.
$ brew install php56 --with-fpm
$ brew install mysql redis
$ brew install php56-redis php56-timezonedb php56-igbinary
composer
$ brew install libpng jpeg giflib libtiff
…
Installing tools, part II
…
$ brew tap homebrew/nginx
$ brew install nginx-full --with-realip
Reverse proxy is needed for local development, we use a Node module:
$ brew install node
$ npm install -g reverse-proxy-js
Please test, that everything works…
Setup the project
$ cd ~/dev
$ git clone git@github.com:frc/bedrock-on-heroku.git my-project
$ cd my-project
$ rm -rf .git
$ git init
$ git add -A . && git commit -am ‘initial commit’
Set local “environment”
Make sure first that MySQL and Redis servers are running.
$ mysqladmin -uroot create my-project
$ cat > .env
CLEARDB_DATABASE_URL=mysql://root:@127.0.0.1/my-project
#WP_ALLOW_MULTISITE=true
#WP_MULTISITE_MAIN_DOMAIN=localhost.frc.io
^C
Composer configuration, part I
{
"name": "roots/bedrock",
"type": "project",
"license": "MIT",
"description": "A modern WordPress stack",
"homepage": "https://roots.io/bedrock/",
"authors": [
{
"name": "Scott Walkinshaw",
"email": "scott.walkinshaw@gmail.com",
"homepage": "https://github.com/swalkinshaw"
},
{
"name": "Ben Word",
"email": "ben@benword.com",
"homepage": "https://github.com/retlehs"
}
],
Please edit to your needs (project-
specific stuff generally).
Composer configuration, part II
"keywords": [
"bedrock", "roots", "wordpress", "stack",
"composer", "vagrant", "wp"
],
"support": {
"issues": "https://github.
com/roots/bedrock/issues",
"forum": "https://discourse.roots.
io/category/bedrock"
},
"config": {
"preferred-install": "dist"
},
Composer configuration, part III
"repositories": [
{
"type": "vcs",
"url": "https://github.com/frc/wp-amazon-s3-and-cloudfront"
},
{
"type": "composer",
"url": "http://wpackagist.org"
}
],
Extra repositories to get stuff
from. By default composer
installs stuff from packagist.
org repositories.
WordPress packages are
generally on wpackagist.org
and there’s on GitHub
repository + a Satis custom
repository for extra packages.
Composer configuration, part IV
"require-dev": {
"heroku/heroku-buildpack-php": "dev-master"
},
Heroku Local development tools are installed by
simply having a development require for Heroku’
s PHP buildpack.
Composer configuration, part V
"require": {
"ext-redis": "*",
"ext-gd": "*",
"frc/batcache": "~1.2-p1",
"deliciousbrains/wp-amazon-s3-and-cloudfront": "dev-frc",
"wpackagist-plugin/amazon-web-services": "~0.3.2",
"wpackagist-plugin/sendgrid-email-delivery-simplified": "~1.
6.2",
"wpackagist-plugin/limit-login-attempts": "~1.7.1",
"tillkruss/redis-object-cache": "~1.2.1",
"frc/wp-env-heroku-cleardb": "~1.0.1",
"frc/wp-env-heroku-redis": "~1.0.0",
"frc/wp-env-heroku-sendgrid": "~1.0.0",
"frc/wp-env-heroku-amazon-aws": "~1.0.0",
"php": "^5.6",
"composer/installers": "~1.0.21",
"vlucas/phpdotenv": "~2.0.1",
"johnpbloch/wordpress": "~4.3.1"
},
Requirements include some extra
packages related to caching (page
cache batcache, object cache redis-
object-cache), Amazon integration
(media files to S3 bucket), Sendgrid
integration (send E-mails via Sendgrid)
and Advanced Custom Fields Pro.
Heroku configuration is read with wp-
env-heroku-???????? Modules
(ClearDB, Redis, SendGrid and Amazon
AWS credentials).
Composer configuration, part VI
"scripts": {
"post-update-cmd": [
"cp web/app/plugins/wordpress-mu-domain-mapping/sunrise.php
web/app/sunrise.php",
"cp web/app/plugins/redis-object-cache/includes/object-cache.
php web/app/object-cache.php",
"cp web/app/mu-plugins/batcache/advanced-cache.php
web/app/advanced-cache.php"
],
"post-install-cmd": [
"cp web/app/plugins/wordpress-mu-domain-mapping/sunrise.php
web/app/sunrise.php",
"cp web/app/plugins/redis-object-cache/includes/object-cache.
php web/app/object-cache.php",
"cp web/app/mu-plugins/batcache/advanced-cache.php
web/app/advanced-cache.php"
]
},
Post update commands are run to
copy sunrise.php, object-cache.php
and advanced-cache.php to their
correct places. Post install does
similar stuff.
Sunrise is for custom domain names
plug-in, and the other two are for
caching.
Composer configuration, part VII
"extra": {
"installer-paths": {
"web/app/mu-plugins/{$name}/": ["type:wordpress-
muplugin"],
"web/app/plugins/{$name}/": ["type:wordpress-plugin"],
"web/app/themes/{$name}/": ["type:wordpress-theme"]
},
"wordpress-install-dir": "web/wp"
}
}
Defining installer paths and WordPress
installation directory.
Note that this “web” and “web/wp” style of
directories comes from the Bedrock
structures.
$ composer install
# Get reverse proxy running
$ sudo reverse-proxy 
--port 80 --target 5000
$ heroku local
http://localhost.frc.io
WordPress setup (common)
● We’ll do first a regular WordPress setup, no multi-site related stuff
● After everything is setup, then heroku local will be stopped (CTRL+C) - and
.env modified to the following:
CLEARDB_DATABASE_URL=mysql://root:@127.0.0.1/my-project
WP_ALLOW_MULTISITE=true
#WP_MULTISITE=localhost.frc.io
● Then just restart heroku local …
WordPress setup (enable multisite)
● Now with WP_ALLOW_MULTISITE=true
being active, you can get to enabling
multisite on WP admin
● You don’t have to actually do any
copy&pasting for the code after
enabling multisite, as we have the
necessary code already implemented
in config/application.php -file
● After enabling multisite, just stop
heroku local (CTRL+C) and
uncomment the last line in .env and
start it again
● Setting the multisite domain sets also
the other definitions
CLEARDB_DATABASE_URL=mysql://root:@127.0.0.1
/my-project
WP_ALLOW_MULTISITE=true
WP_MULTISITE_MAIN_DOMAIN=localhost.frc.io
if (getenv('WP_MULTISITE_MAIN_DOMAIN')) {
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', getenv
('WP_MULTISITE_MAIN_DOMAIN'));
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
define('SUNRISE', true);
}
Main site:
http://localhost.frc.io
Site #1:
http://anything.localhost.frc.io
Site #2:
http://else.localhost.frc.io
Deploy to Heroku
$ heroku create --region eu my-project
$ heroku addons:create cleardb:ignite
$ heroku addons:create heroku-redis:hobby-dev
$ git push heroku master
$ heroku cleardb:push my-project --search localhost.frc.io 
--replace wordcamp.frc.io
$ heroku domains:add wordcamp.frc.io
$ heroku domains:add *.wordcamp.frc.io
http://wordcamp.frc.io
http://anything.wordcamp.frc.io
http://else.wordcamp.frc.io
http://wordcamp.aksurules.com
Thanks

More Related Content

What's hot

2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Herokuronnywang_tw
 
Bower - A package manager for the web
Bower - A package manager for the webBower - A package manager for the web
Bower - A package manager for the webLarry Nung
 
Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Soshi Nemoto
 
GIT, RVM, FIRST HEROKU APP
GIT, RVM, FIRST HEROKU APPGIT, RVM, FIRST HEROKU APP
GIT, RVM, FIRST HEROKU APPPavel Tyk
 
Ansible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife OrchestrationAnsible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife Orchestrationbcoca
 
DevOps for Opensource Geospatial Applications
DevOps for Opensource Geospatial ApplicationsDevOps for Opensource Geospatial Applications
DevOps for Opensource Geospatial Applicationstlpinney
 
Using Composer with Drupal and Drush
Using Composer with Drupal and DrushUsing Composer with Drupal and Drush
Using Composer with Drupal and DrushPantheon
 
[PHP 也有 Day] 垃圾留言守城記 - 用 Laravel 阻擋 SPAM 留言的奮鬥史
[PHP 也有 Day] 垃圾留言守城記 - 用 Laravel 阻擋 SPAM 留言的奮鬥史[PHP 也有 Day] 垃圾留言守城記 - 用 Laravel 阻擋 SPAM 留言的奮鬥史
[PHP 也有 Day] 垃圾留言守城記 - 用 Laravel 阻擋 SPAM 留言的奮鬥史Shengyou Fan
 
Composer Tools & Frameworks for Drupal
Composer Tools & Frameworks for DrupalComposer Tools & Frameworks for Drupal
Composer Tools & Frameworks for DrupalPantheon
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with AugeasPuppet
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Cosimo Streppone
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetOmar Reygaert
 
Lessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containersLessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containersBen Hall
 

What's hot (20)

2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
 
Bower - A package manager for the web
Bower - A package manager for the webBower - A package manager for the web
Bower - A package manager for the web
 
Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)
 
GIT, RVM, FIRST HEROKU APP
GIT, RVM, FIRST HEROKU APPGIT, RVM, FIRST HEROKU APP
GIT, RVM, FIRST HEROKU APP
 
Ansible project-deploy
Ansible project-deployAnsible project-deploy
Ansible project-deploy
 
Ansible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife OrchestrationAnsible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife Orchestration
 
DevOps for Opensource Geospatial Applications
DevOps for Opensource Geospatial ApplicationsDevOps for Opensource Geospatial Applications
DevOps for Opensource Geospatial Applications
 
Bower power
Bower powerBower power
Bower power
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
 
Using Composer with Drupal and Drush
Using Composer with Drupal and DrushUsing Composer with Drupal and Drush
Using Composer with Drupal and Drush
 
[PHP 也有 Day] 垃圾留言守城記 - 用 Laravel 阻擋 SPAM 留言的奮鬥史
[PHP 也有 Day] 垃圾留言守城記 - 用 Laravel 阻擋 SPAM 留言的奮鬥史[PHP 也有 Day] 垃圾留言守城記 - 用 Laravel 阻擋 SPAM 留言的奮鬥史
[PHP 也有 Day] 垃圾留言守城記 - 用 Laravel 阻擋 SPAM 留言的奮鬥史
 
Sprockets
SprocketsSprockets
Sprockets
 
Composer Tools & Frameworks for Drupal
Composer Tools & Frameworks for DrupalComposer Tools & Frameworks for Drupal
Composer Tools & Frameworks for Drupal
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with Augeas
 
Front-end tools
Front-end toolsFront-end tools
Front-end tools
 
Grunt and Bower
Grunt and BowerGrunt and Bower
Grunt and Bower
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + Puppet
 
Lessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containersLessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containers
 

Similar to Deploying WP Multisite to Heroku

WordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwaltenWordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwaltenWalter Ebert
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packerfrastel
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)Soshi Nemoto
 
Docker for Ruby Developers
Docker for Ruby DevelopersDocker for Ruby Developers
Docker for Ruby DevelopersAptible
 
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2Yros
 
Vagrant WordCamp Hamilton
Vagrant  WordCamp HamiltonVagrant  WordCamp Hamilton
Vagrant WordCamp HamiltonPaul Bearne
 
How to create your own hack environment
How to create your own hack environmentHow to create your own hack environment
How to create your own hack environmentSumedt Jitpukdebodin
 
Wordpress development: A Modern Approach
Wordpress development:  A Modern ApproachWordpress development:  A Modern Approach
Wordpress development: A Modern ApproachAlessandro Fiore
 
JUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrinderJUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrindermarekgoldmann
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPressdotCloud
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPressDocker, Inc.
 
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerInto The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerOrtus Solutions, Corp
 
Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Ortus Solutions, Corp
 
Building and Customizing CoreOS
Building and Customizing CoreOSBuilding and Customizing CoreOS
Building and Customizing CoreOS雄也 日下部
 
Manage WordPress with Awesome using wp cli
Manage WordPress with Awesome using wp cliManage WordPress with Awesome using wp cli
Manage WordPress with Awesome using wp cliGetSource
 
Docker & FieldAware
Docker & FieldAwareDocker & FieldAware
Docker & FieldAwareJakub Jarosz
 
Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014Pini Reznik
 
Bower & Grunt - A practical workflow
Bower & Grunt - A practical workflowBower & Grunt - A practical workflow
Bower & Grunt - A practical workflowRiccardo Coppola
 
WP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-NapocaWP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-Napoca4nd4p0p
 

Similar to Deploying WP Multisite to Heroku (20)

WordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwaltenWordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwalten
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packer
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
 
Docker for Ruby Developers
Docker for Ruby DevelopersDocker for Ruby Developers
Docker for Ruby Developers
 
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
 
Vagrant WordCamp Hamilton
Vagrant  WordCamp HamiltonVagrant  WordCamp Hamilton
Vagrant WordCamp Hamilton
 
How to create your own hack environment
How to create your own hack environmentHow to create your own hack environment
How to create your own hack environment
 
Wordpress development: A Modern Approach
Wordpress development:  A Modern ApproachWordpress development:  A Modern Approach
Wordpress development: A Modern Approach
 
JUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrinderJUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrinder
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPress
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPress
 
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerInto The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and docker
 
Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018
 
Building and Customizing CoreOS
Building and Customizing CoreOSBuilding and Customizing CoreOS
Building and Customizing CoreOS
 
Manage WordPress with Awesome using wp cli
Manage WordPress with Awesome using wp cliManage WordPress with Awesome using wp cli
Manage WordPress with Awesome using wp cli
 
Docker & FieldAware
Docker & FieldAwareDocker & FieldAware
Docker & FieldAware
 
Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014
 
Bower & Grunt - A practical workflow
Bower & Grunt - A practical workflowBower & Grunt - A practical workflow
Bower & Grunt - A practical workflow
 
WP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-NapocaWP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-Napoca
 

Recently uploaded

VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$kojalkojal131
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Sheetaleventcompany
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girladitipandeya
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on DeliveryCall Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Deliverybabeytanya
 
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607dollysharma2066
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...Diya Sharma
 
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls KolkataLow Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Roomdivyansh0kumar0
 
Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneRussian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneCall girls in Ahmedabad High profile
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...aditipandeya
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 

Recently uploaded (20)

VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on DeliveryCall Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
 
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
 
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls KolkataLow Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
 
Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneRussian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 

Deploying WP Multisite to Heroku

  • 1. Deploying WP Multisite to Heroku WordCamp Finland 2016 Helsinki 15.4.2016 Jussi Kinnula <jussi.kinnula@frantic.com> https://github.com/jussikinnula
  • 2. Prerequisites - Mac OS X (latest) - Note! Most of the tools are available also on Linux systems - Homebrew: - http://brew.sh/ - Heroku toolbelt: - https://toolbelt.heroku.com/ - ClearDB dump (Heroku utility): - https://github.com/josepfrantic/heroku-cleardbdump - Bedrock (boilerplate): - Original version (without Heroku-specific configuration): https://github.com/roots/bedrock - Fork with Heroku & multisite related configuration: https://github.com/frc/bedrock-on-heroku
  • 3. Installing tools, part I After installing Homebrew & Heroku toolbelt & ClearDB dump utility, we need to install some packages that WordPress and Heroku Local needed. $ brew install php56 --with-fpm $ brew install mysql redis $ brew install php56-redis php56-timezonedb php56-igbinary composer $ brew install libpng jpeg giflib libtiff …
  • 4. Installing tools, part II … $ brew tap homebrew/nginx $ brew install nginx-full --with-realip Reverse proxy is needed for local development, we use a Node module: $ brew install node $ npm install -g reverse-proxy-js
  • 5. Please test, that everything works…
  • 6. Setup the project $ cd ~/dev $ git clone git@github.com:frc/bedrock-on-heroku.git my-project $ cd my-project $ rm -rf .git $ git init $ git add -A . && git commit -am ‘initial commit’
  • 7. Set local “environment” Make sure first that MySQL and Redis servers are running. $ mysqladmin -uroot create my-project $ cat > .env CLEARDB_DATABASE_URL=mysql://root:@127.0.0.1/my-project #WP_ALLOW_MULTISITE=true #WP_MULTISITE_MAIN_DOMAIN=localhost.frc.io ^C
  • 8. Composer configuration, part I { "name": "roots/bedrock", "type": "project", "license": "MIT", "description": "A modern WordPress stack", "homepage": "https://roots.io/bedrock/", "authors": [ { "name": "Scott Walkinshaw", "email": "scott.walkinshaw@gmail.com", "homepage": "https://github.com/swalkinshaw" }, { "name": "Ben Word", "email": "ben@benword.com", "homepage": "https://github.com/retlehs" } ], Please edit to your needs (project- specific stuff generally).
  • 9. Composer configuration, part II "keywords": [ "bedrock", "roots", "wordpress", "stack", "composer", "vagrant", "wp" ], "support": { "issues": "https://github. com/roots/bedrock/issues", "forum": "https://discourse.roots. io/category/bedrock" }, "config": { "preferred-install": "dist" },
  • 10. Composer configuration, part III "repositories": [ { "type": "vcs", "url": "https://github.com/frc/wp-amazon-s3-and-cloudfront" }, { "type": "composer", "url": "http://wpackagist.org" } ], Extra repositories to get stuff from. By default composer installs stuff from packagist. org repositories. WordPress packages are generally on wpackagist.org and there’s on GitHub repository + a Satis custom repository for extra packages.
  • 11. Composer configuration, part IV "require-dev": { "heroku/heroku-buildpack-php": "dev-master" }, Heroku Local development tools are installed by simply having a development require for Heroku’ s PHP buildpack.
  • 12. Composer configuration, part V "require": { "ext-redis": "*", "ext-gd": "*", "frc/batcache": "~1.2-p1", "deliciousbrains/wp-amazon-s3-and-cloudfront": "dev-frc", "wpackagist-plugin/amazon-web-services": "~0.3.2", "wpackagist-plugin/sendgrid-email-delivery-simplified": "~1. 6.2", "wpackagist-plugin/limit-login-attempts": "~1.7.1", "tillkruss/redis-object-cache": "~1.2.1", "frc/wp-env-heroku-cleardb": "~1.0.1", "frc/wp-env-heroku-redis": "~1.0.0", "frc/wp-env-heroku-sendgrid": "~1.0.0", "frc/wp-env-heroku-amazon-aws": "~1.0.0", "php": "^5.6", "composer/installers": "~1.0.21", "vlucas/phpdotenv": "~2.0.1", "johnpbloch/wordpress": "~4.3.1" }, Requirements include some extra packages related to caching (page cache batcache, object cache redis- object-cache), Amazon integration (media files to S3 bucket), Sendgrid integration (send E-mails via Sendgrid) and Advanced Custom Fields Pro. Heroku configuration is read with wp- env-heroku-???????? Modules (ClearDB, Redis, SendGrid and Amazon AWS credentials).
  • 13. Composer configuration, part VI "scripts": { "post-update-cmd": [ "cp web/app/plugins/wordpress-mu-domain-mapping/sunrise.php web/app/sunrise.php", "cp web/app/plugins/redis-object-cache/includes/object-cache. php web/app/object-cache.php", "cp web/app/mu-plugins/batcache/advanced-cache.php web/app/advanced-cache.php" ], "post-install-cmd": [ "cp web/app/plugins/wordpress-mu-domain-mapping/sunrise.php web/app/sunrise.php", "cp web/app/plugins/redis-object-cache/includes/object-cache. php web/app/object-cache.php", "cp web/app/mu-plugins/batcache/advanced-cache.php web/app/advanced-cache.php" ] }, Post update commands are run to copy sunrise.php, object-cache.php and advanced-cache.php to their correct places. Post install does similar stuff. Sunrise is for custom domain names plug-in, and the other two are for caching.
  • 14. Composer configuration, part VII "extra": { "installer-paths": { "web/app/mu-plugins/{$name}/": ["type:wordpress- muplugin"], "web/app/plugins/{$name}/": ["type:wordpress-plugin"], "web/app/themes/{$name}/": ["type:wordpress-theme"] }, "wordpress-install-dir": "web/wp" } } Defining installer paths and WordPress installation directory. Note that this “web” and “web/wp” style of directories comes from the Bedrock structures.
  • 16. # Get reverse proxy running $ sudo reverse-proxy --port 80 --target 5000 $ heroku local http://localhost.frc.io
  • 17. WordPress setup (common) ● We’ll do first a regular WordPress setup, no multi-site related stuff ● After everything is setup, then heroku local will be stopped (CTRL+C) - and .env modified to the following: CLEARDB_DATABASE_URL=mysql://root:@127.0.0.1/my-project WP_ALLOW_MULTISITE=true #WP_MULTISITE=localhost.frc.io ● Then just restart heroku local …
  • 18. WordPress setup (enable multisite) ● Now with WP_ALLOW_MULTISITE=true being active, you can get to enabling multisite on WP admin ● You don’t have to actually do any copy&pasting for the code after enabling multisite, as we have the necessary code already implemented in config/application.php -file ● After enabling multisite, just stop heroku local (CTRL+C) and uncomment the last line in .env and start it again ● Setting the multisite domain sets also the other definitions CLEARDB_DATABASE_URL=mysql://root:@127.0.0.1 /my-project WP_ALLOW_MULTISITE=true WP_MULTISITE_MAIN_DOMAIN=localhost.frc.io if (getenv('WP_MULTISITE_MAIN_DOMAIN')) { define('MULTISITE', true); define('SUBDOMAIN_INSTALL', true); define('DOMAIN_CURRENT_SITE', getenv ('WP_MULTISITE_MAIN_DOMAIN')); define('PATH_CURRENT_SITE', '/'); define('SITE_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 1); define('SUNRISE', true); }
  • 20. Deploy to Heroku $ heroku create --region eu my-project $ heroku addons:create cleardb:ignite $ heroku addons:create heroku-redis:hobby-dev $ git push heroku master $ heroku cleardb:push my-project --search localhost.frc.io --replace wordcamp.frc.io $ heroku domains:add wordcamp.frc.io $ heroku domains:add *.wordcamp.frc.io