Jump to content

How do VPS services

If you've ever used a VPS, you know that it can be used as a webserver, but now I question; How does the dedicated server, that the VPS is hosted on, host a website on port 80 for all those VPS webservers? Because I have 1 public IP, and I can only set 1 port 80... Can anyone explain this a bit more to me? (Explain like I'm 5 if you can, I'm not that good at networking)

Link to comment
Share on other sites

Link to post
Share on other sites

What you're looking for is a reverse proxy. Common webservers like nginx can be configured to provide that and redirect traffic internally to a different machine/port based on the address given.

 

 

F@H
Desktop: i9-13900K, ASUS Z790-E, 64GB DDR5-6000 CL36, RTX3080, 2TB MP600 Pro XT, 2TB SX8200Pro, 2x16TB Ironwolf RAID0, Corsair HX1200, Antec Vortex 360 AIO, Thermaltake Versa H25 TG, Samsung 4K curved 49" TV, 23" secondary, Mountain Everest Max

Mobile SFF rig: i9-9900K, Noctua NH-L9i, Asrock Z390 Phantom ITX-AC, 32GB, GTX1070, 2x1TB SX8200Pro RAID0, 2x5TB 2.5" HDD RAID0, Athena 500W Flex (Noctua fan), Custom 4.7l 3D printed case

 

Asus Zenbook UM325UA, Ryzen 7 5700u, 16GB, 1TB, OLED

 

GPD Win 2

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Kilrah said:

What you're looking for is a reverse proxy. Common webservers like nginx can be configured to provide that and redirect traffic internally to a different port based on the address given.

That doesn't really answer my question... I want to know how it's possible that they can host multiple services to multiple VPS's on 1 port. For example, if I want to host 4 minecraft servers, all on 25565 and all different machines under the same public IP, how would one do that? How does that type of stuff work.

Link to comment
Share on other sites

Link to post
Share on other sites

That's precisely what the reverse proxy would do.

You get a domain, you make different hosts at your domain provider that are e.g. mc1.yourdomain, mc2.yourdomain etc.

The reverse proxy is configured so that if whoever tries to connect gave mc1.yourdomain:25565 then that is redirected to port X, if they gave mc2.yourdomain:25565 it's redirected to port Y. You have to configure your different servers run on port X and Y internally.

F@H
Desktop: i9-13900K, ASUS Z790-E, 64GB DDR5-6000 CL36, RTX3080, 2TB MP600 Pro XT, 2TB SX8200Pro, 2x16TB Ironwolf RAID0, Corsair HX1200, Antec Vortex 360 AIO, Thermaltake Versa H25 TG, Samsung 4K curved 49" TV, 23" secondary, Mountain Everest Max

Mobile SFF rig: i9-9900K, Noctua NH-L9i, Asrock Z390 Phantom ITX-AC, 32GB, GTX1070, 2x1TB SX8200Pro RAID0, 2x5TB 2.5" HDD RAID0, Athena 500W Flex (Noctua fan), Custom 4.7l 3D printed case

 

Asus Zenbook UM325UA, Ryzen 7 5700u, 16GB, 1TB, OLED

 

GPD Win 2

Link to comment
Share on other sites

Link to post
Share on other sites

The term Virtual Host refers to the practice of running more than one web site (such as company1.example.com and company2.example.com) on a single machine. Virtual hosts can be "IP-based", meaning that you have a different IP address for every web site, or "name-based", meaning that you have multiple names running on each IP address. The fact that they are running on the same physical server is not apparent to the end user.

Apache was one of the first servers to support IP-based virtual hosts right out of the box. Versions 1.1 and later of Apache support both IP-based and name-based virtual hosts (vhosts). The latter variant of virtual hosts is sometimes also called host-based or non-IP virtual hosts.

Slayerking92

<Type something witty here>
<Link to some pcpartpicker fantasy build and claim as my own>

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Kilrah said:

That's precisely what the reverse proxy would do.

You get a domain, you make different hosts at your domain provider that are e.g. mc1.yourdomain, mc2.yourdomain etc.

The reverse proxy is configured so that if whoever tries to connect gave mc1.yourdomain:25565 then that is redirected to port X, if they gave mc2.yourdomain:25565 it's redirected to port Y. You have to configure your different servers run on port X and Y internally.

Could you give me a few keywords I could type into google? Or a few links possibly? I'd love to learn more about that

 

Link to comment
Share on other sites

Link to post
Share on other sites

That's what I did in my first reply, look up reverse proxy setup

F@H
Desktop: i9-13900K, ASUS Z790-E, 64GB DDR5-6000 CL36, RTX3080, 2TB MP600 Pro XT, 2TB SX8200Pro, 2x16TB Ironwolf RAID0, Corsair HX1200, Antec Vortex 360 AIO, Thermaltake Versa H25 TG, Samsung 4K curved 49" TV, 23" secondary, Mountain Everest Max

Mobile SFF rig: i9-9900K, Noctua NH-L9i, Asrock Z390 Phantom ITX-AC, 32GB, GTX1070, 2x1TB SX8200Pro RAID0, 2x5TB 2.5" HDD RAID0, Athena 500W Flex (Noctua fan), Custom 4.7l 3D printed case

 

Asus Zenbook UM325UA, Ryzen 7 5700u, 16GB, 1TB, OLED

 

GPD Win 2

Link to comment
Share on other sites

Link to post
Share on other sites

I also want to add that certain programs (like MInecraft) support SRV dns records. An SRV dns record gives the client an ip/hostname and a port. Allowing it to look nicer for the user. more details

Link to comment
Share on other sites

Link to post
Share on other sites

I would I for example set up 2 vm's, both running Postfix and Dovecot. For different domains. Because a webhosting often comes with an email address, but how would I set thay up? Since smtp and imap aren't http so I cant proxy it with apache or nginx

Link to comment
Share on other sites

Link to post
Share on other sites

Doesn't matter that it's not http. This example uses nginx to reverse proxy ssh, ftp, sql etc:

https://www.howtoforge.com/reverse-proxy-for-https-ssh-and-mysql-mariadb-using-nginx/

 

Hosting your own mail server, especially the outgoing smtp is going to be a nightmare since nowadays most self-hosted origins will get blacklisted for spam prevention reasons. 

 

I used to host my email 10 years ago but now while I host everything else email is the one I pay the 20ish a year to have hosted by the same provider as my domain. 

F@H
Desktop: i9-13900K, ASUS Z790-E, 64GB DDR5-6000 CL36, RTX3080, 2TB MP600 Pro XT, 2TB SX8200Pro, 2x16TB Ironwolf RAID0, Corsair HX1200, Antec Vortex 360 AIO, Thermaltake Versa H25 TG, Samsung 4K curved 49" TV, 23" secondary, Mountain Everest Max

Mobile SFF rig: i9-9900K, Noctua NH-L9i, Asrock Z390 Phantom ITX-AC, 32GB, GTX1070, 2x1TB SX8200Pro RAID0, 2x5TB 2.5" HDD RAID0, Athena 500W Flex (Noctua fan), Custom 4.7l 3D printed case

 

Asus Zenbook UM325UA, Ryzen 7 5700u, 16GB, 1TB, OLED

 

GPD Win 2

Link to comment
Share on other sites

Link to post
Share on other sites

A VPS is a virtual machine. A switch adds more ports to a network. There's a virtual switch on the host machine, and each VM is "plugged into" it, getting its own public IP address just like a real machine. Also, the VMs aren't tied to the host and can actually be moved to another host while they're running.

 

The host machine doesn't need a reverse proxy, public IP address, or even an operating system. It runs a hypervisor, which is responsible for creating and running VMs.


Each physical server can fit dozens of VPSes, so the service provider has to buy a lot more IP addresses than servers. But to the network, there's no difference between a VPS and a dedicated server.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×