So you have a web server and you have a folder of files. Lets say this folder of files is a simple website. When i go to its url in my browser, how does that server know where to find the directory that has my folder of files (my website)?
Is this a joke?
>>57974761
Is it dns?
>>57974830
A root directory you moron
>>57974944
Right.... but commercial web servers are huge... are there just a superfluous amount of peoples websites all in the same root directory right next to each other?
>>57974735
https://lmgtfy.com/?q=Apache+virtual+host
>>57974977
You can assign any directory to be root for a web server. It just means root for that particular user. Websites can be on the same machine or different machines on a subnet. With DNS it really doesn't matter.
when you visit a web address, example.com, for example, you are really visiting example.com's server IP on port 80 (443 for https), for example 206.14.144.96:80 which is the port the web server (usually Apache or Nginx) is running on. the web server software then loads the index.html file from the directory that is set by default as the location for the website (Apache has this set as /var/www/html by default on a Linux system) subsequent pages, example.com/test, for example would be another index.html file in a directory called test, that is a subdirectory of the main server directory (following the Apache example, example.com/test 's files would be located in /var/www/html/test)
>>57974977
exactly
>>57975103
Okay i see. Thanks for the explanation. So does the ip address trabslate into directions to the apache server to find my website files?
>>57975355
No, first you need your DNS to be set up correctly so that every fqdn can resolve to the appropriate IP, then on Apache you will setup different virtual hosts each with their own root (the website).
In the Apache configuration file you'll also let it know which virtual host should serve the HTTP requests coming for a specific address.