How to make 3-level using PHP

I have a requirement from a client that my PHP web application be 3-tier. For example, I would have an Apache web server in the DMZ, but it should not contain any DB connections. It should connect to a medium server that will host business objects, but be located behind a firewall. Then these objects connect to my SQL cluster on another server.

I really did this using .NET, but I'm not sure how to configure my stack using PHP. I believe my front-end interface will invoke the middle tier using REST-based web services if I create my middle tier as a second web server, but that seems too complicated.

The main reason for this is increased security: we cannot have passwords on the first-level DMZ web server. The second reason is scalability - the presence of several servers at different levels that can handle requests. The final reason is deployment — it's easier if I can take one set of servers offline for testing before returning them to production.

Is there an open source project that shows how to do this? The only example I can find is a web server that hosts files from a shared drive on another machine (like DotNetNuke claims to be at 3 levels), but it is NOT safe.

Note: I looked in this question and I see a lot of similar questions, but I did not find anyone who really answered. This is NOT about the level of data access (although I will use it) - my main question is the design between the user interface and the middle tier.

+3
source share
1 answer

One option is to use FastCGI .

At the first level, it is easy to have front-end servers ( Apache , Lighttpd , NginX , etc.) connect to FastCGI servers at the second level.

Another option would be a reverse proxy from the first level to the second level. This is very similar to the first example, except that the 2nd level starts the web server, while it does not do with FastCGI.

, , - . 2 ( DMZ , ). , ... , , , ...

+6

Source: https://habr.com/ru/post/1783277/


All Articles