Category: Linux
-
Get disk usage information for MySQL databases
Ever wonder how much space your MySQL database uses? Here you go:
-
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 phenomenal…
-
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. Stop nginx, if it’s running. LetsEncrypt needs to bind to port 80 and/or 443 to verify your web server. Switch to root and git clone the letsencrypt repository. Now cd to letsencrypt and run letsencrypt-auto. You’ll be greeted with several questions, first to enter…
-
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!
-
NFS Server & Client Setup on CentOS 6.4
Install NFS on the server Edit /etc/exports on the server Export the shares from bash Install NFS on the client(s) If there are no errors, check to see if your mount is active on the client with: Test the NFS Mount from the client And now that file should be on both server and client.…
-
Send load average to Graphite
#!/bin/bash LOAD=`cat /proc/loadavg | awk ‘{print $1}’` DATETIME=`date +%s` echo “some.system.metric.name $LOAD $DATETIME” | nc graphite.somedomain.com 2003
-
Graphite Graphs for WordPress
It’s no secret that I love Graphite. My co-workers think it’s a bit ridiculous how much data I feed into our graphite server. I may be a bit excessive, but I have a monitor in my office which allows me to see at a glance every little detail about our network in real time –…
-
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. Throw it in cron like this: */30 * * * * php /path/to/script.php http://somesite.com/feed/ >> /path/to/log 2>&1 Or run it on…
-
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.vcl…
