Apache/WordPress performance

Google has added a parameter to their ranking algorithm that corresponds to how well your site performs. They created a tool called Page Speed Insights (https://developers.google.com/speed/pagespeed/insights/) that checks for a number of things: Initial load, time to first painting, time to full painting, time to interactive, etc.

It provides quite a lot of help for issues it discovers.

Things that it found with mine:

  1. Images were using legacy file types and were larger than if they were using webp. They suggested a WordPress plugin to convert existing images and serve the webp images in place of the current images. The plugin modifies the .htaccess file so that any requests are redirected to the smaller images.

    The plugin I used is called: WebP Converter for Media. Because of my proxy arragement, I had to do some additional manual configuration to get it to work. As my situation is unique, I won’t go into detail.

  2. Responses weren’t compressed and static files didn’t have a cache policy. This was an apache change the rquired loading a couple of modules: deflate, filter, cache and disk_cache.

Edit the httpd.conf file and add:

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript

between the <Directory> tags

After the closing Directory tag add:

CacheEnable disk /

CacheRoot “/var/cache/apache2/”

CacheDirLevels 1

CacheDirLength 2

CacheDefaultExpire 3600

CacheDisable /wp-admin

 

Add the following to server-default.conf:

<IfModule mod_expires.c>

    ExpiresActive On

    ExpiresDefault “access plus 7 days”

</IfModule>

 

To add the LoadModule lines to the config files, run the following commands:

a2enmod -l (list the current modules)

Look for filter, deflate, cache and cache_disk in the list.

Type the following, omitting any that are in the list above:

a2enmod filter

a2enmod deflate

a2enmod cache

a2enmod cache_disk

Then restart the daemon

systemctl restart httpd

 

It should display no errors.

After implementing these changes, I re-ran page insights and there was a significant score improvement. There is another metric called GTmetrix (https://gtmetrix.com/) that does a simliar job.

Linux migration

I’m documenting this here mostly for my own purposes. This is the process I followed (eventually) to replace my aging Linux box. First with a 4TB hard drive then adding an SSD (while retaining the HD).

I won’t go into detail about the system hardware. It’s not state of the art, it’s not even recent. It’s just a huge step up from the previous box. It’s also smaller and quieter.

The first step was to clone my existing hard drive to the new 4TB drive. This was a relatively simple process as I wasn’t planning to use the old drive on the new system. So I just installed the new drive in the old system and used dd to copy one drive to the other.

Something like: dd if=/dev/sda of=/dev/sdb bs=100M status=progress

Many hours later, I had a clone of the original drive.

Continue reading “Linux migration”

Update Philosophies

I was driving yesterday and started ruminating on some of the issues I’ve had with my high tech EV. It’s a 2017 Chevy Bolt.

I probably wouldn’t be considered an early adopter since Tesla had several models out, the Nissan Leaf had been around for a couple of years and even Chevy had the Spark.

The Tesla Model 3 was still a couple of years away and that was one of the prime reasons I opted for the Bolt. The Bolt had the longest range of any EV at the time and driving it took me back to my 3 series BMW: Great handling, quick acceleration and a blast to drive.

I could go on at length about all of the issues with chargers (both fast and slow) and range, but I really wanted to talk about how the philosophies of software updates differ between the auto industry and the computer industry.

I’m going to limit my discussion to Chevy because I don’t own a Nissan Leaf, BMW 3i or Kia Niro and haven’t talked to anyone who does to find out more about their approaches.
Continue reading “Update Philosophies”

Changing Dynamic DNS providers

Years ago, partly out of curiosity, I started self-hosting web sites on a server located at my house. As I was doing consulting, this allowed me to set up client visible sites for testing and demonstration.

This presented a bit of a problem as I wasn’t willing to foot the cost of a fixed IP address and a “business” account. So, I had to find a way to make my DHCP assigned IP address public. Dyndns.com to the rescue. At the time, they were about the only option available. And for a basic set up, free.

Back then, I was running on Windows Server 2003 (32 bit) and the machine was set up as a web server, a file server and our internet proxy.

This configuration served well enough for several years, but several things happened to change that. The hardware started to become unstable, Server 2003 was sunsetted and new .NET versions no longer supported it, and I started to add video and other technologies to my development portfolio.
Continue reading “Changing Dynamic DNS providers”

Coffee and laptops

About 3 weeks ago, I tried to share a cup of coffee with my laptop. It wasn’t happy.

We have a bunch of coffee mugs from a set of dishes made by Pfaltzgraff. They are probably close to 10 years old now and the handles keep breaking off. Literally, the handle detaches from the mug. The set started with 8 mugs and I’ve superglued 4 of them back on now.

So, 3 weeks ago, I sat down at my desk with a cup of coffee, opened up my laptop, lifted the mug to take a drink and about 6 inches above the desk the handle detached and the mug dropped back to the desk. I was poised with only the handle in my hand as coffee flooded the keyboard (Murphy’s law).
Continue reading “Coffee and laptops”