By snowcat
I followed this tutorial. How To Install WordPress with LEMP on Ubuntu 16.04(https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lemp-on-ubuntu-16-04) - I also followed Prerequisites.
Wordpress site works well with letsencrypt.
But I want to add wordpress multisite with sub domain&domain mapping. exsisted wordpress example.com wordpress multisite sub-domain test.example.com domain mapping second.com
I tried How To Set Up WordPress Multisite with Nginx on Ubuntu 14.04 (https://www.digitalocean.com/community/tutorials/how-to-set-up-wordpress-multisite-with-nginx-on-ubuntu-14-04).
But I can’t access neither sub-domain nor domain-mapped domain. I can’t access test.example.com / and second.com redirected to example.com.
How can I set up Wordpress Multisite with exsisted wordpress site.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
You’ll need to setup a WildCard DNS A
entry for sub-domains to map to your primary domain. If you look at the guide, you’ll see this:
server_name examplewp.com *.examplewp.com;
This tells NGINX to map all sub-domains to your main domain unless they actually resolve to another server block. This doesn’t, however, account for DNS.
You’ll need to add an A
entry to your DNS zone file for the WildCard (i.e. *
). That’d look like this:
A * DROPLET_IP
Where DROPLET_IP
is your Droplets IPv4 IP. With those two things taken care of, you should be able to use anything.examplewp.com and it resolve to the main domain. If it happens to be mapped using WPMU, then WPMU should take over and map the correct WordPress site.
One other thing to note is that LetsEncrypt doesn’t support WildCard domains, so you can’t pass:
letsencrypt certonly -d examplewp.com -d *.examplewp.com
You have to pass resolvable domains and sub-domains, i.e.
letsencrypt certonly -d examplewp.com -d www.examplewp.com
This may be an issue since you’re wanting to use sub-domain mapping as the only way (right now) to get a WildCard SSL Certificate is to buy one. So without a WildCard SSL Certificate, each site would be HTTP only (not HTTPS/SSL/HTTP2).
If you use sub-domain mapping and want SSL for each mapped installation, you’d need to purchase a WildCard SSL Certificate for your main domain and install it. LetsEncrypt won’t work for WildCards.
Passing multiple domains to the LetsEncrypt script in this case, would not be the best option as this is something you’re going to have to do over and over again for each and every sub-domain you add as a site. That means if you add two sub-domains today, you have to run it. If you add two more tomorrow, same scenario.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.