Assalamualaikum,
Photo by Campaign Creators on Unsplash |
After using Google Cloud free credit for 3 months, its time to migrate our Wordpress website!
I have launched https://4nutz.tk an e-commerce website that sells our own home-brand Natural Nut Butters!
To save money, development was done on Google Cloud Compute Engine, after 3 months running, putting all the contents there! Tracking our own sales, finally its time to migrate.
At the beginning, i don't want to put so much effort in running it up, used Bitnami image to run the Wordpress. Everything was easy and breezy!
But aware of the time limit, yes we need to migrate eventually. Because the Google Cloud pricing is too expensive for me! $20 per month? kidding me.
Running the website on Digital Ocean is much cheaper $5 per month! Register using my referral link ya! you will get free $100 credit for 2 months! gets your hands dirty and start running you own web app / projects~
Ive been a fan of DO since the beginning, the price offer is very attractive, documentation support are extensive, dashboard is stunning, no down time experienced so far.
Now its time to take a step more, by dockerizing the Wordpress and its dependents stacks. As migration is really a pain to setup all the environments! Having this configurations set up life will be easier later if I again want to change platform, or move around or replicate or whatever!
for the dockerizing steps i followed this full guide.
Issue encountered:
1. Nginx 404 Permission issue on accessing Wordpress Docker container web content:
When try to accessing the the Wordpress site, the Nginx running in the docker container unable to access the Wordpress container contents. thus i tried to map the Wordpress content to host machine path too and update the user id for www-data and update the permission for the content path!. And it works! thanks to this article!
Quoted the article as below :
In the WordPress container, the directory
/var/www/html
is owned by the userwww-data
. The uid of this user in the container is82
. It is not the same in Ubuntu — the host machine. The below commands delete any existing user with the user namewww-data
and creates a new user with uid82
.
$ sudo userdel www-data
$ sudo useradd -u 82 www-data
Now, set the owner of the directory
/data/html
in the host machine.
$ sudo mkdir -p /data/html
$ sudo chown -R www-data:www-data /data/html
Comments
Post a Comment