Please refer to the following steps to add a website/domain to a VPS.
To host only one website on a server, we don’t have to create a virtual host, we can simply make sure that Apache is running and upload our files to /var/www/html and the site will be online at once.
But, if you can add multiple website/domain, you have to create a virtual host for a new website.
Now, we will create a virtual host with domain name abc.com, please replace it with your actual domain name.
Create a file for the virtual host configuration with the following command:
For Ubuntu:
nano /etc/apache2/sites-available/domain1.com.conf
Please add the following lines to the configuration file.
<VirtualHost *:80>
ServerAdmin test@abc.com
ServerName www.abc.com
ServerAlias abc.com
DirectoryIndex index.php index.html
DocumentRoot /var/www/html/abc.com/public_html
LogLevel warn
ErrorLog /var/log/httpd/abc.com_error.log
CustomLog /var/log/httpd/abc.com_access.log combined
</VirtualHost>
For Ubuntu, we have to enable the virtual host first by performing this command:
a2ensite domain1.com
Restart apache
On Ubuntu:
systemctl restart apache2
Now, let’s create a file in /var/www/html/abc.com/public_html, don’t forget to replace the abc.com with your actual domain name.
mkdir -p /var/www/html/abc.com/public_html
nano /var/www/html/abc.com/public_html/home.html
Then, insert the following line to the home.html file
<html><center><h1>Welcome to abc.com</h1></center></html>
Verify the setup
Navigate the website abc.com on your web browser.
You will see a page like this
Welcome to abc.com
Regarding the name server:
If you want to point your website to your VPS, you will need to install the BIND DNS server in your VPS. Please refer to the following article it will help you to install and configure the BIND server.
http://www.servermom.org/how-to-install-and-setup-bind9-on-ubuntu-server/
http://www.yolinux.com/TUTORIALS/LinuxTutorialWebSiteConfig.html#DNS