VPS with two (or more) different websites - Clarifications

7 posts / 0 new
Last post
#1 Tue, 08/04/2015 - 09:42
Vertix

VPS with two (or more) different websites - Clarifications

[First of all, thank you for this great resource. I can't wait to try it]

About my problem:

I would like to clear all the confusion about the first installation of virtualmin through the install.sh script.

The following is a fictional example, but I'm sure it represents a very common situation.

This is the STARTING POINT (= POINT "A" = current situation):

  • just bought a vps (for example at ovh) and installed Ubuntu (but nothing more!!)

  • just bougth 2 different/unrelated domains from a registrar. For example: 1) paintings.com 2) soccer.com

This is my GOAL (= POINT "B" = what I would like to achieve):

  • Install Virtualmin panel and host the 2 websites on the same vps (each one with its own domain)

VERY IMPORTANT:

QUESTIONS:

A) Do I need to install a LAMP stack BEFORE installing Virtualmin? (I'm 99,9% sure I don't)

B) What FQDN do I need to use in this case? Do I need to buy a third domain (like mysupervps.com) from a registrar and use it as FQDN only? Or should I use a fictional subdomain of paintings.com or soccer.com, like hello.paintings.com or hello.soccer.com?

C) After Virtualmin installation, in order to create the 2 websites, can I follow this guide? Is this the right way? Video-tutorial: https://www.youtube.com/watch?v=MDhDBiwE7bE

Here is a summary of the procedure shown in the video.

In the registrar website:

0- For each domain you bought, point its name servers to your vps ip (for example: assign to ns1.paintings.com and ns2.paintings.com the ip 111.222.111.222 where the ip is your vps ip)

In your vps Virtualmin panel:

1- Go to Server->Apache webserver. Click on the "Create virtual host" tab and fill the form

2- BIND DNS Server->Create Master Zone. Fill the form and click "Create". You will be redirected to "Edit Master Zone"

3- Edit Master Zone->Address (add various records)

4- Edit Master Zone->Name Servers (add various records)

5- Click on "Apply Configuration", then on "Apply Zone", then on "Stop BIND" and finally on "Start BIND".

6- Go to "Networking and Addresses" in your webserver section and configure the CNAMEs using the "Alternate virtual server names" field

CONCLUSION:

I'm willing to create a well-detailed guide if I can manage to solve these problems. This way other newbies will not waste a lot of time trying to get things working.

Tue, 08/04/2015 - 11:10
andreychek

Howdy,

A) Do I need to install a LAMP stack BEFORE installing Virtualmin? (I'm 99,9% sure I don't)

Nope! Virtualmin's dependencies are installed when running the install.sh script.

B) What FQDN do I need to use in this case? Do I need to buy a third domain (like mysupervps.com) from a registrar and use it as FQDN only? Or should I use a fictional subdomain of paintings.com or soccer.com, like hello.paintings.com or hello.soccer.com?

Most people use a sub-domain of an existing domain that will be hosted on their server.

After adding "paintings.com" as a Virtual Server to your server, you could then add 'hello.paintings.com' as a DNS 'A' record to make sure it resolves properly.

C) After Virtualmin installation, in order to create the 2 websites, can I follow this guide? Is this the right way? Video-tutorial: https://www.youtube.com/watch?v=MDhDBiwE7bE

Well, I didn't watch the video... however, based on what you're describing above, I would not recommend performing those steps.

The things you are showing above are generally all done for you when the domain is added to Virtualmin.

Also, it's very rare that you would need to go into Server->Apache webserver and Server -> BIND DNS Server.

You'd typically be making any changes for your domains through Virtualmin itself... Virtualmin tries to make that all very easy.

The one thing you would want to setup, is to make your server act as a nameserver (if it's going to be the primary nameserver for your domains).

There are details on how to set that up here:

https://www.virtualmin.com/documentation/dns/faq#How_do_I_setup_nameserv...

Tue, 08/04/2015 - 12:06 (Reply to #2)
Vertix

Thank you for your reply!! Just to be clear, all the steps I wrote above were referred to the Virtualmin panel. But I guess that now Virtualmin does all the configuration for a new domain automatically.

Anyway, the most important part is to understand the FQDN to declare during the installation process. About that, I would like to ask you one more thing. If I understood everything correctly, the steps are:

1) Buy the two domains from a registrar (like NameCheap) and buy the vps

2) For each domain, go the the registrar and make the respective name servers point to the ip of my vps

Question about point 2: Do I need to wait for the changes to propagate before installing virtualmin on my vps and declare the fqdn?

3) Install Virtualmin with the .sh installer, declaring as FQDN a subdomain of ONE of the domains that my vps will host.

Question about point 3: Does it matter which domain I use as FQDN? In the original example, does it matter if I use hello.paintings.com or hello.soccer.com? (as long as the domain I use is hosted on the vps and the corresponding subdomain is added as IPV4 - A record)

4) Create 2 new virtual servers for the 2 domains (with Virtualmin guided procedure)

5) Configure your name servers on your vps using the following procedure (from the docs you linked):

"...After registering your nameservers at your domain name registrar -- you'll want to log into Virtualmin, select your "example.com" domain, click Server Configuration -> DNS Records, and create a new "A - IPv4 Address" record for ns1.example.com and ns2.example.com.

Lastly, you'll want to tell Virtualmin to use your nameservers when it generates NS records for new Virtual Servers that it creates. You can do that by going into 'System Settings' -> 'Server Templates' -> 'Default Settings' -> 'BIND DNS Domain', and set 'Master DNS server hostname' as well as 'Additional manually configured nameservers'. ...."

Is there anything else I need to do to have 2 working "Hello World" websites at paintings.com and soccer.com?

Tue, 08/04/2015 - 13:18
andreychek

Howdy,

Just to be clear, all the steps I wrote above were referred to the Virtualmin panel

If I understood the steps you were sharing above, it looks like they had you going into the Webmin section, rather than using Virtualmin itself.

After logging into the control panel, there are two links in the top-left... Webmin and Virtualmin. It puts you into Virtualmin by default, but if you want to get further "under the hood", as they say, you could go into Webmin.

I'd suggest caution going into Webmin, unless you know for certain that it's necessary.

For each domain, go the the registrar and make the respective name servers point to the ip of my vps

After you've created nameservers in Virtualmin using one of your domains, and then configured those nameservers at a registrar like Namecheap -- you can then simply tell any new domains you purchase to use those nameservers.

Anytime you register a domain name, you'd then just tell them to use ns1.paintings.com and ns2.paintings.com. This won't work though until you've made a Virtual Server called paintings.com, and added the necessary DNS records to it (as described in the DNS/Nameservers link above).

3: Does it matter which domain I use as FQDN? In the original example, does it matter if I use hello.paintings.com or hello.soccer.com?

It does not matter, just be sure to add a DNS 'A' record for whatever you select.

The rest of what you mentioned looks good!

-Eric

Tue, 08/04/2015 - 13:37 (Reply to #4)
Vertix

Thank you very much!! That was very helpful.

As soon as I install everything successfully I will post a detailed tutorial or screencast to help other users.

P.s. You missed one question:

"Question about point 2: Do I need to wait for the changes (to the registrar) to propagate before installing virtualmin on my vps and declare the fqdn?" I know that until changes have propagated I won't be able to access the vps with the domain name but I was wondering if in the meantime I could start installing virtualmin on the vps. Will the installer refuse a fqdn if it is not yet "resolvable"?

Sorry if some technical terms are not too precise -.-' Thank you again

Tue, 08/04/2015 - 14:13
andreychek

You can set the FQDN to anything you want, it does not need to resolve (yet). Then just add the DNS 'A' record for it after you add the domain later on, which will ensure it resolves.

In the meantime, you can just access Virtualmin using the IP address.

-Eric

Tue, 08/04/2015 - 14:16 (Reply to #6)
Vertix

Great!! Everything is crystal clear!! Thank you very much Eric =)

Topic locked