Code Monkey home page Code Monkey logo

nginx-wordpress's Introduction

nginx-wordpress

Nginx and PHP-FPM configuration for Wordpress install. Current work goes into "development" branch and is merged to master periodically. MySQL configs are designed for MariaDB on low resource VPS such as Digital Ocean $5 - $20 droplet. Some changes would be needed for more robust systems, mainly in my.cnf. Nginx and PHP should work as configured on wide range of systems.

Server Setup

The configuration files here are designed with Ubuntu and some specific package sources in mind. For Nginx I use the ppa from rtcamp at https://launchpad.net/~rtcamp/+archive/ubuntu/nginx. This is built with the module to enable intelligent purging of the Nginx page cache - an excellent, lightweight alternative to the various plugins. It does reqire the use of the Nginx Helper plugin (from rtcamp as well) to be installed in Wordpress to take full advantage and to work best with Nginx in general. This can be found at https://wordpress.org/plugins/nginx-helper/ and will also add a manual purge option to the admin.

For PHP I use the ppa at https://launchpad.net/~ondrej/+archive/ubuntu/php5 to keep up with the latest stable version. This is probably optional and the default Ubuntu source could be used fine.

For mysql I use MariaDB 10.x branch with great success. The source is https://downloads.mariadb.org/mariadb/repositories/#mirror=jmu&distro=Ubuntu and while regular mysql could probably be used without much trouble, you may need to tweak the my.cnf here and there. MariaDB is pretty much a dropin replacement, in this case for the mysql 5.6x line but I may have taken advantage of a MariaDB option that I forgot about.

In all these cases, if you use the altnerative sources, you should set up the appropriate apt preference files to keep the default versions from possibly installing over the preferred ones if the versions get mixed up and the default appears to supercede the installed ones. How to do that is explained here https://help.ubuntu.com/community/PinningHowto. My files are listed below as a reference.

https://gist.github.com/david-rahrer/084308227567a0355660

Permissions

I'm not going into this in much detail but since others seem to be using these configs, I also wanted to explain that I create separate permissions for each site (as seen in the php pool files). I use the default www-data as the group and the individual user as the owner. This works well with chrooting in order to allow proper restricted access to users through SFTP to avoid the less secure FTP which I no longer install.

That should be enough to allow anyone to use these configs as a starting point. I've tried to incorporate all the current, reasonable security options and those elements necessary to make Nginx work with WP. If you have any suggestions, let me know.

To Do

  1. Split into major sections using *.conf includes.

nginx-wordpress's People

Stargazers

Constantin DOBRE avatar Yaroslav avatar James avatar Chinmay Rajyaguru avatar  avatar Sebastian Rothe avatar Gilles Rosenbaum avatar Jeremy avatar Chris Vancoillie avatar

Watchers

 avatar James Cloos avatar Chinmay Rajyaguru avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.