Title: Hi y&#x27;all.<p>While refactoring a very old PHP website, I wanted to make it as portable as possible so switching providers (such as DigitalOcean to some other VPS) would be easier in the future. I came across this: http:&#x2F;&#x2F;12factor.net&#x2F;port-binding, talking about exposing the web site on a port. I had always wondered why Rails was usually on Port 3000 while my local PHP website just ran at some URL. I got to digging more and I think I started drowning in confusion. Does Apache listen on 80&#x2F;443 and just spawn PHP processes (or so I&#x27;ve read?). Is this what it does with Phusion Passenger for Rails? If so, does Rails still get served at localhost:3000 in this case?<p>It mentions the Thin client for Ruby, which is a web server, that is built on top of Rack, which is a web server interface, but there is also a reverse proxy Nginx (but Nginx is also a web server)? Rack and Thin seem to have identical interfaces, so I&#x27;m not sure what is going on here. Why doesn&#x27;t a PHP app have to do any of that? Is it because Apache handles it? Also I also don&#x27;t understand the details of CGI, FastCGI, WSGI, etc. and why each language needs its own gateway interface. Is Rack the WSGI of Ruby? I understand (I think) that at a very high level, it is a specification for a web server that, instead of serving documents, can pass an HTTP request along to a program which returns a response, that the web server forwards back to the requester.<p>I feel like I have a lot of details but I have no idea how they all fit together. I think what I&#x27;m looking for would startanswer would start: &quot;A user makes an HTTP request from their Browser to retrieve a web page sitting on some random machine somewhere. There is a socket connection established (IP:PORT#) and it sends streams of bytes under the TCP protocol...&quot; &lt;-- Not even sure if this is correct<p>Thanks in advance for any help or redirection to other resources!
Upvote: