Build Script for Hugo Websites
Over the past year I’ve been building many websites using Hugo. Early on in development of these sites, I noticed the need for a build script. My main goal of the build script was to store the original uncompressed images inside my website’s code repository and have the built version of the Hugo website use compressed images. In addition to compressing images, I also needed a method to compress style sheets and JavaScript files. Below is an outline of how my build script works, code snippets that may be useful if you’re creating your own build script, and at the end of the page the full version of my build script.
Nginx Logging Privacy and Security
Below you will learn how to configure Nginx to stop logging sensitive information and help protect the privacy of your users along with protect authorization keys and query strings from being logged. Each section below outlines how to stop logging a specific page or piece of information. Multiple sections below can be combined to fully customize how you log visitors to your website.
Basics to Nginx Log Options
Before actually modifying any configuration files, here is an overview of the Nginx log options we will be using. Quickly, Nginx configuration files are generally stored in the directory /etc/nginx/
, with site specific configuration options beings stored in separate files inside the directory /etc/nginx/sites-available/
. The main Nginx configuration file is /etc/nginx/nginx.conf
.
ReText Change Color Scheme and Customization
Markdown has gained a lot of popularity over the years due to its easy to learn syntax, the increase of static site generators, and the benefit of having a formatted word file that works nicely with version control systems. ReText is one of the top Markdown editors, offering a preview pane of your document, a spell checker, syntax highlighting, Markdown exporting, along with some other features. That’s enough of my rambling, this post is how you can customize the color scheme of ReText to make it easier on the eyes. You can create your own color scheme, or use popular ones such as solarized or monokai.
Introduction to IP Failover for your Server
When managing any type of server, it’s generally wise to have a solution in place for when a server fails or when the server needs to be taken offline. When working on a high availability server setup, the question is how to quickly transfer activity from the failed or offline server to the backup server. One method is to use IP failover, which is the focus of this post. In short, IP failover is the method of moving the IP address of the failed server to the backup server, allowing requests to be handled by the backup server until the main server is once again functional.
SSH into Multiple Servers using MultiSSH
When you need to run the same maintenance commands on multiple servers, one option is to use a tool called MultiSSH (sometimes referred to as mssh). MultiSSH is a basic tool that allows you to connect to multiple SSH servers and run the same commands simultaneously on all of the connected servers. MultiSSH also allows you to run commands on a single server, a group of connected servers, or all of the connected servers. If you’re not using Linux, there are alternatives to MultiSSH, and alternatives also exist for Linux.