Hi
I setting up a reverse proxy on Nginx with Apache on the back end.
I am unclear - where do I install php? All, Nginx or just Apache?
Hi
I setting up a reverse proxy on Nginx with Apache on the back end.
I am unclear - where do I install php? All, Nginx or just Apache?
If you install PHP in nginx there is no need for Apache2 any more, since Apache2 is worse at serving static assets than nginx is.
This setup is mostly used in case an older Apache installation with some customisation are still used that can’t be (easily) moved to Nginx.
I personally haven’t run Apache in years, only nginx. I don’t miss Apache at all ![]()
Hi but my understanding is that it is “better” to have nginx serve static files and Apache serve the dynamic php content.
So my idea was a Nginx proxy and Apache server on each lamp droplet
2 mysql database servers and your previous comment about a Redis (sp) server.
1 Redis (sp) server.
With haproxy up front.
(I’m still trying to figure out the ssl)
Stepping back my idea is to launch a small web app I have built with a bit more heft than just on a lamp stack.
Per:
.https://blog.digitalocean.com/horizontally-scaling-php-applications/
Why the removal of Apache? Also would you have any other suggestions in general about a more robust setup for an initial lamp stack / tutorials?
That used to be the case several years ago, but AFAIK nobody does that anymore.
SSL should be installed on the HAProxy server as well as the Nginx servers so the HAProxy ↔ Nginx traffic is also encrypted (this is a good practice, see zero trust network).
Have you considered a cloud balancer instead of HAProxy, like Google Cloud Load balancer of AWS ELB? That way you don’t have to configure everything yourself and there’s SLAs on that so you don’t have manage them yourself, which is a huge win time-wise.
How are you configuring your MySQL servers? master-slave?
Hi thanks
So just a simple Lemp stack on the two app servers plus haproxy + redis + 2 MariaDB
Yes I am going to try to set up a simple master - slave set up and will use certs on all traffic ports.
That doesn’t look too hard (knock on wood).
As to the cloud services, I think I will need to k ow this. So I am taking a bit more time up front to get my head around how a system works.
Ps MariaDB will be RAM heavy. So maybe 4 GB ram plus 2 on all the others?
4GB and 2GB is not really a lot, it depends on how many traffic you expect if that’s enough. For low traffic (few per hour) its fine, but for high traffic (few per second) you’re going to need more.
Also, if you feel like doing something really fancy you can run MySQL in Master-Master mode using Galera. You’d need an odd number of servers though, so at least three. The advantage there is that if one of the servers ever crashes either of the other servers can take over without anyone noticing this has even happened, whereas you’d need to promote a slave to master manually if the master ever crashes.
However that may be one bridge too far for now.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.