TechsBot

How To

Blazing Fast WordPress Blog with Nginx, PHP7 & Redis

Posted on .

Blazing Fast WordPress Blog with Nginx, PHP7 & Redis

Introduction

Introduction

WordPress is the most popular CMS (Content Management System) on the Internet because of its flexibility. It works on top of MySQL and PHP processing. In this tutorial, we will focus on Installing WordPress with Nginx server and RedisCache on Ubuntu 14.04.

Recommended VPS Hostings

To get started with this guide you should have a VPS server. VPS server gives a greater flexibility and control over your server. I recommend Digital Ocean or Linode. Both of them are in the market for a long period of time and I personally use both servers for my and my client’s websites.

What is? & Why?

So before getting into the Installation process, let’s talk what we are going to install and why?

Nginx

Nginx(EngineX) is a web server software, which can be also used as a reverse proxy, load balancer, and HTTP cache. It’s popular for its high performance, stability, rich feature set, and easy configurations. When compared with Apache, Nginx is much better to handle traffic with low memory footprint.

PHP7

I’m not going to explain what is PHP and it’s uses. The major difference between php5.6 and php7 is its performance. The newer version got better performance results than the old one. And WP is totally compatible with php7.

MariaDB

In case you are not familiar with MariaDB, it is a community-developed fork of MySQL server. It’s an opensource and faster than MySql Server.

Redis

Redis stands for REmore DIsctionary Server. It will manage your database and store the values in Memory. Redis can be used as a database by writing data on your SSD, so it’s a NoSQL solution.

So are you afraid that it will take time to install and configure all the above? If so, don’t worry. It won’t take more than 10 minutes to configure all of it. 🙂

Because we are going to use EasyEngine.

EasyEngine is a tool developed by rtCamp to handle Nginx server. With EasyEngine all we have to do is running few commands on your VPS terminal to complete everything. It’s compatible with Debian 7/8 and Ubuntu 16.* but it’s very stable on Ubuntu 14.04.

Install EasyEngine

First, we have to install the EasyEngine, open your VPS terminal and enter the command below.

wget -qO ee rt.cx/ee && sudo bash ee

That’s all you just installed EE on your server.

Install WordPress

Now it’s time to install WordPress with Redis, php7. EE gives you few options to choose from,

ee site create example.com --wp # install wordpress without any page caching

ee site create example.com --w3tc # install wordpress with w3-total-cache plugin

ee site create example.com --wpsc # install wordpress with whisp-super-cache plugin

ee site create example.com --wpfc # install wordpress + nginx fastcgi_cache

ee site create example.com --wpredis # install WordPress + nginx redis_cache

You can use one of the above commands to install WordPress. If you still have doubt, if I need a WordPress blog on domain Techsbot.com with Redis & php7  I’ll run the following command.

ee site create techsbot.com --wpredis --php7

You have to answer few questions by EE, say Yes(Y) for everything and answer all the questions regarding the Redis and php7 too. That’s all. You will get a username and password for your WP blog in the terminal itself. You can also use –user=admin –pass=password to set custom username and password for WP blog.

You will also get two plugins pre-installed on your WP blog,

  • Nginx Helper: to clear the cache
  • Redis Cache: To connect WordPress with Redis and to clear the cache

Activate Let’s Encrypt SSL

You can activate let’s encrypt SSL for your blog using EasyEngine. You just have to add –letsencrypt along with –wpredis –php7

In case you already have a live WP blog without SSL and want to activate SSL for it, it’s also easy with EE. Use the below command to activate it.

ee site update techsbot.com --letsencrypt

Note: You might get “Unable to Setup, Let’s Encrypt” error while activating SSL for a blog hosted on Linode. Check out this page for the solution.

Conclusion…

That’s all. You got a fast loading wp blog. In the next tutorial, I’ll write about Monitoring Your Server for Memory, I/O usage and more… If you have any doubts about this tutorial please don’t hesitate to fire it in the comments.

Thiru Kumaran

Thiru Kumaran

There are no comments.

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.

View Comments (0) ...
Navigation