By Abisar
Just out of curiosity, why is Apache preferred for Wordpress one-click?
I just created one and wanted to know the reason and if it’s completely fine to use Nginx instead.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi!
I maintain the DigitalOcean one-click images and did some testing with a LEMP stack for the WordPress image a couple years ago.
Originally the WordPress one-click was built using a LAMP stack because LAMP was at the time much more widely used and supported by the wider open source community. Most of WordPress’ documentation also assumes you are using Apache and some tweaking is required for WordPress rewrites on Nginx that is not required on Apache.
When I performed my review we did so to see if switching to LEMP would reduce base memory use on 512MB droplets (not a plan we offer any longer). MySQL can be a memory hog so that was our primary concern. My testing of the two alternatives found little difference in the base memory use.
The choice to stick with LAMP was made both for those technical reasons but also to ensure that a user spinning up a droplet with the stack would be less likely to encounter confusing information if they run into problems or want to customize their installation.
Our one-clicks are generally intended to be a quick-start to get going with a particular software stack but they are also often the first experience a person may have with the software. Taking that in mind we try to ensure that the one-click experience encourages that learning and provides something that as much of the community documentation outside DO as well as in our library will be applicable for.
It is possible to host WordPress using only Nginx without Apache at all, but because WordPress won’t be able to use .htaccess files (.htaccess files are an Apache feature, they don’t exist in Nginx), you’ll need to regularly be reconfiguring Nginx for various WordPress plugins. You should only take that approach if you’re comfortable with the command line and server administration.
Another option is to use Nginx as a reverse proxy in front of Apache. This allows your apps to still use .htaccess files but you get the benefits of Nginx. That’s the approach ServerPilot uses. There’s more info about it here:
https://serverpilot.io/community/articles/how-serverpilot-configures-your-lamp-stack.html
maybe because vast majority use apache as web server. wordpress needs htaccess file to work and to use nginx with wordpress you need many changes in configuration. as for the last part of your question, ofcourse its better if you choose Nginx over Apache.
if you follow this tutorial you can create and run wordpress site with nginx in couple of minutes only.
How To Install WordPress with Nginx on Ubuntu 14.04
if you want to use Ubuntu 16.04 How To Install WordPress with LEMP on Ubuntu 16.04
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.