Post4VPS Forum | Free VPS Provider
How to link your domain with your VPS - Printable Version

+- Post4VPS Forum | Free VPS Provider (https://post4vps.com)
+-- Forum: VPS Discussion (https://post4vps.com/Forum-VPS-Discussion)
+--- Forum: Tutorials (https://post4vps.com/Forum-Tutorials)
+--- Thread: How to link your domain with your VPS (/Thread-How-to-link-your-domain-with-your-VPS)



How to link your domain with your VPS - Honey - 08-31-2016

Hey guys,

I'm gonna make a short tutorial on how you can link your bought domain to your VPS, you can even link it to someone's else VPS, this was covered recently in a topic but most people do not like to search so I think some people may find it useful if such a topic is located in tutorials.
So to start, make sure you have a domain and a DNS manager. I usually use Namecheap 88S offer domains [ .us / .xyz are my favorites ] and then use Cloudflare for DNS managing, to start, point your domain to your VPS IP for e.g. :
[Image: 9f3ec7c6e730ff4d5171f1b613dbe2bf.png]
after that SSH into ur VPS make sure you have root / sudo rights.

choose a directory for your website, for e.g. we choose /var/www/website for our tutorial.
make those directories.and put index.html files in them with any text as these will be the files our browsers will open when we goto that directory.
after that goto /etc/apache2/sites-available
create file matching the name to your website, in our case website.
Code:
sudo nano website.conf
and insert these lines into the configuration file :
Code:
<VirtualHost *:80>
DocumentRoot /var/www/website
ServerName website.com
ServerAlias www.website.com
</VirtualHost>
you can also add sub domains this way 
Code:
sudo nano blog.website

<VirtualHost *:80>
DocumentRoot /var/www/blog.website
ServerName blog.website.com
ServerAlias www.blog.website.com
</VirtualHost>

now enable the site using a2ensite, just enter a2ensite website in the console
and reload apache 
Code:
service apache2 reload

and now you should be able to goto that index.html file using your domain, It may not take affect instantly so if it didnt work than wait a few hours so changes can take effect and make sure your clear your cache [ Ctrl + F5 ].

If you face any issues reply so I can help ya out!



RE: How to link your domain with your VPS - Vbbbb - 09-24-2016

Very simple procedure but simple mistakes always cause the problems when setting up DNS settings.


RE: How to link your domain with your VPS - Honey - 01-24-2017

Fxed the extra signs!

Also updated it with a bit more info


RE: How to link your domain with your VPS - sagher - 01-24-2017

Really a useful Tutorial. but i have a question. can we add any custom domain name which was not a registered domain on any other host provider sites. but we just make it to redirect to my vps IP. ?


RE: How to link your domain with your VPS - Honey - 01-29-2017

(01-24-2017, 08:37 AM)sagher Wrote: Really a useful Tutorial. but i have a question. can we add any custom domain name which was not a registered domain on any other host provider sites. but we just make it to redirect to my vps IP. ?

Nope that's not how it works.

To make a domain redirect to your vps, you must buy it and then use your DNS registrar ( I use cloudflare ) to make it point to your vps.

Once you've done that, the domain will direct to your vps ip, If you further want it to direct to a specific folder this tutorial will help you out.

tl;dr nope Tongue


RE: How to link your domain with your VPS - Hero^ - 01-29-2017

(01-29-2017, 08:14 AM)Honey Wrote: Nope that's not how it works.

To make a domain redirect to your vps, you must buy it and then use your DNS registrar ( I use cloudflare ) to make it point to your vps.

Once you've done that, the domain will direct to your vps ip, If you further want it to direct to a specific folder this tutorial will help you out.

tl;dr nope Tongue

I think he says that, can he create a domain name himself. Like sagheer.sg sagheer.not etc.  Tongue . am i right @sagher


RE: How to link your domain with your VPS - sagher - 01-29-2017

(01-29-2017, 12:04 PM)Hero^ Wrote: I think he says that, can he create a domain name himself. Like sagheer.sg sagheer.not etc.  Tongue . am i right @sagher

Yes @Hero^ : i need a custom domain to redirect my vps IP. and a custom domain for my own webpage. if any.
i have a account on cloudflair. but they only works on web pages. not on complete vps. if they work then i don't know it.