Category Archives: Blogging

WordPress Permalink 404 with HTTPS

The time had come to switch this blog to HTTPS given the ease and cost ($0) of deploying certificates from LetsEncrypt. So that was easily done under Apache – create a new conf file for the SSL site in /etc/apache2/sites-available, and then update the old conf for the non-SSL site to redirect before requesting a new cert using certbot-auto -d mike.mcmurray.co.nz –apache. WP handled that just fine but only the admin pages and the main home page displayed as expected, other pages were just a 404.

So I made the .htaccess file writable by WP and updated the permalink rules from the WP admin console to have the file updated. Nope, still the same.

The rewrite rules are the issue, it’s just that they’re not being allowed to work. The new conf file for the SSL config needs to allow the web server to override the more secure defaults. So this needs to be in the SSL configuration file – note this is a sub-section, not the whole thing.

 <VirtualHost _default_:443>
     ServerAdmin admin@yoursite.com
     ServerName blog.yoursite.com
     ServerAlias blog.yoursite.com
     DocumentRoot /var/www/html/blog

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

     <Directory /var/www/html/blog/>
         Options FollowSymLinks
         AllowOverride All
         Order allow,deny
         Allow from all
     </Directory>

     # SSL Engine Switch:
     # Enable/Disable SSL for this virtual host.
     SSLEngine on
     ...

</VirtualHost>

 

Running Your Own Web Server

After nudging the storage allowance on our web host a few times in the last month, I’ve started setting up the same sites on Digital Ocean. Partly to get the 20GB of SSD storage that resolves the current constraint but also to have a play with managing it all myself and working through the automated provisioning experience.

After a day of configuration and following the odd tutorial (admittedly Digital Ocean have some very good content in their help system for how to set up a myriad of different apps and OS’s) I can say it really is much easier just going for the basic “pay for simple access to a shared web server” option if you can. Even just WordPress is a bit of a pain in the arse to tweak for the proper security permissions while letting you do uploads and automatic plugin installs. In my case I need to have the LAMP stack, or at least the file system and web server accessible, but if you don’t, take a minute to think of why you can’t just use wordpress.com.

Our old host also had email set-up as part of the service with unlimited mail accounts, etc. Again with the new option and managing it all myself, I’m not overly looking forward to the fiddling to get Postfix, etc working properly. It’d be great if Google Apps had a much lower price for their per user mailbox hosting option.

Anyway, so far, so good as this blog is the first of the old content to move across to Digital Ocean.

Running WordPress & PHP Behind ISA Proxy

Some things work well on their own but when mixed make your life hard. Things like Linux and PHP work very well. Microsoft ISA proxy also does a good job in a corporate MS environment. But making the two work together in a controlled environment can be an exercise in frustration.

In this post I’ll pass on the methods I found to get PHP and your Linux boxes talking out through a corporate ISA proxy server. You can then bring in RSS feeds, updates and other things in WordPress and use apt-get to update Ubuntu. Continue reading Running WordPress & PHP Behind ISA Proxy

Using a WordPress Page for your Main Site Content

Official WordPress logoI thought I’d make more use of WordPress on wekadesign.co.nz since it’s very powerful and apparently was recently voted top PHP based CMS ahead of Joomla and many other top-notch products. It’s ease-of-use and interface are all excellent and the massive user base and huge number of plugins make it very attractive for almost any web publishing.

After moving the small amount of static WekaDesign content into Pages, I copied a couple of files (index.php and .htaccess) from my WordPress folder (./blog) into the site root, changed the settings in WordPress (Settings»General»Blog Address) and viola, anyone going to www.wekadesign.co.nz, now hits WordPress. Good. Step one done.

Now to change the default landing page to be a static Page rather than the blog. Just as easy, visit Settings»Reading in WordPress and change the Front Page Displays option to be your Page. Excellent, now everyone lands at the the WordPress version of my static content. But how do you now send people to your old default blog page? You can use http://www.yoursite.co.nz/2009/ to target certain groups of content by date or category if you have Permalinks setup, but I couldn’t find the way that WP builds the default blog page.

It’s not obvious, but that 2nd option in Settings»Reading holds the key. The Posts Page option is asking you to select an existing WP Page that will act as a placeholder and be that default blog page. So, if you haven’t already, create a new Page with a suitable name. The name is important as that’s the URL everyone will use and see for your blog. So if you call the Page “peanut butter”, your blog page will now be http://www.yoursite.co.nz/peanut-butter/. It doesn’t matter what the content of the Page holds as no one will ever see it.

There is a slight “gotcha” with the Page names, in that any name being reused will work, but WP will append it with an incrementing number e.g. “peanut-butter-2”.

To finish off, just create a nice link on your site somewhere like the Sidebar to your default blog page.

Extending Themes

It seems that a lot of newer WordPress themes are now focussing on more than just looks and layout and completely changing the feel of the product. No longer do I browse through the WP Themes and think they all look the same. Works like Kiwi and Hemingway will make blog readers work to find what powers the site (or look to the footer, if it’s still there).

Whatever is around the corner for WP 2.5 and even 3.0 should be amazing.