Compound Fiasco

Eeh, I made a mess of my server yesterday.

There was something still not quite right about how it was or wasn’t forwarding from digitaltinker.co.uk to https://digitaltinker.co.uk or something of that kidney. I decided that it was to be my geek project for the Saturday.

So I played around with my settings, and started to paint myself in to a corner.

I tried uninstalling my SSL from my websites, but something I couldn’t find somewhere was still redirecting my www to a disabled https even though my other subdomains were without SSL.  Thinking back, it might have been phpmyadmin, though I think I removed that too. So I started to peel away more layers, unfortunately with the accuracy of a chainsaw serial killer trying delicate brain surgery. By trying to remove the settings set by letsencrypt, I removed the keys for all SSL connections, including Remote Terminal SSH. When I tried opening a second terminal and got a message about no keys, I realised that as soon as I closed my current terminal, I could kiss my server goodbye forever.

Oh f…………

I had no recent back up of my WordPress site. I searched my browser’s cache and saved a copy of my ‘blog to desktop. And I logged in to Amazon to delete my server’s main HD and launch another base installation of Ubuntu and rebuilt my system.

This time, I’ve done it right! (I think).

All my WordPress pages redirect correctly; where https and www was absent, they’re added automatically.

I’ve made a change to phpmyadmin by moving it to its own subdomain so it doesn’t cohabit www with WordPress. Also, all passwords are upgraded to 16 character randomly generated.

Phpmyadmin turned out to be a pain though, because after installation it said some of its code was no longer supported and tumpty tumpty doodah, hang on, I’ll find the proper message…

Deprecation Notice in ./../php/php-gettext/streams.php#48  
Methods with the same name as their class will not be constructors in a future version of PHP; StringReader has a deprecated constructor

Backtrace  
./../php/php-gettext/gettext.inc#41: require()  
./libraries/select_lang.lib.php#477: require_once(./../php/php-gettext/gettext.inc)  
./libraries/common.inc.php#569: require(./libraries/select_lang.lib.php)  
./index.php#12: require_once(./libraries/common.inc.php)

And many others messages, all Deprecation Notices in ./../php/php-gettext/streams.php so it turns out that the Ubuntu maintained copy of phpmyadmin was a bit obsolete, so the Ubuntu volunteers had their own repository on launchpad that I had to add.

They recommended also updating to a more up-to-date version of php with another launchpad repository.  And that was when I found php 7.1 was available.  Jees, Linux is hard work!!  I recognise the importance of having back-ups of my working system so I am taking snapshots of sda1 when I make big changes, I don’t care if it costs me an extra 27p on Amazon or whatever.  Php 7.1 didn’t affect WordPress but borked NextCloud (maybe I should have put it in maintenance mode before upgrading php to 7.1*) so my snapshot saved my NextCloud install.

This has been the geekiest weekend in a while, and mostly recovering from the clusterf compound fiasco that was yesterday.  Phew.

*Update – did php7.1 again, this time with sudo -u www-data php /var/www/nextcloud/occ  maintenance:mode –on and NextCloud, in fact, everything survived the php upgrade 😄.  Then Ubuntu recommended removing php7.0 but NextCloud isn’t installed from apt repositories, so apt didn’t know NextCloud was dependent on php7.0 so when 7.0 was removed, NextCloud broke, and when 7.0 was reinstalled, it all came back!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.