Backup Multiple Laravel Sites

If you’re like me and use Laravel Forge to host multiple websites on a single Digital Ocean server, then you may have run into the issue where you need to backup all the sites on your server. You could run Spatie Laravel Backup package on each site but a better solution would be to just deploy a single backup application to the server so you can backup multiple sites. This means you can backup multiple types of sites including WordPress.

I came across a great article from Tim MacDonald. Check it out here

Another option is to use SnapShooter for all your server backusp including MySql. SnapShooter is a simple tool to enable more frequent backups of major server providers, while also providing support for offsite backups your choose of S3 provider. Monitor your Laravel backups in real time, and easily discover when something goes wrong. Restoring a backup in a hurry can be stressful, we offer a one click restore process. SnapShooter Connects to your server and imports the database, just sit back and wait.

Let me know if you have any questions.

Text Replacement iOS

Wanted to share a quick tip that I use every day on my iPhone. If there is a sentence or phrase you type often, you should turn this into a text replacement. For example, I use @@ which is replaced with my email address. This is useful for registering or logging into websites or apps. You can also have other common phrases for responding to emails or text. I’ve been using this for years and wanted to share. Hope it saves you a few keystrokes!

The Text Replacement function is found under Settings > General > Keyboard > Text Replacement.

Leave a comment below of shortcuts you use. Thanks!

Nginx Split Test A/B

Have you ever wanted to split test multiple pages on your website? You could use a WordPress plugin called Simple Page Tester but you are limited to testing two urls at a time. After some searching, I came across a simple way to split test multiple URLs using Nginx split client module.

First, add this section to the top of your Nginx Config:

split_clients "${remote_addr}AAA" $destination {
 20% https://example.com/page-1/;
 30% https://example.com/page-2/;
 40% https://example.com/page-3/;
 10% https://example.com/page-4/;
}

Next, add a rewrite rule to your server section:

server {
 rewrite ^/rewrite-url-goes-here/$ $destination redirect;
}

Finally, restart Nginx to see the changes:

sudo service nginx restart

Hope this is helpful. It can also be used to redirect Nginx to random URLs. Let me know if you have any questions below.

Side Project Tech Stack

I want to start this post by saying this is my preference on the frameworks and technologies that I use for most of my apps. Depending on your experience and goals you should experiment to see what works for you. For example, here’s a tweet from Pieter Levels that his site is running on a single PHP file and is making over $2,000 a day. He makes a good point that if your goal is to make money, the frameworks and libraries can get in the way of you making progress. It’s impressive what he is able to accomplish by keeping things simple.

Read More