Multiple SSL Certificates for WordPress Multisite Domains in Plesk 11

by | Jun 6, 2013 | WordPress Tweaks

This article is based on my earlier article, Three Ways so Setup WordPress Multisite Domain Mapping in Plesk 11, and assumes that you are using WordPress Multisite with the Domain Mapping plugin to host and maintain multiple websites from the same WordPress installation. Here I will explain in further detail the third method that you can use to set up an additional domain for WordPress Multisite in Plesk which I called “Domain with Hosting”.

A WordPress Multisite installation is created on a single subscription in Plesk, which can only be assigned a single IP address and a single SSL certificate. What if we want to have additional websites with separate IP addresses and/or SSL certificates powered by the same WordPress Multisite installation? Here is how I did this on my MediaTemple DV4 web server.

1. Create a subscription for the additional domain in Plesk

Personally, I like to add a new subscription for the additional domain via the Server Administration Panel. You do this by clicking Subscriptions > Add New Subscription. Select a service plan that includes hosting, such as “Default Domain.”

adding-subscription

If you would like to assign a separate IP address to your additional domain, this is the place to do it. A unique IP will be required if you want to use an SSL certificate for your domain (unless you have SNI support on your server).

2. Point the DocumentRoot to your primary Multisite domain

We now want to point the DocumentRoot of this additional domain to our primary WordPress Multisite domain. We can do this by creating a file named vhost.conf in the additional domain’s conf directory. To avoid permissions errors, I usually do this via SSH as the root user. In addition to the DocumentRoot command, we can include a SuexecUserGroup command if we are running PHP as FastCGI. If the primary Multisite domain was primarydomain.com with the username of primarydomainuser, here is what the contents of the additional domain’s /conf/vhost.conf file would look like:

Because we’ll be using an SSL certificate, we also want to set the same DocumentRoot for all secure HTTPS traffic on the additional domain. We can do this by creating an identical file with the exact same contents named vhost_ssl.conf in the same conf directory.

UPDATE: If you are using nginx in Plesk 11.5, you will also need to specify the DocumentRoot for nginx.

3. Disable PHP open_basedir

By default, PHP enables the open_basedir command to limit the files that can be opened by PHP. If the file is outside the specified directories, PHP scripts will refuse to open it. However, because we have switched the DocumentRoot for this additional domain to point to our primary Multisite domain, we need to either update this value or disable it. We can set the open_basedir setting to “none” by selecting our subscription, clicking the “Customize” button, and selecting the “PHP Settings” tab.

open-basedir

4. Enable PHP to run as FastCGI on the new DocumentRoot

After setting the DocumentRoot to point to the primary Multisite domain, for some reason PHP wouldn’t properly execute on those files. Visiting the site in a web browser would result in downloading the PHP files instead of running them and generating the web page. Adding the following to the vhost.conf and vhost_ssl.conf files that you just created in your conf directory will force PHP to run as FastCGI on that folder.

5. Reload the domain configuration

After creating or modifying either vhost.conf or vhost_ssl.conf files in the domain’s conf directory, we run the following commands in SSH to reload the configuration for the additional domain (additionaldomain.com) and restart Apache:
/usr/local/psa/admin/bin/httpdmng --reconfigure-domain additionaldomain.com
/etc/init.d/httpd graceful

You have a fully hosted domain subscription in Plesk that is pointing to your WordPress Multisite installation! You are able to assign a unique IP and install an SSL certificate on this domain.

9 Comments

  1. Chip

    Thanks for this walkthrough. I seem to be having a little trouble, however. Everything is setup per the instructions above, but the CSS isn’t working.

    Any thoughts?

    Thanks again for the walk-through!

    Reply
  2. Chip

    Thanks Robert. I’ll give it a try and let you know the outcome.

    Reply
  3. Chen

    Hi, I am using Plesk 11.0.9.

    If I don’t create a new subscription in Plesk for the additionaldomain.com then how should I handle the DocumentRoot?

    Reply
  4. Robert Staddon

    @Chen, you do need to create a new subscription in Plesk for the additionaldomain.com in order for this approach to work.

    Reply
  5. Vishnu

    Our WordPress is set up on Windows 2008 Serves- how do I implement this process on that platform.

    Reply
    • Robert Staddon

      I’m sorry, Vishnu, I do not know how you would do this on a Windows 2008 server.

      Reply
  6. Nick Kuijpers

    Hello,

    I have been searching a lot on the internet about this, i have made several vhost.conf but nothing worked out.

    I have found this solutions, in Plesk 11, you can use the Additional directives for http field at Websites and Domains -> Domain.com -> Web Server Settings so you dont need to SSH things etc.

    Paste this in the Additional directives for http.

    Hope it works out for someone else :).

    DocumentRoot /var/www/vhosts/domain.com/httpdocs
    SuexecUserGroup verhuiswebsite psacln

    AllowOverride All

    SetHandler fcgid-script
    Options +FollowSymLinks +ExecCGI

    SetHandler fcgid-script
    FCGIWrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper .php
    Options +ExecCGI
    allow from all

    Options -Includes -ExecCGI

    https://www.niku-solutions.nl

    Reply
  7. Slim

    Thanks a lot @Robert
    It’s work for me (PLESK 12)
    I just disable Nginx for additionaldomains

    Reply

Trackbacks/Pingbacks

  1. Three Ways to Setup Wordpress Multisite Domain Mapping in Plesk 11 - [...] outline how to do this in a future article (UPDATE: This new article has been posted as “Multiple SSL Certificates…
  2. Changing the NGINX Document Root on Plesk 11.5 - […] in vhost.conf so that it points to a different virtual host can be a great way to support multiple…

Submit a Comment

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.