Watch videos with subtitles in your language, upload your videos, create your own subtitles! Click here to learn more on "how to Dotsub"

Install Domain Access

0 (0 Likes / 0 Dislikes)
Install Domain Access with Addison Berry In this lesson, we're going to get hands on with the domain access module by actually get it installed and getting a Drupal site up and running so that we can then dive into more configuration. We're going to start off by looking at the documentation so you can—there's actually copious amounts of documentation, so I'll point out exactly what we'll be following to do this installation in this tutorial. Then we will go ahead and get Domain Access set up, and that's also going to involve configuring our settings.php file. There's a special include that you need to have. So while domain access is a normal Drupal module, there are some additional steps that are required for you to do in order to make sure it gets installed properly. Once we have all of the things in place and we get it installed, then we're going to go ahead and test and just make sure that the installation did actually complete correctly. So let's dive in. So I'm going to start off on drupal.org/project/domain which is the Domain Access project page. So this is both where you can get the download for the module and also find documentation. So if you scroll down to the bottom, you get the downloads, and we're going to be using version 7. So you can download that or you can use Drush to download it into your Drupal site that you have installed now. And if we come back up and you look at the resources in the sidebar here, we can find the documentation, so let's go ahead and look at that. And you'll notice when you get to the Domain Access documentation, if you scroll down, there's a large subsection here. There's a lot of different things under this section. You can also see this in the sidebar. So there's a whole bunch of documentation that's in here. We're going to focus just on installation right now obviously. So I'm going into Installation, and you can see again there's a lot more stuff before installing. So one of the things that we're going to want to do is check to make sure our domains are actually pointing correctly. So we'll check all of the domains real quick. And then we are going to need to configure the settings.php file and then go ahead and run the installation. So if I go into Configuring settings.php, there are some notes about some things to be careful of. We're not going to change the default things. So it's fine to sort of skip over these things that you may or may not need to look at. But what I want to come down to here is this Add settings.inc section. This is the important part that's going to make this module work for you. So you'll see that you have two options for doing this. So what's happening is there's actually an include file, settings.inc, in the Domain Access module code. And Domain Access needs your settings.php file to know about that and be able to execute that code in order for it to work properly and read your domains and do what it needs to do. So this is the first step we're going to have to do before we actually run the installation of the module which then would just be a normal module installation. So you can see that we are going to want to add a line to our settings.php file. And simply we can copy and paste this. You just need to know where this settings.inc file is here, this one. It's in the domain module folder that we downloaded. There are other options for how you can do this if you want to include it, but this preferred method is preferred and is the one that we're going to be using in this particular tutorial. So here's the documentation, and obviously you can read a lot more around what's going on here. Before we go in and mess around with the settings file though, let's just verify that the URLs, the actual domain names, are all pointing to the correct Drupal directory first. So if we come over and look at the University of Drupal site that I've installed, this is at the udrupal.com URL. And I'm logged in, so you can see I'm already logged in to this one. Now if I switch over to news.udrupal, you can see that I'm not logged in. So this is another site. This is the other URL. But it is pointing to the same installation because I have that same title on the Drupal site, so it is pointing to the right place. And then we also have drupalalumni.com. So all three of the URLs are pointing to the site that I've just installed. I'm logged in on the original domain name that I created the site with which was udrupal. So we definitely have the domain names working. Everything's pointing properly. And so now it's all up to the Drupal site to figure out what to do with those domain names when they hit, and that's what Domain Access is going to do for us. So I'm going to go ahead and open up the file system here, so we can take a look at my Drupal installation. This is just the Drupal root you would normally see, and now we're going to go into sites. There are two things that I would like to do here. One is I just want to verify that I do have Domain Access. So I did get the download, and that's there and ready to install. And then the other thing is I'm going to want to go into my default folder where my site database settings are and such like that. And I'm going to make this change that I need to do to the settings.php file. So let's go ahead and open up settings.php and we're going to just go all the way down to the bottom. We're getting all this stuff, we're going to add some stuff to the bottom of this file. I'm going to go back to that documentation, and I'm going to copy/paste the line that I need. So we need to include and then we're going to use a global variable that defines what the Drupal root is because Drupal knows where its root directory is. And then we need to put the path to the actual file that's in that domain folder that we just looked at. And you can see in the second example, this has the standard typical location for that file which is exactly what we have on our site. We're not doing anything funny with the location of our modules folder. So we can actually just copy and paste this entire bit right here, and this is going to work on our site. So I'm going to copy that and then go back to my settings.php file and down here at the bottom, we're just going to add some lines that we just copied here. Adds a little space at the bottom so we can see this. So I added the comment—create some space for that. It's a good idea to comment it. Even if you don't copy this one, make sure you make a note of what this thing is here and why. And then it's just including— again, it's jumping down the path from the Drupal root to the settings.inc file which is included in that domain module folder that we've already downloaded. So that's all I need to do to change that. So let's save it. And with that saved, now we should be able to go through the installation process and have everything work the way it's supposed to be. So I'm just going to go to the module configuration page. Now one thing I do want to note is if you end up using Drush to do this installation, there are actually some specific instructions that you should use. So if you go back to the documentation real quick, if you go to actually installing the module, you'll see that there's some Drush instructions. You need to add the domain URI so that it knows what the default domain is going to be for the installation of the module. So just keep this in mind if you're using Drush, to read the instructions for how to do that and add this additional flag in there. I'm just going to do it through the UI though. So we'll keep it simple. So here, Module administration, we have Domain Access. Again, here are all of the modules that come with that package when we downloaded it. But all we need is the main Domain Access module. We don't need these additional ones right now. So we're just going to do the main Domain Access module and save it. Now you'll notice when this done that it's giving me a little bit of warning here that says content access permissions need to be rebuilt, and it gives me a handy link to be able to go do that. This is not an uncommon thing when you are dealing with node access modules, contributed modules, and it's a way for it to just sort of clean things up and make sure it has a clean slate as it begins to change how the access system works on your site. So we can click on this link to go rebuild permissions. You'll notice it's taking me to reports. So the way to find this if I didn't click that link directly is if we go to Reports and go to Status Report, if you scroll down, you'll see for node access permissions, we have a new entry in the status report. And that is giving us the rebuild permissions link here. And then I can go ahead and rebuild it from here. So let's go ahead and do that real quick. Done. So now we have the module enabled, we've rebuilt our permissions. We did put the include file in there, so let's go see and make sure it actually worked properly. So let's go look at the administration for domain access. So if we go up into the Structure section, you'll notice we have a new section here called Domains which is where we're going to manage this stuff. And you can see it is actually working. We have things installed properly. This default site that we installed it from is the default domain right now and it's the only one listed because we haven't configured anything else yet. So we have the University of Drupal. It's showing me the domain here. I'm using a dev version, but it's the same domain name. Udrupal is our main domain name, and we can see that it's active and it is set to the default obviously because it's the only one. But we now have Domain Access installed. So in this tutorial, we got Domain Access module installed properly. There's a little bit more that was involved in the process than just a regular module installation because A, first we had to make sure the domains were functioning correctly through Apache. So first we tested the domains, made sure all three of our domains were pointing to the Drupal installation that we set up, so that was good. And then before we actually did the installation of the module itself, we had to add the Domain Access include file to our settings.php because that's a critical piece that Domain Access has to have in the settings file in order for it to get things properly aligned with domain names. Once we had those things in place, then of course the installation itself was actually just a normal installation of a Drupal module. We enabled it. And then we were prompted to rebuild the permissions because this is a node access module and that's a very typical step we would need to take. So we went ahead and rebuilt the permissions, cleaned all that stuff up, and then we just went and looked at the Domain Access configuration page to verify that it was actually working properly. And we got to see the beginning of our domain list and where we're going to be able to configure our Domain Access domains.

Video Details

Duration: 10 minutes and 59 seconds
Country: United States
Language: English
License: All rights reserved
Genre: None
Views: 24
Posted by: drupalizeme on Mar 30, 2015

Install Domain Access

Caption and Translate

    Sign In/Register for Dotsub to translate this video.