More than one server...

DanneA

New Member
Joined
Nov 26, 2022
Messages
7
Reaction score
2
Credits
72
If I want two or more servers on my Debian computer, should I put them in virtualboxes or LXC-containers?
For example, DHCP, Samba and Apache servers. I read a lot but do not get any clear picture how and what
I should or not should do and how it works. Each server have a lot of install guidelines but no guidelines
for the thought of more then one server on one computer. Maybe I could have all the servers straight in to
the Debian without any box or containers!?
Can any one unbend my question mark or help me with a link for a "How to" page for clarity.
Best regards
DanneA
 


The problem is that it depends.

If I was you and the servers that are provided by the Debian packages are good enough, and for your personal usage, go ahead and start "small" by installing everything in the computer itself.

Things get tricky in the following cases:
  • The versions Debian provide you are not recent enough
  • The servers are incompatible, e.g.: they depend on conflicting versions of the same library
  • ...
Those above are 2 examples where you want to virtualise, amongst many other valid reasons. Now, differences in terms of virtual machines and containers:
  • A virtual machine virtualises hardware resources. Therefore you need a kernel, modules / drivers, filesystems, and a full blown operating system stack.
  • A linux container virtualises the kernel resources. Therefore in a container you only have the user space: all the kernel and the modules, devices, filesystems,... are your hosts'.
This is why containers are much lighter and easier to maintain: essentially you don't need to patch neither the kernel nor any of the kernel-space stuff.

I'd say that a good set of rules of thumb are:
  • unless you need to have virtual hardware for a reason, e.g.: you need to run graphical applications independently,
  • or you need a use case that involves the whole distribution, e.g.: penetration testing or malware analysis with Kali are brilliant examples of using virtual machines,
  • or in cases where the underlying stuff is not a Linux kernel (just a bare metal hypervisor),
... containers provide clear benefits over VMs for a typical use case of "I need to run this one service in isolation", as long as your base machine is Linux.

And if you want to virtualise nonetheless, but the services are compatible for the base image you choose, you can put 2 servers in the same container. There's absolutely no problem.
 
Whenever you choose a method (and probably describe the problem a bit more complete, like "I want to access these from the internet", or "this is for 20 users within a business context",...) I'm sure we can provide you detailed guides.
 
Thanks gvisoc!
I am all alone with two Raspberry Pi but would like to have a webb page and a file server with my music on one RPi and then I have another RPi with VPN on. But I do not know how get them to talk with each other. Can I do it with installing DHCP-server on, for example, the RPi with VPN on?
Could then the VPN-server get contact with the other RPi that holds the Apache and maybe Samba?
On the VPN and DHCP server, do they talk to each other without problem on one machine? Same with the other with Apach and Samba, could they also talk to each other on that machine? And finaly can all of them connect each other through the DHCP server? Or am I lost in space?!
DanneA, Thailand
 
Ooh... yes! Should I put the servers in containers?! Is that a good idé?!
Or just straight in to the machines without any cotainer or virtualiztion?!
 
Long story short, for the servers to talk to each other, they need to be in the same network.

You use VPN if the machines are located in different physical networks. The VPN will allow you to integrate such networks together. But there’s also an easier alternative if you use Tailscale —> check this https://tailscale.com/. Tailscale lets you define a peer to peer VPN very easily without complex configurations. You should be able to get your project up and running easily with it.

If this is in your home network, however, as long as they get their ip address in the same range or in ranges that can see each other, you should be able to make them connect to each other just by setting each other to talk to the other’s IP.

One thing you should do is to configure the DHCP server to give them static ip, so that you don’t have one day 192.168.0.3 one day and 192.168.0.45 the next day you reboot one of them. This will simplify your deployment as you will be able to skip setting up a DNS resolver.

With regards to the containers, as I said: it is a good idea if you really need virtualisation and if you’re running things on a Linux host. Knowing now that your machines are raspberry pi, I definitely would rule out the VM completely, they are not going to work well I think. Containers are fine on the other hand, as they are just user spaces logically isolated, but using the same underlying Linux kernel as detailed in the post before.
 
I can´t writhe because I have`t enough english word.
 
Thanks again gvisoc!
I will experiment with what you told me. It is not so important, not fort Nox.
If I manage to get it to work I get happy and have learned a lot.
The test can crash and just start all over again...
Best regards
DanneA
 
If I want two or more servers on my Debian computer, should I put them in virtualboxes or LXC-containers?
For example, DHCP, Samba and Apache servers. I read a lot but do not get any clear picture how and what
I should or not should do and how it works. Each server have a lot of install guidelines but no guidelines
for the thought of more then one server on one computer. Maybe I could have all the servers straight in to
the Debian without any box or containers!?
Can any one unbend my question mark or help me with a link for a "How to" page for clarity.
Best regards
DanneA
I have 4. Apache2, nginx, ngrok and my hostinger vps. Granted the hostinger isn't installed on my box but it is accessible. If your talking about running a full blown server OS, that's another story.
 

Members online


Top