PHPNews

Redirect www to non-www subdomain

Nginx's server_name can handle multiple hostnames. But we often want to redirect "www" to non-"www" subdomains (or visa-versa!). (Don't forget to handle SSL connections to the domain you are redirecting). More info: https://t.co/WaBdUmDVwU pic.twitter.com/WcM2tEDqD7 — Chris Fidao (@fideloper) May 17, 2018 …

Continue reading »

Written by Servers for Hackers - - Aggregated on Thursday May 17, 2018


Using SSL Certificates with HAProxy

Overview If your application makes use of SSL certificates, then some decisions need to be made about how to use them with a load balancer. A simple setup of one server usually sees a client's SSL connection being decrypted by the server receiving the request. Because a load balancer sits between a client and …

Continue reading »

Written by Servers for Hackers - - Aggregated on Monday January 22, 2018


PHP Apps in a Subdirectory in Nginx

In this video, we work through how to put your PHP application in a subdirectory of another site. For example, we may have an application running at example.org but need a second application running at example.org/blog . This feels like it should be simple, but it turns out to be more complex and fraught with …

Continue reading »

Written by Servers for Hackers - - Aggregated on Sunday January 21, 2018


Forge Recipes

Here are the recipes we use from within Forge: App Server ## # Disable Unused Services ### # 1. Beanstalkd sudo systemctl stop beanstalkd sudo systemctl disable beanstalkd # 2. Memcached sudo systemctl stop memcached sudo systemctl disable memcached # 3. Redis sudo systemctl stop redis sudo systemctl …

Continue reading »

Written by Servers for Hackers - - Aggregated on Friday December 22, 2017


Creating a User in Ansible

Making users in Linux isn't necessarily as simple as making a username, and giving it a password. There are a few considerations you need to know about! Knowing these will make creating new users in Ansible easier. First, some Linux distributions have the adduser command, wihch is a shortcut (with sensible …

Continue reading »

Written by Servers for Hackers - - Aggregated on Tuesday December 5, 2017


How Ansible Vault Works

A typical Ansible setup will involve needing some sort of secret to fully setup a server or application. Common types of "secret" include passwords, SSH keys, SSL certificates, API tokens and anything else you don't want the public to see. Since it's common to store Ansible configurations in version control, we need …

Continue reading »

Written by Servers for Hackers - - Aggregated on Friday November 24, 2017


LetsEncrypt with HAProxy

LetsEncrypt with HAProxy This is a video from the Scaling Laravel course's Load Balancing module. Part of what I wanted to cover was how to use SSL certificates with a HAProxy load balancer. LetsEncrypt (certbot) is great for this, since we can get a free and trusted SSL certificate. Since we're using LetsEncrypt …

Continue reading »

Written by Servers for Hackers - - Aggregated on Thursday November 2, 2017


An Ansible2 Tutorial

Note : This is an update from the original Ansible article ! This one has been updated for Ansible 2, with some improvements in how I install/run Ansible. Ansible is a configuration management and provisioning tool, similar to Chef, Puppet or Salt. I've found it to be one of the simplest and the easiest to get …

Continue reading »

Written by Servers for Hackers - - Aggregated on Wednesday August 16, 2017


Building an Nginx Image

We cover how I built the Nginx image we used in our Docker setup. Note that the video, as usual, is more comprehensive than these notes! The Dockerfile We use a Dockerfile to define a base image, and the steps to take to use that base image and create our image from it. We can then use that built image and …

Continue reading »

Written by Servers for Hackers - - Aggregated on Saturday August 12, 2017