Applicable to:
- Plesk Onyx for Linux
- Plesk Onyx for Windows
Question
How to set up a WordPress multisite on the Plesk server using subdomains?
Answer
Note: It is recommended to set up a network on a fresh WordPress deployment, since enabling multisite on a production website might cause some problems.
-
Create a new subscription in Home > Subscriptions > Add Subscription.
-
Install a WordPress instance for the subscription in Home > Subscriptions > example.com > Install WordPress.
-
Log into the WordPress instance as an administrator in Home > WordPress > example.com > Log in.
-
Go to Tools > Network Setup and configure the network to have sites on separate sub-domains.
-
Follow the instruction and update and update
wp-config.php
and.htaccess
files in Plesk > Subscriptions > example.com > File Manager.Note: If FPM by nginx is set as PHP handler or website uses nginx only configuration use the following article to add addtional nginx directives:
What are nginx rewrite rules for WordPress multisite? -
Relogin to the WordPress instance as an administrator in Home > WordPress > example.com > Log in.
-
Go to My Sites > Network Admin > Sites and create additional sites in your WordPress network.
For example:
example-net.example.com
example-org.example.com
example-us.example.com
-
Install WordPress MU Domain Mapping plugin.
-
Plesk > Subscriptions > example.com > File Manager and copy file
sunrise.php
fromwp-content/plugins/wordpress-mu-domain-mapping/
towp-content/
directory. -
Relogin to the WordPress instance as an administrator in Home > WordPress > example.com > Log in.
-
Go to My Sites > Network Admin > Settings > Domain Mapping.
-
Open
wp-config.php
in Plesk > Subscriptions > example.com > File Manager and add the following line beforerequire_once
in the end of the file:CONFIG_TEXT: define( 'SUNRISE', 'on' );
- Specify the site IP-Address or CNAME in the corresponding field.
-
Go to Settings > Domains and define domain-site mappings, using site IDs and domain names using. For example:
example.net
example.org
example.us
Site ID can be seen in the URL when you hover your mouse over the site name (Step 5) of the previous section.
Leave Primary checkbox selected, otherwise WordPress will redirect visitors from a domain to the subdomain it is mapped to.
Additional information can be found below:
At this point, multisite set up on the WordPress side is complete. Now, it is time to create these additional websites on the Plesk side. There are two ways to do this. It is possible to mix-and-match these approaches - all of them will work together:
Create additional domains under current webspace/subscription and point their document root to the document root of the main website (i.e. /httpdocs
). It gives more flexibility in terms of website settings for every site and allows to purchase separate SSL certificate for each domain.
-
Go to Tools & Settings > IP addresses > <IP Address>.
-
Select WordPress website
example.com
as the default website for this IP address.
In this case, it is not required to create any additional domain in Plesk - as long as other site names are resolving to the same IP address, web server will use the WordPress website as a default destination for any request that comes to this IP address. However, SSL certificate for the main website must include all domains added to the multisite network.
Warning: Plesk WordPress Toolkit extension treats multisite installations as a typical single-site deployment. Specifically:
- WordPress Toolkit will display WordPress installation, plugins, and themes on the main website of the network only.
- Plugins and themes installed via WordPress Toolkit must be “network activated” from WordPress admin dashboard.
Comments
10 comments
Great guide thank you and it almost worked perfectly. For my situation it required using 3. (Set the main website as default virtual host on the IP address) but then I also needed to create a wildcard webspace to get this to work. The wildcard webspace matches the wildcard CName record I created with my DNS manager. (Just sharing in case it helps anyone else)
A couple of things if you please. We just stood up up two new 17.8 Onyx boxes - pretty much done, pushing a new sites now.
One brand new wordpress install - went through config and htaccess steps to set it up multisite - that's working as I can see the tables being added when I add a site / make mods, have the users / themes / settings tabs all appearing fine under the subsites. I can sometime get to their dashboards, sometimes not and when going to a subsite url, the main site appears.
1) I don't see the top panel in your example, esp. "Webspaces" - and I cannot get the subsites to function correctly as separate domains per your instructions (domainA.com - domainB.com). I have the main site just setup as a simple domain, set as the default site on a shared IP - but it was setup as a domain and NOT a webspace (again, I'm not seeing that in 17.8.) I'm on Ubuntu 16.04 if that matters.
Could not having this setup initially as a WEBSPACE be part of the issue? Do I need to setup AllowOverride All for the directory in our Apache configs or something?... I had a multisite working on Plesk 12.5 ok but have spent hours on this puppy to no avail.
Hi there,
This document has been altered to allow for WP 4.5+ installs. However you state "Don't be confused by the fact, that you're configuring them as subdomains - you'll remap them later" Where do we do this now? Originally I would use the WordPress MU Domain Mapping plugin. Thanks in advance.
@webmaster
Most probably the root cause of the issue is that you are using Service Provider View. In this view there are no such items like Webspace. There are Subscriptions instead.
And when you created additional domains I suppose they were created in separate subscriptions.
In this case, you should create additional domains under one subscription. For example:
1. Create a subscription example.com in Plesk
2. Go to Subscriptions > example.com
3. Add the domains(i.e. example.net, example.org, etc.) under this subscription by clicking Add Domain button
I have modified the article to make it clearer. Thank you for your feedback.
@Jan van der Mei
I have checked this in test environment.
Indeed, Domain mapping tool is not included in Wordpress version 4.9.8. It is necessary to install the WordPress MU Domain Mapping plugin.
The article has been modified.
Thank you for pointing this out.
But if I Create additional sites in the Plesk and point their document root to the document root of the main website if I delete the additional site it delete the main root document of main website...
@mirko
Hi!
On Plesk Onyx 17.8 if the user removes additional website with docroot set as "/httpdocs" the directory of the main site ("httpdocs") will not be removed.
Hi,
What about SSL? Can Let's Encrypt auto-generate certificates for custom domains?
Best regards,
Nick
Hello Nickea
Let's Encrypt certificate may be obtained to secure any domain hosted on Plesk server if this domain is resolvable to Plesk server.
Guide.
The main/prime multisite site setup fine.
BUt this article does not appear to be updated and seems to make assumptions that it doesn't explain.
It assumes we will have top level Domains (like example.com) for ALL multisites. We will not. we have a few like My.ourdomain.com for which
there is NO other domain. (Our cloudflare DNS points my.ourdomain.com to the IP for ourdomain.com)
It seems to imply we have to setup the IP for our main domain as "shared"but ours is dedicated - 'shared' gives DNS error notices
method outlined doesn't actually create a sub-domain on our dedicated server?
It's confusing and leaves errors about DNS etc on Plesk panel, even though the sub-site created ("My")
Sid B.
Please sign in to leave a comment.