This article extends the setup explained in the previous article.
Briefly, the setup consists of a load balancer, an HTTP server, and a PHP-fpm backend, all running in a Docker Swarm environment as explained here.
Previously the load balancer was bound to the manager node in the Docker swarm because it needed access to the Let’s Encrypt certificate files. To prepare for a fully replicated and fault tolerant design, this needs to be fixed so it can run from any node.
Because of the mesh network in Docker swarm, the load balancer does not need to run on the manager node where the external IP is bound. It can run on any host; the mesh network will route the request to the right container. But that requires us to replicate the Let’s Encrypt certificates and make sure they can be renewed and reloaded independently of which host the load balancer is running. This article explains how I changed that and moved renewal into Docker.
Continue reading “Let’s Encrypt selfcontained inside Docker”
The book is published in 2014 so it is starting to show some age. Even though ASP.NET MVC 5 is the last version until it changed the name to ASP.NET MVC Core which is in version 2, see the version history here. So why read a four year old book? Many projects still use MVC 5 and it allowed me to gain an overview of the technology before diving into MVC Core. Unless you have a particular interest in MVC 5 I would recommend a book about MVC Core instead.
At 624 pages and 17 chapters, I read it in a couple of weeks. It does start to show it’s age when referencing jQuery and AngularJS, it is rather old versions mentioned. But the chapters about the MVC framework are sound and contains a good walkthrough about each main feature of the framework. If you need a primer on MVC 5 I will recommend it.
Continue reading “Book Review: Professional ASP.NET MVC 5”
Your deployment environment is a tool that should be sharpened to allow maximum productivity. I have seen many developers where their deployment environment is less than optimal, hurting their productivity.
Ranging from, developing directly on production sites. To develop on a shared server. And finally using a local development environment, which I think is the most optimal way to do it.
Developing directly on production is “fast”, but remember the quote
Slow and steady wins the race
If you develop directly in production, the business will be all over you when you break things, and you will break things! So take the time to get a setup that allows you to go fast in the future.
A local development environment has many advantages and with Docker, it is easy to set up. I will show how I handle the setup for my development. Including tip for how you can take advantage of a local development environment.
Continue reading “Optimal deployment environment for productivity boost”
There are many reasons for running a website on HTTPS instead of the regular HTTP. One reason is that Google Chrome soon will start to mark HTTP sites as insecure, possibly spooking your visitors. It is also a signal to your visitors that the communication between them and your website is protected.
In this article, I will describe how to set up Let’s Encrypt which provides free HTTPS certificates. It is part of a continuous effort to make the setup, described in the earlier articles, best-practice. I also offer some background information about HTTPS certificates for the interested reader.
Continue reading “Setting up HTTPS on Nginx using Let’s Encrypt”
Apparently, performance on a website is essential. Slow sites are a pain for all visitors, and often slow sites put excessive load on the servers as well. To improve the performance of a website, a few tools will help us to pinpoint areas to enhance. It is a combination of settings in Nginx and WordPress. It builds on the setup described in this article but you can use the advice standalone. Most of the optimizations are useful on any web platform, not just WordPress, and Nginx.
Continue reading “Nginx and WordPress performance optimization 78% load time improvement”
This article builds on the platform described in the last seven parts, a WordPress setup running on AWS using Docker. In this article, we will look into how to improve uptime and scalability for the service by replicating it across multiple servers. To allow for replication, several challenges need to be solved. How to handle this is covered in this article, including comments on a few problems I found like Docker nodes running out of memory and how to fix it. And network problems in Docker swarm mode.
Continue reading “Docker setup – part 8: GlusterFS and Docker on multiple servers”
When running a blog or webshop, uptime monitoring becomes essential. We usually do not visit our own site 24/7, so we need some help to make sure we are notified if anything breaks. There exist many different tools for this. But one tool that I think solves this very cheap and easy is uptime robot, it is a hosted monitor service that monitors uptime for our site. How this work is explained in this article, and I will also touch on a few alternatives.
Continue reading “Docker setup – part 7: Monitor uptime / status page”
Recently I was in the situation where I switched from my existing mail provider to Gmail. But for some reason, the migration option in Gmail did not want to connect to my old mail account. But I found an ok way to transfer the emails anyway. This article contains a guide for how to do it.
Continue reading “Transfer emails from IMAP account to Gmail”
When you have worked in a specific area for a long time, many of the tasks begin to be repetitive. One way to keep sharp is to engage the brain with programming puzzles. A site that contains many puzzles is hackerrank.com. The name is a bit over the top for my taste, but they keep an extensive list of many different programming challenges.
Each challenge is solved in the programming language you choose. It makes a great way to both keep the skills up to date and practice using programming languages that you do not use that often. Especially the challenges that are rated medium and up are good for keeping your skills sharp.
I have tried to tackle one of the most difficult challenges; spy game revisited if you keep on reading there will be spoilers so if you want to solve the problem your self, please stop reading. I will implement the solution using C# .NET. You can find the code here.
Continue reading “Programming puzzles – Spy game – NPComplete”
Redundant PHP-fpm service
Now the service stack has a load balancer, redundant Nginx web servers, but the PHP-fpm server is still only a single service. Most of the processing happens in the PHP-fpm server when serving a page request. The part prohibiting us from replicating the PHP-fpm service is that session data is stored in the local filesystem on the server. So if we just replicated the PHP-fpm server without replicating the sessions it would not work.
In this part, we will do the necessary changes to support a redundant PHP-fpm service.
Continue reading “Docker setup – part 6: redundant php-fpm server”