The Entrepreneur Forum | Financial Freedom | Starting a Business | Motivation | Money | Success
  • SPONSORED: GiganticWebsites.com: We Build Sites with THOUSANDS of Unique and Genuinely Useful Articles

    30% to 50% Fastlane-exclusive discounts on WordPress-powered websites with everything included: WordPress setup, design, keyword research, article creation and article publishing. Click HERE to claim.

Welcome to the only entrepreneur forum dedicated to building life-changing wealth.

Build a Fastlane business. Earn real financial freedom. Join free.

Join over 90,000 entrepreneurs who have rejected the paradigm of mediocrity and said "NO!" to underpaid jobs, ascetic frugality, and suffocating savings rituals— learn how to build a Fastlane business that pays both freedom and lifestyle affluence.

Free registration at the forum removes this block.

Wordpress multi tenancy - Has anbody done it ?

Menery

Contributor
Read Fastlane!
Read Unscripted!
Speedway Pass
User Power
Value/Post Ratio
81%
Sep 22, 2019
118
95
Hey,

is anyone here running a WordPress multitenancy setup?
It's kinda hard to find reliable information on how to set this up properly. I got some specific questions about this.

Tag me if you have set this up in the past. Thanks for your help!
Menery
 
Dislike ads? Remove them and support the forum: Subscribe to Fastlane Insiders.

alexkuzmov

Gold Contributor
Read Rat-Race Escape!
Read Fastlane!
Read Unscripted!
Speedway Pass
User Power
Value/Post Ratio
130%
Sep 20, 2019
1,014
1,319
Bulgaria
Hey,

is anyone here running a WordPress multitenancy setup?
It's kinda hard to find reliable information on how to set this up properly. I got some specific questions about this.

Tag me if you have set this up in the past. Thanks for your help!
Menery
Wordpress multitenancy?
You mean Wordpress multisite?
 

Menery

Contributor
Read Fastlane!
Read Unscripted!
Speedway Pass
User Power
Value/Post Ratio
81%
Sep 22, 2019
118
95
Wordpress multitenancy?
You mean Wordpress multisite?
No, multitenancy. It's not specific to WordPress but there are ways to set WordPress sites up like this. It's just hard to find info for it.
 

alexkuzmov

Gold Contributor
Read Rat-Race Escape!
Read Fastlane!
Read Unscripted!
Speedway Pass
User Power
Value/Post Ratio
130%
Sep 20, 2019
1,014
1,319
Bulgaria
No, multitenancy. It's not specific to WordPress but there are ways to set WordPress sites up like this. It's just hard to find info for it.
I read up a little bit about multitenancy and figured it out.
I know it by a different name.

I found this to be useful: WordPress Multitenancy
Its a basic solution which should be fast and easy to do.
I wouldnt call it proper though.

Setting something like wordpress for multitenancy properly will require advanced skills in version control and server management.
That will net you ultimate scaleability and flexibility.
It takes days to setup and there is a cost to it, namely server cost and I dont recommend it unless you can justify it with traffic.

Question is, why do you want wordpress to be setup for multitenancy?
Can you describe the problem you are facing?
 
Dislike ads? Remove them and support the forum: Subscribe to Fastlane Insiders.

Menery

Contributor
Read Fastlane!
Read Unscripted!
Speedway Pass
User Power
Value/Post Ratio
81%
Sep 22, 2019
118
95
I read up a little bit about multitenancy and figured it out.
I know it by a different name.

I found this to be useful: WordPress Multitenancy
Its a basic solution which should be fast and easy to do.
I wouldnt call it proper though.

Setting something like wordpress for multitenancy properly will require advanced skills in version control and server management.
That will net you ultimate scaleability and flexibility.
It takes days to setup and there is a cost to it, namely server cost and I dont recommend it unless you can justify it with traffic.

Question is, why do you want wordpress to be setup for multitenancy?
Can you describe the problem you are facing?
Yea I know that article. It's not very good..

I dont mind if it takes a week to implement, I just need some solid guides or at least starting points.

What I need is the following.

-Having one "parent" Wordpress install with a certain plugin set. The entire layout of this site will be ACF+PHP.
- Having an "infinite" amount of "subsites" that use this parent site as a source ( core, plugins, afc fields etc).
But each subsite needs to have completely separate databases, which WP-Multisite is not an option for me ( it shares the wp_user table, also security is an issue. If one subsite in WP-Multisite gets hacked, they all get hacked).


The goals are the following:

- Let's say I want to change some custom post templates. I just update the according to PHP template on the parent site and all subsites get updated as well.
- Changing plugin settings (!) for all sites in the network.
- The ultimate dream would be having this all connected to the official Wordpress Core Github so that my parent site auto-updates when the Wordpress core gets updated. But the first two are most important.
 

alexkuzmov

Gold Contributor
Read Rat-Race Escape!
Read Fastlane!
Read Unscripted!
Speedway Pass
User Power
Value/Post Ratio
130%
Sep 20, 2019
1,014
1,319
Bulgaria
Yea I know that article. It's not very good..

I dont mind if it takes a week to implement, I just need some solid guides or at least starting points.

What I need is the following.

-Having one "parent" Wordpress install with a certain plugin set. The entire layout of this site will be ACF+PHP.
- Having an "infinite" amount of "subsites" that use this parent site as a source ( core, plugins, afc fields etc).
But each subsite needs to have completely separate databases, which WP-Multisite is not an option for me ( it shares the wp_user table, also security is an issue. If one subsite in WP-Multisite gets hacked, they all get hacked).


The goals are the following:

- Let's say I want to change some custom post templates. I just update the according to PHP template on the parent site and all subsites get updated as well.
- Changing plugin settings (!) for all sites in the network.
- The ultimate dream would be having this all connected to the official Wordpress Core Github so that my parent site auto-updates when the Wordpress core gets updated. But the first two are most important.

Hmm well what you describe will require both code and database updates to keep the tenants aligned.
This is because the changes you want to have synced will require both DB and code updates at the same time (plugin installtion -> code update, plugin setting -> DB update)

A potential problem with managing templates and plugins in this way is that if you apply any changes on the tenants, they will get overwritten.
Such a problem cannot be avoided, it comes with the architecture you want made.
Or in other words, mass updates from the central wordpress have to be done carefully.
Given that humans make errors, be sure that you`ll overwrite something at some point.

I think this is a suitable solution:

1. Create a central GIT repository which will contain a clean installation of wordpress and a lightweight framework such as: Lumen - PHP Micro-Framework By Laravel

The wordpress in the GIT repo is to keep the code in check.
The framework is to be used for its migrations and DB seeding capabilties.

2. Create a server image which will have all of the necessary software installed, configured and running.
Security risks accounted for, optimizations, web server modules etc.
Make sure that each tenant is running on a different branch of the GIT repo, you dont want to update them all at the same time. One by one is always better.

3. Setup GIT hooks so that each push to specific branch of the repo triggers a server pull and update.
The hook should run a Shell script with a series of commands which will deploy the latest code, run the migrations, the seeds and deploy.

4. Final step, install the server image on an empty server.
Login to the server and checkout a test branch.
Push to the branch and see if everything is working.

------------------------

I dont mean to be a gate keeper, but to get this done, you need a Full stack senior dev who is also proficient in system administration. Not easy to come by.
It`ll take time to setup, get right and have an easy automatic flow for updates.
But once setup, yea, you only need to make update from a central place and all tenants will respond to it.
 

Jon L

Platinum Contributor
Read Fastlane!
Speedway Pass
User Power
Value/Post Ratio
272%
Aug 22, 2015
1,649
4,489
Bellevue, WA
This doesn't strike me as the kind of thing where someone will publish a 'heres how I did it' article. WP Engine and companies like this, have done this, but they're not about to publish all their IP for all the world to see.

I also wonder, "why WordPress?" Are you sure you need WordPress, or would it make better sense to spin up a completely custom app where you then don't need to worry about hackers breaking into WordPress?
 
Dislike ads? Remove them and support the forum: Subscribe to Fastlane Insiders.

Menery

Contributor
Read Fastlane!
Read Unscripted!
Speedway Pass
User Power
Value/Post Ratio
81%
Sep 22, 2019
118
95
Hmm well what you describe will require both code and database updates to keep the tenants aligned.
This is because the changes you want to have synced will require both DB and code updates at the same time (plugin installtion -> code update, plugin setting -> DB update)

A potential problem with managing templates and plugins in this way is that if you apply any changes on the tenants, they will get overwritten.
Such a problem cannot be avoided, it comes with the architecture you want made.
Or in other words, mass updates from the central wordpress have to be done carefully.
Given that humans make errors, be sure that you`ll overwrite something at some point.

I think this is a suitable solution:

1. Create a central GIT repository which will contain a clean installation of wordpress and a lightweight framework such as: Lumen - PHP Micro-Framework By Laravel

The wordpress in the GIT repo is to keep the code in check.
The framework is to be used for its migrations and DB seeding capabilties.

2. Create a server image which will have all of the necessary software installed, configured and running.
Security risks accounted for, optimizations, web server modules etc.
Make sure that each tenant is running on a different branch of the GIT repo, you dont want to update them all at the same time. One by one is always better.

3. Setup GIT hooks so that each push to specific branch of the repo triggers a server pull and update.
The hook should run a Shell script with a series of commands which will deploy the latest code, run the migrations, the seeds and deploy.

4. Final step, install the server image on an empty server.
Login to the server and checkout a test branch.
Push to the branch and see if everything is working.

------------------------

I dont mean to be a gate keeper, but to get this done, you need a Full stack senior dev who is also proficient in system administration. Not easy to come by.
It`ll take time to setup, get right and have an easy automatic flow for updates.
But once setup, yea, you only need to make update from a central place and all tenants will respond to it.
Thank you very much. I read this already a while back but forgot to answer. This definatly showed me the right direction.

I actually found a solution that is significantly easier. I'll manage the entire wp install with composer and just distribute a new composer.json file to all servers with a simple ansible playbook when I make a commit to the github master branch.

Composer will then handle all dependencies including plugins. And I wrote my own custom plugin that takes care of everything including updating settings in the database and managing other 3rd party plugins.
 

Menery

Contributor
Read Fastlane!
Read Unscripted!
Speedway Pass
User Power
Value/Post Ratio
81%
Sep 22, 2019
118
95
This doesn't strike me as the kind of thing where someone will publish a 'heres how I did it' article. WP Engine and companies like this, have done this, but they're not about to publish all their IP for all the world to see.

I also wonder, "why WordPress?" Are you sure you need WordPress, or would it make better sense to spin up a completely custom app where you then don't need to worry about hackers breaking into WordPress?
For now it needs to be WP. Everything else would be a massive action fake.

It wont be hacked either. You wont be able to tell its Wordpress and no scraper will be able to pick up any plugins used which is how imo most sites get hacked anyway.

Some kid realizing you have an outdated plugin and running a script he grabbed off of somewhere to break in and deface your website is not hacking IMO. That's someone calling you out for having your fly undone :D

Of course for Version 2.0 I could invest and spin up a lavarel app but for now I dont think its worth it
 

Post New Topic

Please SEARCH before posting.
Please select the BEST category.

Post new topic

Guest post submissions offered HERE.

Latest Posts

New Topics

Fastlane Insiders

View the forum AD FREE.
Private, unindexed content
Detailed process/execution threads
Ideas needing execution, more!

Join Fastlane Insiders.

Top