How can one server host multiple websites?

How can one server host multiple websites?

How can one server host multiple websites?

Using one server to host multiple websites is possible and relatively easier as well. This article will help you cut costs by hosting more than one website on a single server. For this purpose, the more straightforward method will be using the cPanel.

The subsequent few headings in this article will explain the steps for adding another domain using only one server.

The pre-requisites for understanding this tutorial on How can one server host multiple websites include:

  • An already existing hosting account
  • Access to the cPanel

Other essential points that you should understand to move forward are as follow:

  • For the purpose of helping you understand this tutorial, our primary domain will be:
    • easy
  • This domain is the one that you already control and use through your hosting provider.
  • Now the new domain (the subdomain) that you want to add in the same hosting will be:
    • com
  • Nameservers are the next item on the list. If you are not sure what this term is, then read the small intro below, but if you already know this, then skip to the next part:
  • Nameservers can be easily thought of as how your website’s visitors (potential or otherwise) will be able to access your server and the website without using the IP address, which your visitors will have to use in the absence of nameservers.

So, the nameservers are responsible for sharing the IP address and domain names with the internet.

  • Now, the primary nameserver will be ns1.oneserver.easy
  • And the secondary nameserver of the server will be ns2.oneserver.easy
  • Also, there will be an IP address that the add-on domain will use.

How can one server host multiple websites?

The simplest way to do this is by using cPanel. If you have gone through all the above points, we can now move to the next part, where the add-on domain will be discussed. If you are still confused, that is also fine. Go through the above points again and move forward. You may get a clear understanding when practising it.

  1. Add-on domain, what is it?

The add-on domain is a feature in the cPanel. It helps when you have more than one domain you want to manage by using only one hosting account.

Add-on domains, which can be multiple, are great as the same cPanel is used to host all of the add-on domains.

Add-on domains can also get sub-accounts like email addresses if needed.

  1. Why are these add-on domains practical?

To put it simply:

  • You get to save money/capital and time
  • No additional hosting accounts are needed if you want to use multiple domains
  1. How does it work concerning the resources your primary domain gets from your hosting plan?

This is how it works.

When you add one add-on domain, your existing hosting’s features are now divided into two. Both the domain and the add-on domain can use the resources 50/50.

These add-on domains are kept inside a sub-directory in the “home directory.” This sub-directory is the one that routes your website’s visitors towards the add-on domain or domains.

When creating the add-on domain, you can name the sub-directory. You can also save it at the location you want to. For example, the document root for one add-on domain will be found here:

/home/$user/$addon-domain/.

Now, based on our example, the subdirectory for the add-on domain’s public html subdirectory will be as follows:

/home/$user/ onedomain.com/

  1. Preparation is essential, so what should you do before creating the add-on domain?

Before a single server tries to host more than one websites, the add-on domain, updating your domain’s DNS will be helpful by making sure that the server knows the exact location of where it is being hosted. This is not something that you have to do, but it will be helpful nonetheless.

If you are unsure of the exact names of the nameservers and the IP address that your hosting is using, then our recommendation is to contact your hosting service provider. They can email you all the details, and you can save the information for future use.

Once you get your hosting provider (which is sometimes called the domain registrar) information, use it to make sure that your website’s domain’s DNS settings are updated.

Tip: you can use who.is for searching your domain’s registrar if you are still unsure about it.

This way, you can see which company registered your domain, and if it says that the domain is still unregistered, go ahead and purchase the domain name you want as per your preferences.

Now about the exciting stuff:

  1. Adding the add-on domain in the cPanel: the steps for the server to host multiple websites

When you open the cPanel, you will see a feature saying Add-on domain. This is how you add the add-on domain.

cPanel’s domain section is where you want to search, and the following figure may be of some help:

This figure shows the “Add-on Domains Icon in the cPanel user interface.”

These are the steps that you have to follow:

  1. Find the New Domain Name field, and enter your selected domain name. As per the example we have discussed, the domain name will be: onedomain.
  2. Now, do you recall the FTP name? Make sure that this username is written in the field after the above one. Considering the default setting kicks in, it will be a oneserver.
  • In this next step, you must ensure that the document root is placed in the right place, as discussed above. So here the default value will be: /home/$user/ onedomain.com/
  1. Now it is time to enter the password of your choice and then confirm it. This password will be the one through which you can access your domain in the future.
  2. This is not a step but an important note that you should understand. In case you want to give access to a developer in the future, then you can select the checkbox available for the FTP account option while selecting the add-on domain. But if you ask us for our suggestion, we will suggest against using this option.
  3. Hit the Add button, and that’s it.

Image: How can one server host multiple websites? This image shows the cPanel user interface where the option for creating an add-on domain is available.

NOTE: If an error occurs in this interface, it means that the hosting service provider you are using has not added this feature by enabling it. If this is not the case, then another reason may be there. You should contact your hosting provider at once so that the issue can be resolved sooner. Continuing forward without resolving it is not the right way to go.

  1. How to verify the DNS settings?

cPanel is amazing; whenever an add-on domain is added, it will automatically create the DNS zone file for the domain. The zone editor interface will show the domain name and the IP address in the cPanel.

The correct features may not have been permitted if this information is unavailable.

Contact your hosting provider and ask them to add the Advanced DNS editor features. As soon as these features are enabled, the DNS records of your domain can be seen by you.

The next step after adding the DNS record is the start of the propagation period. This may take up to 1 whole day, which is why you will have to wait. As soon as the propagation period is passed, your domain will be accessible to the public everywhere.

All setup? What’s next?

Once you have added the add-on domain, start working on it and build your website on the new domain with the same hosting.

If you want some suggestions, check our blog post on Using WordPress for Website creating, along with the blog posts related to selecting the right plugins, themes, and more.

In case of any query, confusion, or just a review, comment below or contact us online through our website. We are always happy to hear from you.

Leave a Reply