Update April 2018: I’d suggest using Let’s Encrypt for this instead. How to create and install an SSL certificate for Nginx 1.10 on Ubuntu 16. (Apache setup here.) This setup also gets you an A on the SSL Labs SSL Server Test. Part I: Create and Obtain your SSL Cert 1. Create your key and […]
Category: Web Development
Perl Hyperlink Relativizer
This was written to strip local domains from hyperlinks in text files, e.g., www.geoffstratton.com/mylink.html will become /mylink.html. #!/usr/bin/perl -cw # # Strip local domains from link urls. # Each file will be modified in place and a unique backup saved. use strict; my $DEBUG = 0; sub dbg_print { if ($DEBUG > 0) { foreach […]
jQuery Reading Progress Meter
On my Amazon reading list page I wanted to add a progress bar and ahead/behind schedule counter similar to that on Goodreads. For their reading progress meter, you enter how many books you plan to read, and then your account page shows you a progress bar indicating how many books you’ve read and how far […]
Perl XHTML Validation
Fixes some common XHTML validation errors, to make a web page pass the W3C markup validator. Does this still work? I have no idea, I never build web pages by hand anymore. #!/usr/bin/perl -cw # # Clean up a few common xhtml validation errors # # Arguments: provide any number of filenames on the command […]
Bash: Make a Web Site Index
An old Bash script that uses awk to construct an index with hyperlinks from the .html files in a web tree. Attempts to use the <title> tag to name each link. To use, change your directories in the ‘for dir’ line to the directories you want to scan, then run the script: ./myscript.sh > myfile.html. […]
Install WP-CLI
The wp-cli command-line utility allows you to manage your WordPress sites without going through the WordPress dashboard, much like Drush does for Drupal. To install Composer and wp-cli on Ubuntu 16.04: Install Composer (I’d recommend not doing this as root.) user@ubuntu# cd $HOME user@ubuntu# php -r "copy(‘https://getcomposer.org/installer’, ‘composer-setup.php’);" user@ubuntu# php -r "if (hash_file(‘SHA384’, ‘composer-setup.php’) === […]
WordPress: Optimizing Nginx and WP Super Cache
Today we’re going to compare the performance of a WordPress site before and after we install and optimize the WP Super Cache plugin. We’re running Ubuntu 16.04 Server, Nginx 1.10, PHP 7 with the Zend OPcache, MariaDB, and WordPress 4.6 with a few other plugins (Akismet, Jetpack, Yoast SEO, and Google Analytics). The system itself […]
Your First Steps in WordPress
Once I’ve set up your WordPress blog, I recommend that you take the following steps: 1) Change your password to something secure and useful. There are various random password generators that you can use around the web, but I’d recommend picking a phrase that you can remember easily. Keep in mind that it’s a bad idea […]
Installing Drush 8
Previously I discussed how to install Drush 6.x for use with Drupal 7. Here we’ll install Drush 8 for Drupal 8, specifically using Ubuntu 16.04 Server. The recommended method is to install using PHP’s Composer. First we install Composer itself: root@ubuntu:/# php -r "copy(‘https://getcomposer.org/installer’, ‘composer-setup.php’);" root@ubuntu:/# php -r "if (hash_file(‘SHA384’, ‘composer-setup.php’) === ‘e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae’) { echo […]
Ubuntu 16.04 Web Server with Nginx, MariaDB, Redis, and Drupal 8
As mentioned in my Ubuntu 16.04 and Drupal 7 article, the Ubuntu 16 LTS version has some nice upgrades, including PHP 7, MySQL 5.7, Nginx 1.10, Apache 2.4.18, and MariaDB 10.0.x. Let’s see if we can make it work with Nginx, PHP-FPM, MariaDB, and Drupal 8, using the Redis key-value store as the backend cache […]