Introduction to Domain Access for Drupal 7

This page is archived

We're keeping this page up as a courtesy to folks who may need to refer to old instructions. We don't plan to update this page.

In this introductory series we'll learn how to manage multiple "sites" on one Drupal installation using the Domain Access project. Domain Access allows you to have different domain names with different content and look and feel, while providing the maintenance and user account benefits of just one site.

Tutorials in this course
More information

In this introductory series you will learn how use the Domain Access project to let you manage multiple "sites" with different domain names from just one Drupal installation. Domain Access "multisite" works differently from the core multisite feature in that you truly only have one site to manage. There is just one code base and one database. Domain Access takes advantage of Drupal's node access system to give the illusion of multiple sites. In this series we start off by getting some context through several presentations that explain what Domain Access offers, and why you might use it, how DNS and Apache web servers work, and what you need to understand about the node access system. Once we dive into the hands-on work, you will configure Apache to work with multiple domain names, and get Domain Access installed on your site. Then you will configure a very basic Domain Access site, learning how to share and restrict content, change themes, and set up permissions for fine-grained access control.

Additional resources

Domain Access project (drupal.org)

More information

This series will implement the same example as the Multisite series did, but with Domain Access instead. You can see and compare the two methods. First, let's look at some other examples using Domain Access and see what we get when we download the package from Drupal.org. We'll also talk about the features provided, along with some things to be aware of and consider when choosing Domain Access.

Additional resources

Domain Access project (drupal.org)

More information

When working with domain names and getting a website to show up in your browser, it can be a little confusing to sort out which bits of the puzzle are where. You need to be able to properly configure the domain name server (DNS) so your browser can match up a domain name with a web server, and then make sure the Apache web server knows which files to direct that incoming domain name to. In this lesson we're going to walk through the process from the browser request to the website files. We'll take a look at the Apache documentation on virtual hosts (or vhosts) and discuss where to find this configuration. Then we'll take a look at some example vhost files to see what's going on in there.

Additional resources

Apache Virtual Host documentation

More information

Domain Access can do its magic because of the Drupal node access system. In this tutorial we'll walk through the basics of how this system works, highlighting the two main methods, and then explain why this may be important information for you. We won't be diving into the code side of things, but instead outline the basic concepts for anyone who needs to interact with this system. When using a module like Domain Access, you should be aware of the Drupal context in which you are working, even if you hopefully never have to dive into the details.

Additional resources

Controlling Access to Content Overview (drupal.org handbook)
Node access developer documentation (api.drupal.org)

More information

In this lesson we'll be building a simple university site, udrupal.com, with different areas, each with their own website: the main site, a news site, and an alumni site. The news site is simply a subdomain of the main domain name, news.udrupal.com, and the alumni site actually has its own separate domain name, udrupalalumni.com. To get this done, you're going to learn how to confirm the DNS is working for the domain names. That is, that they are currently pointing to the right server. Then we're going to configure an Apache vhost on our server so that Apache knows where to find our Drupal code base. We'll finish things up by installing our main Drupal site, udrupal.com.

Additional resources

Written tutorial based on this video

Categories
Drupal 7
More information

In this tutorial we will get hands-on with Domain Access by getting the module installed. This is a more involved process than a regular module installation, but we just need to make sure we have a few things in place first. We're going to need to make sure we have our domains functioning correctly through Apache, and then add the Domain Access include file to our settings.php. With the configuration and module in place, we'll also verify that it is working properly and take a look at our domain list.

After watching this tutorial you will be able to properly install the Domain Access module, with its additional steps, and then verify that the installation was correct.

Additional resources

Domain Access project (drupal.org)
Domain Access Configuring settings.php (drupal.org handbook)
Installing the Domain Access module (Drush instructions) (drupal.org handbook)

More information

With the main Domain Access site installed, we now need to get our other domain names added to the site and working. In this tutorial we'll review the settings for domains, add the Alumni and News domain names, and then test that all three domains are working properly.

Additional resources

Basic Domain Access module configuration (drupal.org handbook)

More information

One of the biggest reasons to use Domain Access is to control the content for multiple domain names. In this tutorial we'll dive into content on our three sites. We'll start by sharing content across all the domains, and then create domain-specific content. To make managing the content across our domains easier, we'll then enable the included Domain Content module. This will provide us with some nice administrative tools to keep track of things.

More information

In addition to different content, you may also want to differentiate your domains in how they look and change some of the basic site settings to make them appear more as separate sites. In this tutorial we'll use the Domain Config and Domain Theme modules (included in the Domain Access package) to let us do just this. We'll change our settings on one of the sites to set the homepage node to the About page we created earlier. Then we'll make the Alumni site look quite different by giving it a new theme. Through this process you will understand things you need to watch out for when configuring Domain Access sites, and how to be appropriately cautious with your settings.

More information

To really make Domain Access work the way you need it, you need to make sure you set up your roles, users, and permissions correctly. We've been setting things up on our site as the administrator, but so far our site is not configured for other people to be involved. In this tutorial we're going to configure the permissions so that we have authenticated users who can create and edit content on particular domains. We'll also have several editors. Two of the editors can only manage content on their particular domains, while one editor will have access to all content across all three domains.

In the process of setting this up we'll review the Domain Access permissions documentation, then dive into configuring them. We will also look at how we can set a default domain for a role, even though we won't need that for this use case. To test things out, we'll create some content as different users and see how the editors can or can not interact with that content.

To get things moving in this lesson, we are starting off having already created a number of users, and adding an editor role to the site. We don't walk through this process in the lesson, so if you need a refresher for creating roles and users, you can watch Hands-On: Creating Roles and Users from the Using Drupal series.

Additional resources

Domain Access Permissions (drupal.org handbook)

Categories
Drupal 7
More information

With the basics of our three domains set up, you're ready to build out your sites. We've covered the main steps to get you started, but you'll find that there are a lot more options available to you as you build. Which additional modules you use will depend heavily on your particular needs. In this tutorial we'll talk about the other modules that are included in the Domain Access package, which we haven't used in this series. We'll also look at a list of other contributed modules that work with Domain Access to extend its feature set even further.

Additional resources

Domain Access modules (drupal.org handbook)
Domain Access related contributed modules (drupal.org handbook)

This course appears in the following guides:
Site Building
A guide to site building in Drupal 7.

Legacy Site Building