arrow_upward

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to link your domain with your VPS
#1
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.
sudo nano website.conf
and insert these lines into the configuration file :
<VirtualHost *:80>
DocumentRoot /var/www/website
ServerName website.com
ServerAlias www.website.com
</VirtualHost>
you can also add sub domains this way 
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 
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!
Thanks to ShadowHosting and Post4VPS for my VPS 5!
#2
Very simple procedure but simple mistakes always cause the problems when setting up DNS settings.
#3
Fxed the extra signs!

Also updated it with a bit more info
Thanks to ShadowHosting and Post4VPS for my VPS 5!
#4
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. ?
Heart LOVE FOR ALL  HATRED FOR NONE Heart
#5
(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
Thanks to ShadowHosting and Post4VPS for my VPS 5!
#6
(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
#7
(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.
Heart LOVE FOR ALL  HATRED FOR NONE Heart


Possibly Related Threads…
Thread
Author
Replies
Views
Last Post

person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting