WordPress Multisite on CentOS 7.2, Nginx 1.9.5, PHP7, batcache, and HTTP/2

It was time for an overhaul of my go-to WordPress stack. For a long while, I’ve been running PHP 5.4 on CentOS 6 with Varnish. Technical times are changing and it was overdue for an upgrade;┬áso I bring you this! My first impression of PHP 7 – WOW, Just WOW! The speed increase is phenomenalContinue reading “WordPress Multisite on CentOS 7.2, Nginx 1.9.5, PHP7, batcache, and HTTP/2”

Get Up and Running with LetsEncrypt.org Certificates on CentOS 6 and nginx

If you don’t have git installed, use Yum to install it. [bash]sudo yum install git[/bash] Stop nginx, if it’s running. LetsEncrypt needs to bind to port 80 and/or 443 to verify your web server. [bash]sudo service nginx stop[/bash] Switch to root and git clone the letsencrypt repository. [bash]sudo su cd ~ git clone https://github.com/letsencrypt/letsencrypt%5B/bash%5D NowContinue reading “Get Up and Running with LetsEncrypt.org Certificates on CentOS 6 and nginx”

Web Server iptables Script

Here is an iptables script to set up a solid firewall on a CentOS web server. Remember to change the ip address on line 26 with your IP address, or you will lock yourself out of your own server! [bash]#!/bin/bash # Backup current iptables rules iptables-save > /etc/sysconfig/iptables-previous # Flush tables iptables -F # BlockContinue reading “Web Server iptables Script”

NFS Server & Client Setup on CentOS 6.4

Install NFS on the server [code]sudo su yum install nfs-utils nfs-utils-lib chkconfig nfs on service rpcbind start service nfs start[/code] Edit /etc/exports on the server [code]/directory/to/share 10.0.0.2(rw,sync,no_root_squash,no_subtree_check) /directory/to/share 10.0.0.3(rw,sync,no_root_squash,no_subtree_check) /directory/to/share 10.0.0.4(rw,sync,no_root_squash,no_subtree_check) /another/shared/dir 10.0.0.2(rw,sync,no_root_squash,no_subtree_check) /another/shared/dir 10.0.0.3(rw,sync,no_root_squash,no_subtree_check) /another/shared/dir 10.0.0.4(rw,sync,no_root_squash,no_subtree_check)[/code] Export the shares from bash [code]exportfs -a[/code] Install NFS on the client(s) [code]sudo su yum install nfs-utils nfs-utils-libContinue reading “NFS Server & Client Setup on CentOS 6.4”

A little PHP script to watch for 404 errors

This is a quick script which reads a standard RSS feed and then grabs the response header for each feed item and makes a log file of 404 errors. Useful in debugging sticky situations. [code language=”php”] <?php $link_queue = array(); $exception_queue = array(); $timestamp = date( ‘Y-m-d H:i:s’ ); $rss = simplexml_load_file( $argv[1] ); foreachContinue reading “A little PHP script to watch for 404 errors”

Some Helpful Varnish Commands

Look at incoming requests for URL varnishlog -c -m RxURL:”/somepage.html” Look at requests made to the backend for URL varnishlog -b -m TxURL:”/somepage.html” Requests for one specific host varnishlog -c -m RxHeader:”Host: somehost.com” See cache age for a specific host varnishlog -c -m RxHeader:”Host: somehost.com” | grep Age Test VCL compilation varnishd -C -f /path/to/file.vclContinue reading “Some Helpful Varnish Commands”