Recommendation for server config for WordPress Staging servers [closed]

Anchor will setup apache or nginx for me – but which should I choose?!

Based on your concerns, I’d recommend Nginx -> Apache stack.


Please let me explain. By default, Nginx can only process static content, such as images, CSS and JS files. Nginx passes PHP requests to PHP-FPM or to other servers such as Apache. Nginx can still cache dynamic content via proxy_cache and fastcgi_cache. When people talk about Nginx, they usually mean Nginx -> PHP-FPM stack. Basically, there is nothing wrong with an Nginx -> PHP-FPM stack. But, for your requirements, it’s a big no-no.


Please let go through some of your considerations…

I’m hosting my own site here, so I want it fast

Apache is already the fastest server that I know of. It just needs right configuration to make it efficient. Unfortunately, not every host is willing to tune it to their individual customer’s requirement. It is not practical either to do so, when we consider the time to tweak an Apache server, than setting up an Nginx server (with PHP-FPM). The problems arises in Apache, only when there is a traffic spike (I mean concurrent connections).

my site, and my clients’ are quiet low traffic sites

The visitors wouldn’t notice any difference in performance, if the traffic is low. I recommend Nginx for high traffic environments where there is probability of C10K problem.

I’ll certainly be caching with WP-Supercache

Unlike W3 Total Cache plugin, WP-Supercache doesn’t work right out of the box with Nginx (with PHP-FPM), even though there is a great codex entry on how to integrate.

I use rewrites regularly for SEO purposes

It means that you must learn rewrites in Nginx or your host should be able to write the rewrites for you. Rewrites are easy in Nginx, once mastered. But there is a learning curve involved in it. Apache and Nginx work bit differently when it comes to rewrites.

I won’t have root access, but understand that I could edit non-root try files under nginx

The rewrites and how Nginx (with or without PHP-FPM) parses rewrites are bit different than the traditional Apache setup. For example, we can modify anything in .htaccess file and Apache picks it up on the fly. But, Nginx still needs to be reloaded (or restarted) for every change in the Nginx configuration. It doesn’t matter if you change a try_files or a rewrite directive. So, you may still need the root privilege or you may have to ask your host to reload (restart) Nginx server on every change in the Nginx configuration. BTW, Nginx doesn’t process .htaccess files.

Conclusion

An Nginx -> Apache stack can solve all the concerns mentioned above. It works right out of the box with WP-SuperCache and it processes .htaccess file on the fly. There is no need to learn Nginx rewrites too.