OK, wow that was pretty easy, migrated to Cloudways with their migration tool and I was shocked at how simple this was, it ported with their plugin including the Cloudinary plugin and the various Redis servers. The big reasons for moving to Cloudways are:
- Management of the server itself. We moved from Bluehost to Digital Ocean with their WordPress the main reason was that the performance of Bluehost was low and just moving to a 1GB virtual processor was so fast. Of course, the cost was much higher. That was a good move with PHP issues and general slowness
- Of course, I’ve gone from $6/month to $22/month so there was a cost for a 1GB 1-core machine and the block storage. The big thing that happened was to get performance because the cost has been getting more data. I went from 25GB to 75GB to store all the media files I’ve been using. Also, there was a lot of work to deal with 1GB not being enough memory so I had to add a swapfile. And also installed my own Redis system and that was an adventure with lots of issues. Also, this seems to cause temporary failures. I upgrade the box to 2GB as part of seeing if I could get more stability, sof or a while I’m going to run both the Digital Ocean and the Cloudways box.
- So now the Cloudways thing has come up which is fully managed and has the Redis server. It is more expensive at $25/month for the 2GB system and 50GB, so probably makes sense to try this as managing a server and outages is a pain.
Net, net richtong.com is now the Digital Ocean site and tongfamily.com is Cloudways, will let you know how it goes. I think I’ll probably end up back at $25/month but with a 2GB machine that is hopefully more managed. So the performance of Digital Ocean Droplets with the hosting simplicity of Bluehost.
Differences: no sudo and enable application user for ssh
OK, the first thing that I didn’t realize is that even though you get a virtual CPU, they don’t give you sudo permissions (probably because its really a container), so you have to work around that with:
- WordPress on Cloudways. Enable SSH for the “application” user. There is a difference between the master user for the server and then you can also set application users. You have to enable them for ssh as sftp is normally, so this is in Cloudways > Cloudway Flexible > Application > Application Settings > SSH Access
Big issue: Upload permissions missing Uploads in wp-config.php
I have this thing set so that I have JPEGs for all my posts to make it look pretty. I use Cloudinary for the hosting, but also create copies locally as well in case Cloudinary breaks. But when I tried to upload, I got the classic permissions error, “Can’t write file, are permissions correct.”
The LLM Chatbot was no help and the Chat person wasn’t either. It looks like the default permissions are different than with a Droplet. With DigitalOcean, you log in as root, and then the files are all owned by www-data:www-data
which is the account for Apache and the group for that account.
But with Cloudways, there is a master account, but that is not a super user (because they are a layer on top of other hosters I guess. This was the same problem with Bluehost). Then there is an application user for the WordPress installation. The ownership of the files in WordPress is for that owner and the group is www-data
which should work, but then I get upload errors.
The only other option is to make it owned by the master user, but then you have to login as the master user into the application user account which seems strange. Fortunately, they do allow limited resets, so I am going to try to reset it to the application user again. in Cloudways > Cloudways Flexible > My Applications > _WordPress installation_ > Applications Settings > Reset File/Folder Permissions > Reset As
and then the funky user name.
This got pushed up to next-level support and it turns out my Digital Ocean droplet doesn’t need WP_UPLOAD set as the default is correct, but the Cloudways one does, so make sure you have that UPLOAD is required as are a few other things.
define('UPLOADS', 'wp-content/uploads');
Uninstall my Object cacher for Object Cache Pro failed
When I migrated over, I was using a custom redis object cacher, but CloudWays has their own, so they automatically disabled Redis Object Cache and enabled Object Cache Pro, but the user interface doesn’t see it, so I deleted Redis Object Cache so the Cloudways system can see it but it is still complaining. I’m thinking maybe the OPCache Manager is the problem.
Note look in application error logs and not enough PHP memory
As part of this, I got to see what is going on in the applications log in ~/logs/error.log and I see that Amazonify is throwing errors of not found and also complaints about PHP memory. Normally you edit the wp-config.php file with Max Memory, but in Cloudways case (sort of like CPanel) they give you more control, so go to Cloudways > Servers > Settings & Packages > Memory Limit and it defaults to 256MB, I set it to 512MB to see what would happen.
Note that you can ssh in to see these logs, but you can also get them in Cloudways > Cloudways Flexible > Applications > Monitoring > Logs
This reminded me on my base Digital Ocean WordPress I haven’t checked the application log and yes I found a bunch of errors so off to go fix the “old site too”
Running a backup server, have to change WordPress and Letsencrypt on Digital Ocean Droplet
So if you want a backup server, you need to access the old one and in WordPress Admin > Settings > General change the name of the server, so all the pointers work correctly.
Then you have to manually run certbot to get a new SSL certificate and I completely forgot the pretty complicated process:
- Create a new virtual host file for Apache by copying
/etc/apache2/sites-available/your_new_domain.conf
and changing the ServerName and ServerAlias (typically the www version). - Then you need to enable the site
a2ensite _your newsite.conf_
and disable the other sited2ensite _youroldsite.conf
or if you are not sure if you want to go back, if you hit enter then the certificate will work for both sites which is kind of nice. - Now run
certbot
and you should see which names you want to activate typically the bare site and the www. version. Hitting enter means the certificate works for all enabled sites.
This is so complicated, that I might just end up using a WP Encryption Plugin or Really Simple SSL as they seem to do this for me. And it looks like Cloudways has an interface that does this since they are more like a hosting environment than a bare metal droplet.
Checking for errors on WordPress with debug mode
I’ve not actually done this before, but an error log system is great and of course, there is a Plugin that helps you deal with it like Debug Log Manager which deals with the Debug option and instantly, I see the Amazonify Affiliate Tag is getting errors and which doesn’t seem to even exist anymore. This sort of explains why my Amazon Affiliate revenue has been falling so much so super useful. I’m going to try the Amazon Auto Links. This works the same activate it and then choose Auto-insert but there are zillion of these Amazon tools. I actually couldn’t get Amazon Auto Links to even work on either site. It just displays a Loading… button which is not that great.
But I should probably be using a general affiliate manager like SliceWP.
Cloudways has this activated by default, so this let me catch the problem with my Digital Ocean Droplet account. Thanks!