[Dev Cloud Essentials] How to never worry about your WordPress hosting?

This entry is part 1 of 2 in the series Dev Cloud Essentials
Reading Time: 9 minutes

 

More and more people from IT community  start to show their presence in the internet. Writing about stuff that interests them – technical or not. Probably most of you already have a blog (or planning to start one). Just like me. All those people faced the same problem – which engine use for my blog? Just like me.

Of course, it would be highly inefficient to just start to write custom blog engine, just to have my own blog. We all had to choose something already implemented and verified.

That’s where WordPress enters the scene. It’s a working piece of software, verified, easy and customizable. Probably those are the reasons why 29% of the internet run on WordPress. As any tool – it’s not perfect. It solves my problem, though.

Okay, so if WordPress is the thing, where should I host it? What seems to be the most default answer is:

Source: memegenerator.com

That approach very quickly turns against us. Let me show you some problems with traditional hosting providers. Don’t you worry – I was there and I found the way out. Let me guide you through it.

I went through all the phases

When I was just starting out in IT I used a lot of shared hosting providers. I was able to find out about some problems really quickly. So I switched from one to another – looking for a perfect provider. Spoiler alert: I found none. Later I went through VPS phase – I have tried a few of them. Finally a few years ago I set up my own private, physical server. That was the beginning of me getting to know how too much control can affect ability to have a free time and a sane mind.

Let me go through some problems I had looking for the best infrastructure for my applications.

 

Hosting provider puts a limit on your availability

some always will do it cheaper
Source: itxdesign-itxdesign.netdna-ssl.com/

Not everyone knows that plenty of hosting providers limits data/bandwidth of your services. Especially for smaller plans.  Free hosting plans included obviously.

Therefore, if a website weights 100 kB and your monthly outbound transfer limit is 500 MB – users can open the website up to 5 000 times.

A lot?

I don’t think so – typical wordpress website weights more than 100 kB and each page view eats up your transfer. If one user open 10 subpages of the website, he uses 10 times weight of your website.

See the issue?

Furthermore, free plans also often interfere directly in your website content with ads and other spammy stuff. I bet many of you already have those problems and feel very sad. Not to mention a lot of weird policies like cutting out request/response headers.

Well, you know what they say – there are no free lunches.

Hosting provider puts a limit on your tools

The thing I hated the most about shared hosting is the feeling of helplessness.

When my site was down or I needed one configuration change – I had to use contact form on the  hosting provider website. Then wait.

Tech support!
Source: imgur.com

Waiting time varied between providers. Once it reached a few days for a single, small change. A couple of times I was denied requested changes after long request processing.

Most shared hosting plans doesn’t include any more advanced managing tools for an obvious reason – it’s a shared hosting. All those websites are on one box.  You won’t get any more control that a very limited cPanel or other shared hosting tool.

If you’re a client of one of those providers, you can recognize this case. I feel you.

Hosting provider puts a limit on your speed and responsiveness

Loading animation
Source: img.memecdn.com

Okay, we already concluded that shared hosting as the name suggests uses one box for many websites. That obviously means – all those websites share common resources like CPU, memory and disks.

To avoid a situation when one website is eating up all the resources and the rest isn’t working, hosting providers has to put a limit on resources per each hosting user.

In free/cheap plans don’t count on much computing power.

Nearly half of the users expect the website to load in less than 2 seconds. When a website doesn’t load in 3 seconds, they tend to leave the website and never come back. [1]

Sounds serious.

Also if your target audience is from another country – you shouldn’t use any hosting providers from your country if you want your website to open quickly enough. Latency will only add up to a long loading time.

Hosting provider wants your money upfront

Pay me
Source: media1.tenor.com

I know, there are some providers that offer like 14 days trail period. It’s not common though. And not enough, in my opinion.

Many of the providers I worked with tempted me with low price per month, but at a checkout it turned out that I have to pay for a whole year upfront. Once you make that decision, you’re pretty much stuck with that provider for a year or you will loose money.

I can tell you a story – I still use one hosting provider with some of my old web applications being hosted there.

The only reason I keep it there is that migration of this stuff is a low priority.  I always postpone it after other important tasks. Suddenly it’s the end of another year and I have to pay or I will lose the data.

Because I’m not ready to migrate (again) I just pay for another year and promise myself I will take care of it soon to not pay for another year. That’s how you get stuck with one shitty provider.

Hosting provider often lacks security

It’s not an easy task to verify credibility of the provider. Most of them are small businesses with a lot of security loopholes due to a lack of proper security team. Or resources.

hackerman
Source: media1.tenor.com

I know. What’s the worst that could happen – I would loose my blog if I used shared hosting.  Right? Or my blog could fill up with the monstrous amount of viagra ads.

But still, it’s my blog, it’s my hobby, it’s my brand – I don’t want no wannabe mr. robot to mess with my stuff.

Right?

On VPS/private server you don’t have those limits – you have responsibilities

Through the years I ended up with my own server, own security, full control, hardware is the only limit.

Sounds good?

And how does getting up in the middle of the night to resuscitate the server sound? How does it sound to be the ultimate and the only one sysadmin? If you don’t know something about technicalities there’s no one that could assist. You’re on your own.

Sysadmin
Source: media.giphy.com

Not too bad, unless you start having other responsibilities than watching over your baby-server 24/7.

Can I have no limits and no responsibility, please?

What if I could combine positives of hosting and private server? I know there are some positives! What if I could have:

  • A nice, simple panel to control all my websites and in case of more advanced scenarios use some cli or other tool like this?
  • A possibility to play around for free with the environment first for a longer period to see if it fits my needs?
  • Usage payment model – not the fixed model with one year  commitment?
  • Ability to choose from where (on the globe) the website should be served?
  • Easy WordPress setup, so I could focus on delivering content as soon as possible?
  • Decent security and trust level?

 

I don’t need a product – I need a service

I own two wordpress websites that I personally use on a daily basis. One is obviously this blog you’re reading right now. Another one is one of the biggest thematic portals in Poland (that I rewrite to be cloud native btw).

Until now both of those websites have been kept on my private server in my company. Two websites with completely different needs, still kept on one not scalable box.

 

I always looked at web hosting business as delivering infrastructure for my online stuff. It always mattered what machine is hosting my website. Does it have right software installed and configured there. Or years later – how strong processor should I buy for my server.

Now it seems like I never needed to have a great server processor, huge amount of RAM or a big and quick SSD drive.

I need my website to be on the internet! Always! That’s it.

Here’s simple equation representing my needs.

Infrastrucutre + software = service

Here’s what current market offers.

service = cloud

Going through the curse of too much control and too few resources to run my own server I have decided to move to the environment I’ve professionally explored for some time now. And that is the Microsoft public cloud solution – Azure.

Now It’s obvious to me that I wasn’t looking for the best hosting provider, VPS or the best server gear. What I really was looking for back in the days was the cloud.

So save yourself a couple of years of looking – go right to the solution of the problem.

WordPress as a service

Azure provides something pretty close to WordPress as a Service experience. The biggest benefits include:

  • Azure portal, Azure powershell and Azure resource manager are my very convenient interfaces to control all my resources and services in the cloud – whether I want to click my way through configuration or prefer to automate it
  • Microsoft offers many options to test and play with Azure for free and asses if it fits to my needs. Visual Studio Dev Essentials provides $200 to play around at the moment. And Azure has plenty of licence models – this week I had a meeting with Microsoft to work out the perfect one for my needs. And that’s what I’m talking about!
  • WordPress setup is super easy and I can trust Microsoft that my website is safe with them

After years with my own server I decided to give myself a break and finally move into another level. I decided to migrate my websites to Azure and see what happens. As a matter of fact if anything goes wrong I still have my server.

Actual steps for wordpress migration

Here’s what I did to migrate existing wordpress website to Azure.

Prerequisites: subscription (for example Visual Studio Dev Essentials or free trial)

Create Azure Web App

  1. First, go to the portal.azure.com and on the left sidebar menu click on App Services, then click (+) Add button.Add App Service
  2. Next, click on WordPress on Linux web app.web apps
  3. Fill the details of your website. Have a look at App Service plan – you can see the variety of the service plans available for this type of service. Choose whichever you feel like – you can change it later. After clicking complete button, It will start processing your request. Wait a few minutes and it should be ready. WordPress ready to go!Create new web app
  4. As a result, Azure created new web app that will be a container for your wordpress and Azure MySQL database.

Migrate your database

  1. Now you can go to your existing database and export all structure with data. (For example using MySQL workbench or mysql cli)
  2. Import your db to the newly created one.
  3. Go to your newly created web app panel and click on App Settings section.
  4. Add one additional setting: DATABASE_PREFIX and set it to the prefix you used in the previous wordpress instalation.

Migrate your wordpress files

  1. Now go to the Deployment Credentials section. And set a username and password for your FTP access.Deployment Credentials
  2. Cool, now you can connect via FTP to your previous server, download all the plugins, themes, uploads and wp-config.php file. Then send it to the Azure wordpress using newly created deployment credentials. Connection info can be found in the main overview of the application.FTP backup
  3. Edit wp-config.php you just sent to the Azure wordpress and replace database connection stuff with your app settings values (you can use getenv(‘NAME_OF_APP_SETTING_KEY’))App settings in wp-config
  4. Ready! Open your website and check if everything is alright. Your wordpress is set to use your previous URL so you can get some CORS errors in console. This will pass once you either change all references to the previous URL in the database/files or add your custom domain to the Azure web app.

Use your own domain for Azure Web App

  1. In order to add your custom domain you will need access to the DNS settings of your domain. Go to the Custom domains section in web app panel. After entering your domain name it will tell you what record you should add to your domain DNS. After adding the DNS record, click validate again and if all is green click add hostname.Azure custom domain
  2. And that’s it. Your wordpress website is now on Azure. Fully functional! Play around.

Notes

If some of your subpages doesn’t work after migration – you might be required to go to the Permalinks settings in wordpress admin panel and click save without changing anything (or simply moving .htaccess over from your previous server).

All this process is reversable, so if you are afraid you might want to go back, no worries – simply reverse DNS record changes from step 1 of migrating your domain. You’ll be just fine!

What benefits I got from migration to Azure?

All the limits that hosting providers puts on us or inflexibility of hosting providers really goes away when  you buy your own server rig and start hosting for yourself.

But private server doesn’t solve everything. The most important part of hosting your applications on your own server is architecting the security layer. Not just in the app itself, in the OS, but also in the network layout you create for it. You have to be good at it. And that’s not even remotely enough, because the internet is so big. There is always someone better than you.

What’s security is all about is not delivering the most secure system on the planet. it’s delivering the most discouraging system of protection there is. When protecting a big, luxury house it’s better to have 100 normal security guys with a decent gear than one guy that is the best in kick boxing in the world.

This is the biggest benefit of going through the migration. Forget about limits you won’t ever see, forget about sleepless nights when database crashed on your server for some reason. It feels good to be free of that crap too with Azure. But the biggest one is to have countless amount of security guys with a great gear to protect you – instead of being your own bodyguard.

Wanna give it a try?

What’s your next step?

If you already have wordpress on some shared hosting or a server don’t worry!  As you can see, all can still be fixed!

Be smart
Source: dailymail.co.uk

You can go and get your Visual Studio Dev Essentials subscription from here. As soon as you get access to Azure – just go through the steps I gave you in this post. Test around – see if it works correctly or is that pleasant to use for you.

The most important: wait a couple of weeks and see how much money it eats up. If you don’t like the outcome, you can always go back to how the things were.

Fun fact: At the beginning of writing this post my blog was on my private server. Now, when I’m writing these words, it’s already in the cloud. This blog post is the living proof of how it works.

Reference links:

[1] How Loading Time Affects Your Bottom Line

 

Series Navigation[Dev Cloud Essentials] Create affordable brand monitoring process in minutes >>

One Reply to “[Dev Cloud Essentials] How to never worry about your WordPress hosting?”

Leave a Reply

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