PHP code on a separate server from Apache?

This is something that I have never seen, and I do not participate in my research, but my boss is interested in this idea. We look at some load balancing options and wonder if it is possible to install apache and php on several servers managed by a load balancer, but have all the actual php code on the same server with different apache servers pointing to the same central code base?

+3
source share
3 answers

For example, mounting NFS is certainly possible, but I would not recommend it. Most of the benefits of balancing balance are lost and you re-enter a single point of failure. When synchronizing code and rsync cronjob, you can handle yourself very nicely, or you can perform manual rsync during deployment.

What is the reason you need this central code base? I am 99% sure that there is a better solution, after which one server issues the code.

+4
source

, . Wrikken, , NFS . . -, Apache NFS, ( , ..) . Apache . , , , .

, - , APC. APC php . - /

0

PHP -, -, Apache . NFS . , NFS , . rsync , .

, , , javascript, css , . lighttpd - , - . "" php-. .

Keep in mind that PHP stores sessions on the local file system. Therefore, if you use sessions, you need to make sure that users always return to the same server. Otherwise, you need to do something like store sessions in memcache.

0
source

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


All Articles