How to optimize WordPress with Ubuntu VPS

Ubuntu Virtual Private Server optimized for WordPress

Category: EC2

EC2

  • How to auto update and upgrade Ubuntu server once a day with unattended upgrades

    Ubuntu 18.04 Manual

    Do you feel it’s a hassle with all the new packages that needs updating?
    Typing:

    sudo apt-get dist-upgrade
    

    Almost every week you log in to Ubuntu. Upgrades and updates should be automated. It’s done very easy once and for all. Just continue reading.

    The unattended-upgrades package is the best practice for automating the updating of Ubuntu. For headless machines like the WordPress JeOS VPS server, this is a major security gain and a great timesaver.

    You can set up unattended-upgrades by typing this in a terminal:

    sudo apt-get install unattended-upgrades

    Then configure unattended upgrades using this command:

    sudo dpkg-reconfigure unattended-upgrades

    That’s all. Ubuntu will now update itself every day.

    If unattended upgrades fail, then configure manually

    If not working as needed. Open the configuration files and customize to fit your needs.

    Documentation on how to customize the update and upgrade are available in the Ubuntu documentation.

    You can not use this tool to upgrade from Ubuntu 14 to Ubuntu 16. It will only upgrade and update packages.

    First, edit the config file:

    sudo nano /etc/apt/apt.conf.d/50unattended-upgrades

    Change the values to look like this:

    // Automatically upgrade packages from these (origin:archive) pairs
    Unattended-Upgrade::Allowed-Origins {
            "${distro_id}:${distro_codename}-security";
            "${distro_id}:${distro_codename}-updates";
            "${distro_id}:${distro_codename}-proposed";
            "${distro_id}:${distro_codename}-backports";
    };
    
    // List of packages to not update (regexp are supported)
    // Unattended-Upgrade::Package-Blacklist {
    //      "libc6-i686";
    // };
    

    The second file to edit is this one:

    sudo nano /etc/apt/apt.conf.d/10periodic

    Change it to look like this:

    ::Periodic::Update-Package-Lists "1";
    APT::Periodic::Download-Upgradeable-Packages "1";
    APT::Periodic::AutocleanInterval "7";
    APT::Periodic::Unattended-Upgrade "1";
    
    

    Automatic unattended updates for Ubuntu 20.04 LTS

    Test if it already installed:

    sudo unattended-upgrades --dry-run

    Run the upgrade:

    sudo apt update && sudo apt upgrade

    sudo nano /etc/apt/apt.conf.d/50unattended-upgrades

    Sending e-mail:

    sudo apt install bsd-mailx

    sudo apt install apt-listchanges

    sudo nano /etc/apt/listchanges.conf

    Change to:

    email_address=t@tbt.biz

    Postfix log

    sudo nano /var/log/mail.log

    Remove log

    sudo rm /var/log/mail.log

    Restart Postfix

    sudo systemctl restart postfix

    Flush e-mail queue

    sudo postqueue -f

    Sources

    Set up automatic unattended updates for Ubuntu 20.04

    Set Up Automatic Security Update (Unattended Upgrades) on Ubuntu

    Set up automatic unattended updates for packages from ondrej

    Using Unattended-Upgrades on Debian and Ubuntu

    "LP-PPA-ondrej-php:${distro_codename}";

  • How-to write. Tips and notes.

    The headline should be between 6 and 8 words

    Text should be between 300 and 700 words pr page.

    How-to articles are always a winner

  • Howto install WP-CLI Ubuntu 16 and later update

    Howto install WP-CLI Ubuntu 16. This is a easy and straight forward process. Takes just a few minutes.

    Check for any news on the WP-cli homepage

    Issue the following commands:

    cd /tmp
    wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

    The file wp-cli.phar needs to be executable.

    chmod +x wp-cli.phar

    Set permission to copy WP-CLI to /usr/local/bin/

    Important: Do not use “sudo” when moving WP-CLI to /usr/local/bin/

    sudo chown -R ubuntu /usr/local/bin/

    And then

    sudo chgrp -R ubuntu /usr/local/bin/

     

    Move wp-cli.phar to the bin directory.
    Then rename wp-cli.phar to “wp”.
    This makes it easier to use the app:

    mv wp-cli.phar /usr/local/bin/wp

    To test that everything works as it should issue the command:

    wp --info

    To update WP-CLI to newest version

    As Ubuntu user run the command:

    wp cli update
  • Ubuntu WordPress command-line tools gives you speed, power, flexibility and beauty

    Ubuntu wordpress command-line interface. Beauty of command-line. Flexibility of command-line. Speed of command-line. Power of command-line. Configuring, administering, correcting errors, upgrading and everything else should be done by the command-line from your mobile, tablet or PC. Command-line saves you time and money.

    The command-line interface or command language interpreter – CLI – is also known under the name command-line user interface, console user interface and character user interface – CUI -. This means no graphic. Just characters on a screen. The command-line provides you with a concise and powerful tool to work with Ubuntu and WordPress. No matter how slow your connection is the command line is always lightning fast.

    Ubuntu WordPress command-line tools gives you speed and power

    Some of the advantages of managing Ubuntu and WordPress by the command-line:

    • Saves you time and money.
    • Requires very little  bandwidth.
    • Is almost always lightning fast.
    • Easier to automate through scripting.
    • Requires fewer resources.
    • Concise and powerful.
    • Expert friendly.
    • Gives you a good and beautiful feeling.

    SSH client

    An SSH client is essential for managing the JeOS WordPress VPS server. Pretty much everything related to Ubuntu is done with the SSH client. In TBT we have been using VSSH for many years and made this our preferred SSH client.  WP-CLI is in most cases also running in the SSH client windows.

     

    Read more about the VSSH client for iPhone

     

    Read more about the VSSH client for iPhone

     

    Read more about the VSSH client for Windows

     

    Read more about the VSSH client for Android

     

    WP-CLI

    WP-CLI is the free tool for managing WordPress without a web browser. WP-CLI has numerous add ons.

    More about WP-CLI

    Gravity Forms WP-CLI plugin

    Gravity forms is one of the best forms plugins. Gravity forms has a large number of plugins.

    Manage Gravity form using command-line

    WordShell

    You can upgrade 100 or 1.000 WordPress sites by typing a single command in WordShell. Batch manage sites and save heaps of time. WordShell is not based on PHP and does not require WordPress to work. This provides many opertunites that’s not available with WP-CLI

    Compare WordShell to WP-cli

    Read more about WordShell 

    No thanks, I prefer cPanel and other GUI’s

    If you decide that command-line is not your way thats OK to. cPanel is rated one of the best GUI’s to administer Linux and WordPress.

    [themedy_button url=”https://www.wpjeos.no/out/012-webhosting-uk-com-vps” icon=”wordpress” font_awesome_att=”” label=”Read more about WordPress VPS with cPanel control panel” colour=”blue” colour_custom=”” size=”large” edge=”rounded” target=”_self”]

     

    [themedy_button url=”https://www.wpjeos.no/out/015-one-com” icon=”wordpress” font_awesome_att=”” label=”Read more about WordPress hosting with One.com” colour=”blue” colour_custom=”” size=”large” edge=”rounded” target=”_self”]

     

    [themedy_button url=”https://www.wpjeos.no/out/012-webhosting-uk-com-webhosting” icon=”wordpress” font_awesome_att=”” label=”Read more about WordPress hosting with WebHosting UK” colour=”blue” colour_custom=”” size=”large” edge=”rounded” target=”_self”]

     
    [themedy_button url=”https://www.wpjeos.no/out/016-proisp-no” icon=”wordpress” font_awesome_att=”” label=”Read more about WordPress hosting with Pro ISP” colour=”blue” colour_custom=”” size=”large” edge=”rounded” target=”_self”]

     

     

     

     

     

  • How-to Ubuntu 16 Amazon Web Services AWS EC2 RDS ElastiCache WordPress

    DIY: How-to set up Ubuntu 16 AWS EC2 with external RDS MySQL database and external ElastiCache memcached server. The title is quite cryptic on purpose to tell you that this is somewhat different from the standard WordPress VPS where everything depends on a single Linux server.

    This combination gives you a fast, stable and affordable VPS server based on the concept of JeOS. You will have a budget friendly VPS server that will scale to what you need. Only limited of your needs and your budget. It contains only what WordPress needs to run and nothing else. JeOS is in this context a paradigm for optimizing your operating system to fit the needs of WordPress.

    In this DIY tutorial you will learn how-to set up WordPress with the following configuration:

    • WordPress
    • SSL – https:// with certificate from CloudFlare
    • Amazon AWS EC2 VPS server
    • Ubuntu 16 LTS
    • Apache
    • PHP 7
    • External Amazon RDS MySQL database server. MySQL version 5.7
    • External Amazon ElastiCache memcached server
    • Google PageSpeed module
    • Using Google gMail or Google Apps for Work as SMTP server
    • Automatic update of Ubuntu every day
    • Timezone set to Oslo, Norway
    • CloudFlare CDN, performance and security
    • Configure the Amazon Web Services firewall to only allow connections on port 443 and 22 from selected IP adresses
    • Protecting WordPress admin section using .htaccess with IP rules
    • Forwarding all non-SSL traffic to the httpS:// version of wordpress
    • Automatic backup of WordPress
    • Backup of Ubuntu

     

    [themedy_button url=”https://www.wpjeos.no/wordpress-jeos-concept/” icon=”flash” font_awesome_att=”” label=”More about the WordPress JeOS concept” colour=”blue” colour_custom=”” size=”medium” edge=”straight” target=”_self”]

     

    Ubuntu 16 AWS EC2 initial activation of the VPS server

    After signing up and activating your account with Amazon Web Services it’s time to chose the right image.

     

    [themedy_button url=”https://www.wpjeos.no/out/008-aws-free” icon=”chevron-circle-right” font_awesome_att=”” label=”Sign up for a Amazon AWS account” colour=”blue” colour_custom=”” size=”large” edge=”rounded” target=”_self”]

     

    [themedy_button url=”https://www.wpjeos.no/activating-ec2-ubuntu-16/” icon=”chevron-circle-right” font_awesome_att=”” label=”Chose your Ubuntu 16 VPS image” colour=”blue” colour_custom=”” size=”large” edge=”rounded” target=”_self”]

     

     

    Buy this VPS server preconfigured for USD 180,- $

    This page is a DIY guide. When you run into problems or just want to get this server production ready as soon as possible. No problem. We will prepare it for you if you pay us for the time we spend configuring it. You get a server with 1 GB of memory, 30 GB SSD disk and 1 processor. Want another hardware configuration? No problem. Just contact us. One hour of support using email, phone, FaceTime and TeamViewer is included. Do you need additional work? No problem. We charge USD 95,- $ pr hour outside Norway.  Check out the TBT profile on TrustPilot to see what others thinks of TBT.
    [themedy_button url=”https://www.wpjeos.no/out/000-kontakt” icon=”plug” font_awesome_att=”” label=”Order your plug and play WordPress VPS server now!” colour=”blue” colour_custom=”” size=”large” edge=”rounded” target=”_self”]

     

    [themedy_button url=”https://www.wpjeos.no/out/006-trustpilot” icon=”bookmark-o” font_awesome_att=”” label=”Visit TrustPilot to see what our customers thinks of TBT” colour=”blue” colour_custom=”” size=”large” edge=”rounded” target=”_self”]

     

    [themedy_button url=”https://www.wpjeos.no/hire-freelancer/” icon=”user-md” font_awesome_att=”” label=”Need more choices?   Hire a freelancer to help you” colour=”blue” colour_custom=”” size=”large” edge=”rounded” target=”_self”]

     

    How to migrate your WordPress to the JeOS VPS with Migrator

    Moving your current WordPress site to this VPS server is usually a straight forward process. All you need is the Migrator module. This module makes it easy to move your site and even change the domain name to a new and better URL.

    [themedy_button url=”https://www.wpjeos.no/out/006-trustpilot” icon=”wrench” font_awesome_att=”” label=”Read more about how to move WordPress with the Migrator module” colour=”blue” colour_custom=”” size=”large” edge=”rounded” target=”_self”]

     

     

  • WordPress JeOs concept

    JeOS is pronounced juice. Its means Just Enough Operating System. Thats just what this is about. The idea is to run only what WordPress needs and nothing else. JeOS is in this context a paradigm for optimizing your operating system to fit the needs of WordPress. We are also lifting weight of the VPS server by moving services into the cloud.

    A stripped down and cloudish VPS server

    By unloading the Ubuntu VPS server with as much as possible, you will run a VPS server that requires less resources than the traditional WordPress VPS server. This is because many of the core services are moved to different cloud services. By cloudifying your WordPress VPS server things get simpler, easier, faster, budget minded, faster, more robust and easier to troubleshoot because you can isolate the different processes.

    We recommend the JeOS concept when running WordPress

    Following the JeOs concept makes your Ubuntu VPS smaller, faster and potentially more secure. There is fewer access points for hackers. Fewer possible points of failure. The JeOs WordPress concept has many advantages. This is some of them:

    • Needs less memory
    • Needs less CPU
    • Needs less storage
    • Needs less bandwidth due to CloudFlare CDN
    • Less expensive. Amazon AWS Charges for what you use.
    • Potentially faster
    • Potentially safer
    • Potentially fewer points of failure
    • Easier to upgrade
    • Easier to migrate
    • External MySQL server using RDS
    • External memcached server using ElastiCache
    • External CDN – Content Delivery Network – using CloudFlare
    • External minify and other optimizing techniques using CloudFlare
    • External origin network optimizer using CloudFlare Railgun results in an average 200% additional performance increase. (Add-on)
    • Easier troubleshooting because processes running in the cloud can be isolated.
    • Administration of Ubuntu using a SSH client on your mobile, tablet or PC
    • Administration of WordPress with your mobile, tablet or PC using WP-cli
    • Administration of WordPress with your mobile, tablet or PC using WordShell
    • Almost unlimited scalable
    • No graphical admin panel that will drain memory, cpu, storage and other computing resources, create points of failure and require license.
    • Easier and faster move to Ubuntu 18 LTS or Ubuntu 20 LTS in due time. The Ubuntu 16 LTS distributions is coming to it’s End of Life after a number of year. At that time it should be quite easy to set up a new JeOS EC2 Ubuntu 18 LTS or Ubuntu 20 LTS VPS server from scratch. Then use UpdraftPlus or another backup plugin to move WordPress to a fresh new server. For a number or reasons are we recommending to set up a new, fresh JeOS VPS server in stead of upgrading the current outdated server.
    • Google Tag Manager to handle tags from AdWords, Google Analytics, Bing AdCenter, Facebook and most other tags.
    • The Google PageSpeed module uses ElastiCache to take load of the VPS server and speed up everything by optimizing.

     

    You can use this series of How-to’s to set up your own JeOS server or order a prebuilt server from us. We are also available if you need help. There is also lot’s of freelancer ready to help you.

    [themedy_button url=”https://www.wpjeos.no/hire-freelancer/” icon=”binoculars” font_awesome_att=”” label=”Find a freelancer to build you JeOS WordPress VPS” colour=”blue” colour_custom=”” size=”large” edge=”rounded” target=”_self”]

     

    [themedy_button url=”https://www.wpjeos.no/out/009-jeos” icon=”binoculars” font_awesome_att=”” label=”Order a prebuilt WordPress JeOS VPS server” colour=”blue” colour_custom=”” size=”large” edge=”rounded” target=”_self”]

  • Activating EC2 Ubuntu 16

    Start with the Ubuntu AMI locator. Use the menu at the bottom of the page. Narrow and filter your choices  to the right version. Chose an AMI with:

    • Zone: The zone closest to your users and customers. We use eu-west 1 for Norwegian sites.
    • Name: Xenial
    • Version: 16.04 LTS
    • Arch: amd64
    • Instance Type: hvm:ebs-ssd
    • AMI-ID:  ami-07174474 was the most recent in EU-WEST in November 2016. Check for a newer in your region!

    Log into your account on AWS. Then double click on the link of the AMI-ID you have chosen. Then this AMI will be added to your account.

    [themedy_button url=”https://www.wpjeos.no/out/017-ubuntu-ami-finder” icon=”anchor” font_awesome_att=”” label=”Locate you AMI here” colour=”blue” colour_custom=”” size=”large” edge=”rounded” target=”_self”]