Recently I ran into an issue when using Nginx behind an SSL terminator (load balancer). Both $scheme in Nginx and $_SERVER[‘HTTPS’] in PHP were incorrect, because Nginx thought it was behind HTTP. I finally figured out a fix, which is a bit hacky, but it works. In your site config, above your server block, put […]
Systems Admininistration
Nginx + Varnish Wrong Port With Redirects
I recently switched my blog and many of my sites over to a new server stack, with Varnish running in front of Nginx + PHP-FPM. I noticed an issue however. When requesting a path like: http://brandonwamboldt.ca/assets, I was being redirected to http://brandonwamboldt.ca:8000/assets/. This alone took me a few minutes to discover, as the original problem […]
Speed up SSH logins
On most of my Ubuntu servers, I found that logging in took 15-30 seconds when using SSH. Eventually I narrowed down the problem to three different causes. The hostname took a while to lookup My server hostnames look like this: someserver.sparkcreek.ca. Apparently the DNS lookup for this was taking a while, when it didn’t need […]
Why you should be using CloudFlare
Have you heard of CloudFlare? If not, you should definitely check it out. It’s a content delivery network (CDN), uses by millions of websites, and best of all: it has a free plan! A CDN can significantly speed up your website. Let’s say your site is hosted on a server sitting in Montreal (like mine). If […]
Configure Nagios To Use Sendmail
I’ve been setting up Nagios for a client of mine, and one of the issues I faced was configuring Nagios to use sendmail to send notifications. It was attempting to use /bin/mail or /usr/bin/mailx to send email, neither of which were present on the CentOS box. There wasn’t any information when I Google’d it, so […]
Virtualization
For the longest time, I read about virtualization but never fully realized the benefits of that approach. Recently I did, and as such my company upgraded to a virtualization server running VMWare ESXi as the hypervisor. I have to say, I love virtualization now, and have no idea how I went without. If you accidentally […]
Customizing Apache config with Plesk
Recently, I’ve had to customize some Apache configuration options on one of my servers running Plesk. I needed to modify PHP’s open_basedir parameter among other things, and it was a little tricky to figure out how to do it properly. Once I figured it out, I thought I’d share. FYI, I’m running Plesk 10.4. Plesk […]
Multiple Directories w/ PHP open_basedir
I’ve been using PHP’s open_basedir function since I first setup my server, several years ago. It’s a really useful function for securing your servers, although it isn’t perfect. For years, I’ve had problems with the temporary directory not being accessible. Of course, it was a simple fix to use php_admin_value open_basedir /var/www/vhosts/saebermedia.com php_admin_value upload_tmp_dir /var/www/vhosts/saebermedia.com/.tmp […]
LAMP Server Setup Pt. 5 – Installing MySQL
I just realized when setting up a second CentOS 5.4 server that MySQL is required for PHP MySQL support (duh) and I didn’t include it in my tutorial so here it is. As an alternative, I’ll be posting a PostgreSQL guide as well, as some users may prefer that (I’ll be using it for my […]
Courier IMAP SSL Certificates
Tonight, I logged into my email only to discover my SSL certificate had expired! So I logged into SSH to create a new one, only to find out how hard it is! So now that I’m done and it’s working all nice and proper, I’d like to share my knowledge. I’ve obtained parts of this […]