If you chose Drupal as your content management system, this guide will help you administer your shared hosting account.
What do Drupal users need know about shared hosting using Drupal on their shared hosting accounts? To begin with, Domain Access (DA) as well as relevant modules, facilitate hosting of multiple and sub-domains from one Drupal installation. There are special setup instructions between the Host and Site. Host refers to the basic web server system. Site refers to the Drupal installation. These allow shared hosting to work under the DA Module’s control.
Who is this Guide For?
This guide will benefit those with minimal knowledge of the fundamental networking and server technology.
What are the scenarios?
- The Domain Access can cope with complicated hosting conditions.
- Instructions deal with factors in enabling sub-domains within a single base domain. This is delivered from one Drupal installation.
- These instructions may be sufficient to help users configure a multi-domain and/or multi-installation. However, that is not the primary objective of this guide.
These instructions assume that:
- You run a website on a Virtual Private Server (VPS) account.
- Sub-domains come from one website.
- You run Drupal with the enabled DA module.
- You prefer that the site’s base domain operates as default domain in Drupal.
- You use cPanel web administration. Or else, can apply instructions to the preferred admin front-end.
- You have no issues with editing this document for clarity, coherence, accuracy, creativity, or any combination.
- You understand the txt, INSTALL_QUICKSTART.txtand README.txt found in the Domain Access installation folder sites/all/modules/domain.
The cPanel Function
Users must understand cPanel functions and how the Content Management System (CMS) fits into the aspect of running the Drupal site to better understand the solutions. Here are the presumptions:
- The website consists of three main configuration levels.
- Global settings at the Domain Name Server (DNS) level
- Local settings at the web server records level
- Content settings at the Drupal front-end CMS
However, you are not sure how to make all this work together.
- You are aware that cPanel can create sub-domains (active and/or parked). Yet, you may not know the difference in running a Drupal website. Or, how the DA delivers virtual sub-domains without Domain Name System (DNS) records.
- You know the meaning of document root. However, it is not clear to you how you can make the server identify sub-domain requests to the Drupal installation.
- You understand the difference between active and parked sub-domain records. The problem is you cannot determine the option that will work effectively for your needs.
- You know that it’s possible to redirect an active sub-domain manually. However, you are not sure when to use this option. Likewise, you do not know Drupal has an .htaccess file.
Having full control of the back-end server can be easier and more flexible compared to shared hosting. With the latter, the extent of your server’s capabilities varies. It may be necessary to configure some options depending on features provided by the web host. Here are some things to remember:
- Shared hosting providers limit the number of domains or sub-domains per account. cPanel is VPS-optimised. Features available on the VPS represent the subset of sever capabilities.
- The host disables features of the backend machine and web server that runs on various types of accounts. Solutions provided here may or may not work for some users.
- Technical standards or parameters specify the domain as your property. Your contract with the Internet Service Provider (ISP) can mean additional charges for registration and use of sub-domains. The DA module may respond to requests and send content using virtual or DNS-registered sub-domains.
NOTE: This should not be misconstrued as legal advice. It is your obligation as the user to resolve with your service provider any contract violations on your part for implementing it. The owner of this website, the writer, and editor of this article will not be held accountable for any dishonest implementation of Drupal.
Understanding the Solution
The solution depends on how the hosting server resolves sub-domains to Drupal installation. The DA can deliver content for active sub-domains using cPanel, and it can also accomplish this task for virtual sub-domains formed and handled within your website. To sum up, machines find your website through the DNS holding records. These match the base domain name to the IP address. You create a “wildcard” sub-domain with the document root fixed in the Drupal directory. This means you ask Drupal to transmit content for random sub-domains. All names are separated by dots at the left of the domain name.
Creating “Wildcard’ Sub-Domain
- To acquire the “wildcard” name resolution website using the cPanel, click on the sub-domains’ icon in the cPanel admin screen.
- This will take you to the cPanel subdomain management screen where you create a new sub-domain named with an asterisk “*” and document rootset to your Drupal installation:
- Click on the “Create” button and allow cPanel to create the wildcard name resolver.
You just created a wildcard “name resolver” entry in the DNS record for your website. It makes the backend server look by default to Drupal for all sub-domains not specified anywhere else. Assuming all circumstances remain the same, you can now serve content using Drupal for virtual sub-domains. The “index.html” or “index.php” file in the server document root will be ignored. If ‘virtual’ sub-domains are enough, you successfully completed the configuration.
What if it Fails to Work?
Failure can happen because the web host locked server settings in your httpd.conf files. It drives visitors for hosted websites to the web host’s document root. In this case, Drupal works for all sub-domains. However, visitors to the base domain receive an error message or the directory contents at /Public_HTML.
The cPanel domain management tools may or may not permit redirection from the server document root to a sub-domain or sub-folder. To instruct the server in finding Drupal installation for website content, edit the .htaccess file manually in the server document root.
Domain Access can serve content for active and sub-domains shown in the cPanel. It entails going to the sub-domain management’s panel. Set up the document root of each sub-domain you want in Drupal, to your server document root, or Drupal installation root. It will not affect operations of active and sub-domains with the document root and outside Drupal.
The benefit of active sub-domains (in cPanel) is the availability of back-end services which include email accounts, SMS, SSH, and FTP for users. These are also registered at the backend for every sub-domain.
For virtual sub-domains (served by Domain Access without being defined in the cPanel), available services come from the Drupal site. For example, this may or may not enable your website users to access sub-domain email through a desktop email client. To deliver active sub-domains through Drupal from cPanel domain management, you can create it as parked in your main address (http://yourwebsite.net). Otherwise, if you already created an active domain, set the document root to your Drupal installation.
There could be one or more websites spread across a single or multiple domain with none or several sub-domains. It serves content only from Drupal. It can also work with one or more systems, user groups and sub-groups. These are handled by one or more servers that run on bare metal or virtual machines. It is delivered by the cloud or system which is under your control or not.
Complicated solutions are required if you address several primary domains or websites hosted on various provider networks. These scenarios are outside the scope of these instructions. It is more than setting up roles as well as permissions on content inside your domains. It also means making them accessible at your website.
How to Add Top Level Domains
There are two ways in setting up your domains to the base domain. This permits you to use the Domain Access module in shared hosting.
- In cPanel administration panel, proceed to the Parked Domains Enter your top-level domainor choose an unassigned domain. Select “Parked Domain”.
- Click Save. This adds the new domain as parked domain. It points to the hosting account’s main domain.
- In case you need to install Domain Access to a different Drupal installation from the main hosting domain, navigate to the Addon domains. Type the domain name. cPanel will suggest a folder using the domain name you entered. Remove the suggested location. Then, enter the location where your base domain is pointed to.
In case you add top level domains as parked domains in your cPanel account, the parked domains will be the same as primary domain. If you opt for Domain Access, Drupal installation delivers different content to parked domains. This is the primary objective of Domain Access.
How to Add Sub-Domains
- Go to Subdomains in your cPanel interface.
- Enter the subdomain you want to use in the Domain Access.
- Delete the text after Public_HTML
- By default, when you add yourwebsite.net to the system, the document root text field Public_HTML/ice. Delete the icetext. Click Create.
You cannot use Domain Access for sub-domains or ports in DirectAdmin shared hosting. This is the case if the host will not allow you to set up virtual hosts.
If you wish to add a top-level domain:
- Log in the DirectAdmin interface.
- Proceed to Domain Pointers. You can find this in the Advanced Features category.
- Enter the new top-level domain.
- Check Create as an Alias. This is an important step.
- Click Add.
You have just learned how to administer your shared hosting using the Drupal platform.