0

I made a couple websites on a drupal multisite setup.. and I want to start using https. And.. I'm just lost. Can anyone help me get started?

So, here's the details of how I have things set up..

So I have like a drupal 7 install on ubuntu, with 3 sites.. all in the var/www/html/sites folder, so for example, the folders are named

site1.example.com
site2.example.com
site3.example.com

and the sites.php file directs the requests so like

$sites = array(
    'domain1.com' => 'site1.example.com',
    'domain2.com' => 'site2.example.com',
    etc
);

and as far as dns is concerned, each domain just points at the IP of the ubuntu server and drupal handles the rest.

All that is so far so good. Got several working sites.. each domain goes to the right site.. etc. But they use http. How.. do I go about.. getting a certificate that handles the 3 sites so that they can use https? I've not set this up before.. I've been trying to read through whatever I can find.. but I'm confused! Sorry, not sure what to do, I'm just .. lost!

0

Are you using a module to handle the multisite configuration? A place where you can associate each site to a domain, theme and other configuration settings. Also you should be able to add https protocol to the desired domain.

If you don't use any module, check settings.php of each site looking for $base_url where you can change it from http to https.

  • I'm not using a module, I just have an Ubuntu server and that is the directory structure and sites.php setup that I have. DNS wise, the domains all point at the IP address of the server. Works pretty much out of the box, with no modules or server configuration or anything. I was mainly wondering how to set up a certificate for these domains. Think I might have to mess with the virtual hosts or something.. hmm. If I can find an answer I'll post it.. – Benjamin Thvedt Sep 21 '17 at 20:55
0

Alright .. solution time. Found a solution.. took me a little while to understand. (I, um, guess there's more than one way to skin a cat.. and more than one way to do multi site. This is a solution that works with my particular setup)

So the first step is to set up a virtual host (Once again I'm using Ubuntu.. version 14.04 if you wanna know.. although I'd bet the overall steps would work for any other distribution even if the details were slightly different)

So I set up a virtual host as described here: https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts

So for like, domain1.com on my multisite instillation, my virtual host file looked like this, more or less

<VirtualHost *:80>
    ServerAdmin myemail@gmail.com
    ServerName domain1.com
    ServerAlias www.domain1.com
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

My DocumentRoot is exactly the same as my drupal base instillation Also, my DNS doesn't use www so .. I'm not sure if I really needed that ailas but I had it

Then.. for this domain.. I had to use LetsEncrypt and got a free certificate as described here: https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-14-04

(And I had to open port 443 to traffic on my server too .. I was using AWS and they use a thing called "security groups" so I added port 443 to the server's security group on the admin panel)

And then.. bingo! My site in my multisite setup can use https now. I expect I would have to simply just repeat the steps for any other sub-site that I want to use https for. I feel like there would be a way to use some kind of like... multi domain certificate.. for like, every site.. somehow ... But this way is free and doesn't take too long!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.