How to install a stub site on a server

How to install a stub site on a server

08:09, 25.11.2022

Article Content
arrow

  • Create a stub site in ISPmanager
  • Installing a stub in Apache

When renting a virtual server, you may encounter a situation where your IP has already been used by someone else. It may have hosted sites, probably had some domains linked to it, or mirrors. When the IP address is assigned to a new server, you might inherit some surprises when a third-party domain is bound to the IP, the web server will receive requests for which there are no settings on the server. The consequence of this will become a problem with the ranking, as search engines will consider these domains copies of your site.

Protecting yourself from such is very simple – you must place a stub site on the server, which will filter orphan domains, not allowing them to affect the work of your main site. This stub site can be made in the form of a simple HTML page with a message to those who by mistake stumbled upon it

Create a stub site in ISPmanager

To create a stub site through the ISPmanager control panel, you need to create a WWW domain, specifying it as a priority. To do this:

  1. Go to your ISPmanager account, go to the "Domains" section, and then to the "WWW Domains" subsection.
  2. Select New.
  3. Fill in all the fields marked with a red asterisk, as well as all the others, as you wish.
  4. At the very bottom of the list, be sure to check the "Priority" box and click "Ok".
  5. Upload the stub files to the server () - now visitors will see your message.

Webmasters familiar with HTML and CSS can easily edit the welcome page to make it a little more informative and presentable. To do this, in the "WWW domains" section, select the newly created stub site, and in the "Catalog" menu, open the file index.html. Here you can change the appearance of the page to your liking.

how to install a stub site on a server

Installing a stub in Apache

Users of the Apache web server, which uses the LAMP complex, can also easily install a stub site. First, create a folder for downloading the site files:

mkdir /var/www/plug.site


Then load the stub files into it in one of the convenient ways. You can use FTP or sFTP protocol to do this. You can also manually create an index.html file by filling it in a console editor – but this is more complicated and less convenient.

When the folder with the stub site files is ready, you will need to set up access to these files on the web server side:

chown -R www-data:www-data /var/www/plug.site


After that, you can proceed to the creation of a configuration file for web server – <VirtualHost>. This file must be placed first in the list of all configurations of sites, otherwise, it will not work. To make it first, add some zeros in its name. For example, in the case of Ubuntu or Debian, all you need to do is edit the default configuration file in the nano editor:

nano /etc/apache2/sites-available/000-default.conf


Three zeros in its name will put the file at the top of the list, so it becomes a priority file. The contents of this file must be edited:

<VirtualHost 121.121.121.121:80 >
   	ServerName plug.site
   	DocumentRoot /var/www/plug.site
</VirtualHost>


Only instead of 121.121.121.121.121 specify the real IP address of your server, and instead of plug.site specify the name of your stub. /var/www/plug.site – this is the path where the stub files are stored.

Here we end our material. Thank you for your attention!

views 2m, 58s
views 2
Share

Was this article helpful to you?

VPS popular offers

Other articles on this topic

How SSL/TLS Handshake Works
How SSL/TLS Handshake Works
cookie

Accept cookies & privacy policy?

We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the HostZealot website.