Just a real quick post. So I did something you really shouldn’t, especially to a work system, so thank god it was only my personal blog server.
I decided do an OS upgrade just before holidays!
So as a quick brain dump I upgraded from 14.04 to 16.04 LTS and the web server wouldn’t work!
Initially this was due to a read only file system. I finally tracked this down to the fact the root file system’s UUID had changed and didn’t match the entry in the /etc/fstab.
The inbuilt Digial Ocean recovery kernel didn’t include any text editors so I couldn’t use that to update the fstab, but the fsck checked out, so that was good.
Two solutions can be used that’s to the following post here:
- Speak to Digial Ocean support and get them to attach a special recovery image which can be used to do a number of things including editing the fstab (support response was great, very quick attaching and removing).
- Once the system has booted run blkid and then use the new UUDI to remount the filesystem as read/write, which also worked:
blkid mount -rw -o remount UUID=<new UUID> / vi /etc/fstab reboot
This still didn’t fix the webserver issue. Maybe I should have noticed all the packages it removed but 16.04 doesn’t come with php5 but 7 so initially when trying to start apache I would see the error:
Invalid command 'php_flag', perhaps misspelled or defined by a module not included in the server configuration
To get round this I needed (maybe more that minimum):
apt-get install php apt-get install wordpress apt-get install libapache2-mod-php7.0 php7.0-curl
Apache now started and the following extra packages were installed:
However Mysql wasn’t running so ran this:
apt-get install mysql-server
Which installed the following extra packages:
libcgi-fast-perl libcgi-pm-perl libencode-locale-perl libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libtimedate-perl liburi-perl mysql-server mysql-server-5.7 mysql-server-core-5.7
After it installed I had to run the following SQL commands as suggested on my WordPress database:
mysql connect <database name>; REPAIR TABLE `wp_comments`; REPAIR TABLE `wp_links`; REPAIR TABLE `
wp_posts`;ALTER TABLE `wp_statistics_useronline` FORCE; ALTER TABLE `wp_statistics_visit` FORCE; REPAIR TABLE `wp_users`; quit
Now it all works!!!