2

Recently, I tried to deploy a web project to a virtual machine. I used the Ubuntu server as my OS, but while following along some tutorials I came to the fact which was very confusing for the beginner like me. I had to install the Nginx server on top of a server (Ubuntu server). I don't understand why I have to install a server on top of a server?

Can you please help me to understand why this flow has been taken?

Aziz
  • 123
  • 3
  • In casual speak, it's common to call the operating system a server, but strictly speaking Ubuntu Server isn't really a server (it doesn't really serve anything by itself), Ubuntu server is an operating system designed to run server applications. – Lie Ryan Dec 20 '18 at 10:37

1 Answers1

5

Very roughly: A Linux system speaks UNIX. It gives you the ability to run UNIX programs by offering the syscalls open(), malloc(), socket() etc. etc.

A web server like nginx speaks HTTP - it implements the commands GET/PUT/POST etc. that you use for internet browsing or for running REST applications.

UNIX is extremely powerful, but it doesn't contain all functionality in the world. It is simply much more efficient to develop and install an operating system and application programs separately than to write one, extremely huge, system that does everything. If UNIX came with all the programs that can run on UNIX, it would be 1000GB large and take a month to install. Nobody wants that, so we compromise by distributing operating systems and applications separately, and everyone can pick the applications they actually want.

The fact that both are called 'server' is confusing, but in the end 'server' means nothing more than that a component exposes functionality that other components or users can use to create even smarter components. Under this perspective, pretty much all software is a server of some kind. For instance, REST applications build on top of the services that web servers and browsers offer, so the hierarchy can be in three levels or even more.

Kilian Foth
  • 107,706
  • 45
  • 295
  • 310
  • 1
    So, to be clear, Linux is the kernel, Ubuntu server is the operating system and Nginx is the application program here. What I understand that designers of the Ubuntu server have abstracted out the part where we need to "speak HTTP". Now, Nginx developers are trying to fill out that part where it needs to speak HTTP? – Aziz Dec 20 '18 at 07:35
  • 1
    Yes, that's it. (It's helpful to remember that UNIX was invented in 1972 and HTTP not until 1989. The basic functionality in UNIX is *much* more fundamental than web browsing!) – Kilian Foth Dec 20 '18 at 07:37
  • 1
    @MohammadAziz: Note that this is exactly the same as with any other software. If you install Windows, and you also want to write documents, you need to install Word on top. If you install Windows Server and you also want to serve web pages, you need to install Internet Information Server (or Apache, or Nginx, or whatever) on top. If you install Windows Server and you also want to host a database, then you need to install SQL Server (or PostgreSQL or MySQL or whatever) on top. – Jörg W Mittag Dec 20 '18 at 13:02