I suggest rate-limiter-flexible for NodeJS servers. I never worked with Apache specifically, I just've treated it like a go-to LAMP webserver, but I googled it and here's what I found.
Here's the AWS default approach.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.