apache

Notes about setting up HTTPS on websites using LetEncrypt and certbot

As a note to self, I added SSL/TLS certificates to a couple of websites using LetEncrypt. Here are a couple of notes about the process:

Getting the Drupal 8 Metatag module to show a canonical HTTPS URL alvin October 13, 2018 - 5:29pm

As a brief note, this website currently uses Drupal 8 and I was having a problem where the Metatag module was showing a canonical tag that began with http rather than https, which this website uses. The rest of this article briefly shows how I was able to fix this problem.

Apache 301 redirects on GoDaddy web hosting

I have a shared web hosting account on GoDaddy, and wanted to do a 301 redirect with an Apache .htaccess file. For some unknown reason GoDaddy’s web interface wasn’t working for this, so I thought I’d fix the problem manually.

In short, this did NOT work:

Redirect 301 /the-old-uri  http://alvinalexander.com/the-new-uri
How to access HTTP response headers after making an HTTP request with Apache HttpClient alvin June 20, 2015 - 5:41pm

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is a very short recipe, Recipe 15.12, “How to access HTTP response headers after making an HTTP request with Apache HttpClient.”

Problem

You need to access the HTTP response headers after making an HTTP request in your Scala code.

Solution

Use the Apache HttpClient library, and get the headers from the HttpResponse object after making a request:

Drupal mobile website/multisite installation and robots.txt alvin March 2, 2015 - 8:16pm

As I’m working on getting a mobile version of this site working, I ran into a problem with having a robots.txt file on a Drupal multisite installation. The root of the problem is that you need to have a robots.txt file like this on your mobile site:

User-agent: *
Disallow: /

That’s to keep the search engines from scanning and storing that content, which will be a duplicate of your main website.

My Scala Apache access log parser library

Last week I wrote an Apache access log parser library in Scala to help me analyze my Apache HTTP access log file records using Apache Spark. The source code for that project is hosted here on Github. You can use this library to parse Apache access log “combined” records using Scala, Java, and other JVM-based programming languages.

Generating a list of URLs from Apache access log files, sorted by hit count, using Apache Spark (and Scala) alvin March 11, 2014 - 11:41am

I don’t want to make my original Parsing Apache access log records with Spark and Scala article any longer, so I’m putting some new, better code here.

Assuming that you read that article, I’ll jump right in and say that I use this code to load my data into the Spark REPL:

Analyzing Apache access logs with Spark and Scala (a tutorial) alvin March 9, 2014 - 9:21pm

I want to analyze some Apache access log files for this website, and since those log files contain hundreds of millions (billions?) of lines, I thought I’d roll up my sleeves and dig into Apache Spark to see how it works, and how well it works. I used Hadoop several years ago, and as a quick summary, I found the transition to be easy. Here are my notes.