Category: Tutorials

Github Desktop – Step 3 – Branch, Edit, Commit

This article is part of a series on Github Desktop. For the introductory piece you can visit here.

Now it’s time to get to work. But you don’t make your changes in the default branch; jobs should be broken up and done in separate side branches. So, click the arrow button to open the “branches” dropdown list.

  1. Type in the name of a new branch. Make the name descriptive of the job you will be doing and try to keep to one branch for one job. In the early stages it’s a good idea to keep the scope of the jobs small. In this example we are adding an FAQ section to the readme file.
  2. Click on New branch when you have entered the name.

You can also publish the branch to origin by clicking the Publish branch button.

Make extra sure that your new branch is shown as Current branch in the top bar. Then go into your cloned files and start making your changes. You can commit the changes whenever you like. You might choose to work in stages and commit after each stage, or you might do the whole job in one go and commit at the end.

  1. When you come back to GitHub Desktop it will show you the list of files that have been changed, and give you an indication of all the changes (green background for additions, red background for removals).
  2. For each commit you should enter a short description about the work that has been done. This will help you if you need to roll back to a previous commit.
  3. Then hit the commit button.

This article has been provided by Alan Coggins and was originally published on SimplyComputing.work. The original post can be found here.

Github Desktop – Step 2 – Clone

This article is part of a series on Github Desktop. For the introductory piece you can visit here.

Now you have a fork of the “official” files in your GitHub account you need to clone them to your computer. You will first need to download and install GitHub Desktop – then open it and select the Clone repository option from the File menu.

You will be asked to choose a repository from Github.com

  1. Find the repository you have just forked (it should have the fork icon next to it) and select it.
  2. Check the path that is auto-filled is correct.
  3. Hit Clone.

The cloning process will begin:

This article has been provided by Alan Coggins and was originally published on SimplyComputing.work. The original post can be found here.

2 Ways To Migrate Your ClassicPress Site To New Host With No DownTime

Migrating your website to a new hosting provider can be quite challenging especially if you are doing it for the first time, but it doesn’t have to be.

Even if you get past the migration, the few little issues you might encounter during migration could cause downtime & data loss, which you should avoid at all cost.

In this guide, you will learn two good ways of migrating a ClassicPress website with neither zero downtime or data loss, but before we get started, I’ll love to stress this point:

Pick a Reliable Hosting Provider

You don’t want the hassle of jumping from one hosting provider to another. This is why it is crucial to pick a suitable and reliable hosting platform. Invest your time and effort in comparing different hosting offers.

Is your current shared hosting server not up to par? Switch to a managed ClassicPress hosting solution. A simple google search of “ClassicPress Managed Hosting” should show you various options.

If your business is growing very quickly, you might also consider using either a VPS or a dedicated server, this way you can always ensure optimal server performance.

Note: Don’t inform your current hosting providers about the migration until about 5 days after you move, because they could terminate your account and cause something worse than downtime. Test the new server for a while and if it fits your need, delete the other server and rock on.

Let’s get started with the migration.

Method 1: Using a Plugin (UpdraftPlus)

Once you have selected your new hosting platform, the next step is to download and activate UpdraftPlus on your ‘old website’.

UpdraftPlus is a free plugin that provides a complete website backup solution plus an option to backup remotely, it backups your files (images, videos), database, plugins, and themes.

Before we start backup up a complete website, it is advisable to put the website you’ll be migrating in read-only mode (disable comments and forms, make sure you halt your editors from publishing contents, installing plugins, etc)

Step 1: Backing Up a Complete Website

Let’s take a backup. Go to UpdraftPlus backup settings:

You can either download your backup file or save it to remote storage. To make the process easier, I’ll go with the remote option.

Note: It’s best to avoid backing up to the web server, because losing the web server would mean losing both your website and all of your backups. Instead, you can download the backup to your local hard disk. This option isn’t necessary if you are backing up remotely, but it doesn’t hurt to keep two copies.

Navigate to UpdraftPlus Settings, and choose remote storage.

I am using Google Drive, but feel free to use whatever soothes you as long as you have an account with the remote provider.

UpdraftPlus needs authorization access to your Google Drive account. Follow the link to authorize access to your Google Drive account and Allow Access.

Once you’ve allowed access, click the Complete Setup button to proceed:

Push the backup button:

and you should see a couple of options, make sure “Send this backup to remote storage is ticked” among the other two outlined in the image below. Click backup once you are done cross-checking:

Depending on the size of your ClassicPress website, this could take a couple of minutes.

If you receive “UpdraftPlus Vault: this site has not been connected” don’t fret; re-click the Backup button and hopefully, UpdraftPlus should reconnect to your remote storage.

You should see this once the backup is completed:

You can also download the backup to your local hard-disk, but this is totally optional.

It’s time to restore the backup on your new host, but before we do, we need a way to test the new host/server without it been publicly available, this is done via the Hosts file. (This make sure your old server is still running while you are testing the new one.)

Step 2: Modifying the Hosts File

A hosts file is a simple text file that associates or maps an IP address with hostnames, this is kind of difficult to grasp but this is basically how it works:

When you buy a new server/hosting, you are given an IP address for that server. The IP address is like a phone number that is associated with your domain name. For example, classicpress.net has its own IP address. When you type in classicpress.net in the URL address bar, it resolves (or connects) the domain name “classicpress.net” to the IP address where your website “lives”. For example, the IP address for classicpress.net is 192.33.44.55. Similarly, your mum’s name in your phone book has a specific phone number attached to it, and if you call it, you’ll connect with your mum… you get the idea 😉

At first, I want to be the only one to access the new server so I can test if everything works correctly before I go live. To do this, I create a hostname (my current URL address) and associate it with the new IP address I got from our new hosting provider.

Don’t overthink it; this is like creating a local server with your domain name but in this case, you are faking the URL of your domain name to point to the new server’s IP address.

First, copy the new servers’ IP address. If you don’t know how to find your new host IP, ask your hosting provider. (This is also a test to show if their customer support is responsive or not.)

Once you’ve copied the IP address, edit the hosts file on your computer. Instructions for both Windows and Linux/OSX below:

On Windows, the file is located at C:\Windows\System32\drivers\etc

Right-click on the hosts file and open with your preferred text editor:

Add both your new host’s IP address and your existing domain name to the file. Now, whenever you visit the domain name, it will point to your new server, but only on your computer. This makes testing easier.

Note: Hosts file doesn’t determine the protocol you would use, so, you don’t have to add http:// or https://

Save.

On Linux & OSX machine:

Fire up your terminal and run sudo nano /etc/hosts

If that command isn’t working on mac, use sudo nano /private/etc/hosts

Add both your new host’s IP address and your existing domain name to the file:

linux:

OSX:

Save with CTRL X and confirm with y

Clear DNS cache: sudo service nscd restart

Now, if you visit your domain name, it would be loading the content from your new server. But we haven’t imported the backups yet. Let’s dig into that next.

Step 3: Restoring Backup to the new hosting server

Now that you are able to access new host, download and install ClassicPress either via Softaculous, Installatron or manually, here is tutorials on how to do it:

Once you install ClassicPress, the next step is to download and activate UpdraftPlus on your ‘new website’.

You will need to reconnect UpdraftPlus to the remote storage you connected to earlier (in my case, it was Google Drive), this way, you will be able to restore the backups in one click:

UpdraftPlus needs authorization access to your Google Drive account. Follow the link to authorize access to your Google Drive account and Allow Access.

Once you’ve allowed access, click the Complete Setup button to proceed:

Rescan the remote storage from the existing backup section to get the stored backup file:

And that should show you the backup file:

Go ahead and restore the backup data:

Once you’ve done that, you will see a restore window, select all that applies and click next as shown in the image below:

UpdraftPlus would retrieve and prepare the backup files:

If the website address in the backup data is different from that of the new site, you may get a warning about it. While that isn’t an issue, do make sure the URLs are both of the same formats. For example, if you had https://example.com in the old URL, the new URL should also be https://example.com and not https://www.example.com or http://example.com. This isn’t an issue if the variations are redirecting to the proper URL.

Finally, click Restore:

Hopefully, the migration should be completed! Feel free to test if all the files are intact. If all your files are in place and you are done with testing, we can move on to adding DNS records of the new host.

Step 4: Updating Your DNS Server

To avoid confusion, delete the line you added to the hosts file. If you don’t, your computer will use the address mapping in the Hosts file and it won’t query the DNS.

Note: The changes can take anywhere between 30 minutes – 48 hours, use dnschecker to monitor the website propagation across the globe. – Thanks to James for pointing this out

Now that you have both files on both hosting accounts, it is time to update your DNS nameservers with the ones provided by your new hosting provider. Please contact them if you are finding it difficult to find them.

It usually looks something like this:

ns1.yourhostingprovidersname.com

ns2.yourhostingprovidersname.com

Once you have the DNS, go to your domain registrar account to make the changes.

If you are using Namecheap as your registrar, this is under the Domain Tab (If you aren’t, ask your host where it is located.):

Then scroll till you get to ‘Nameservers’ and choose Custom DNS

Add the DNS records:

Step 5: Wait For Propagation

Once you have updated your DNS servers, you will need to wait between 30 minutes to 48 hours from the time of the change before your site will load from the new host. Although we can reduce the TTL for faster propagation, this is beyond the scope of this guide. If you want to learn more, there are some good tutorials on best practices for TTLs on the web; your hosting company should be able to help you here as well.

While your DNS servers are propagating worldwide, your site will load either from the old hosting account or the new hosting server if the DNS flushes in some region. This ensures a smooth transition. After a day or two, you can cancel the old host account.

Method 2: Migrating Manually

If you want to manually migrate to a new server, you will have to back up the file & database and then transfer it to the new host. This is pretty straight-forward. To do this, you can either utilize your hosting control panel (e.g Cpanel, VestaCp, etc) or use an FTP clients such as Cyberduck, FileZilla or WinSCP.

I’ll be using WinSCP as my FTP client!

Step 1: Download ClassicPress Files & Database

First, you connect to the old hosting server with WinSCP:

You can ask your hosting provider for the FTP details. Once you have connected, Open the public\_html folder (or your host’s equivalent). Select all the files inside it and Right-Click to Download:

Once the download is completed, it is time to backup the database:

Access your PHPMyAdmin page from your hosting control panel. Once you are in, select the Database you want to export, and click the Export Button:

Click the ‘Quick Method’ and Go.

Once you click Go, your database should be downloaded.

Step 2: Upload ClassicPress Files and MySQL Database to Your New Host

The next phase is to upload all you’ve downloaded from your old host to the new host server:

  1. First, extract the backup you downloaded.
  2. Connect to the new server with your Ftp client
  3. Navigate into the public\_html directory
  4. Upload the files you just extracted into the public\_html directory
  5. Lastly, let’s create a new database for the new host

Access your PHPMyAdmin page from your hosting control panel. Once you are in, click on New:

Input your new database name and click create:

Navigate to Privileges Tab and Add user account:

Type in a username, localhost and a password in the fields as shown in the image below:

Grant user privilege.

Note: If you don’t want to be a superuser or an Admin, you can uncheck the Administration privilege.

Click on the Go button to save the details:

Take note of the database name, username, and the password.

Select the new DB you just created:

Click the Import tab:

Upload the SQL backup you downloaded the other time and click Go:

Once you have chosen the SQL file, click Go at the bottom of the page, and that should upload the records.

Step 3: Update wp-config.php with Your New Database Details

Access your new host account with an FTP client and make the public\_html your working directory.

Once you are in, the next step is to edit the wp-config file (Right-Click to edit):

Replace:

  • DB_NAME — The name of the new database you created
  • DB_USER — The username of the new database you created
  • DB_PASSWORD — The password of the new database you created
  • DB_HOST — database hostname should be localhost

Save when you are done, replacing the above values with your information.

Note: For a full overview and explanation of the wp-config file you can look at this tutorial.

Step 4 & 5

Same as Method 1

That’s all 😉

Github Desktop – Step 1 – Fork

This article is part of a series on Github Desktop. For the introductory piece you can visit here.

You will need your own GitHub account before you can begin. Once that is set up and you are logged into your account, find the repo on GitHub that you want to fork. For this example we will be forking Classic Commerce, so we go to the main Classic Commerce repo.

  1. Make sure it still shows you as logged in to your account.
  2. Then click the “Fork” icon in the top right.

That’s it! It will now complete the process for you.

IMPORTANT:

GitHub Desktop has a quirky limitation that has been discussed numerous times online but remains unfixed. Creating a fork automatically makes a default branch in your fork with the same name as the default branch in the upstream repo. GitHub Desktop needs these two to have different names.

The solution is to create a new branch with another name in your fork, make it the default and then delete the branch that was created originally. The default branch is often called master, but in our case it is develop. You will need to follow the procedure outlined below.

  1. Click on the Branch button to get the dropdown box of current branches.
  2. Enter the name of a new branch – just use a minor variation of the current default branch.
  3. Click on Create branch.

  1. Now, click on Settings.
  2. Select Branches in the side menu.
  3. Choose the branch name you just made.

Click the Update button to set this as the default branch.

You will get a warning message – click the button to continue.

On the main screen, click the Branches section in the top menu to see all the current branches.

  1. Check that you have the new default branch with your unique name.
  2. Then delete the branch that was originally created.

Now you are ready to start working in GitHub Desktop.

This article has been provided by Alan Coggins and was originally published on SimplyComputing.work. The original post can be found here.

Github Desktop – A Really, Really Simple Tutorial

This is the introductory part of a series that will be published over the coming weeks. To look ahead for the whole tutorial you can visit here.

Github Desktop is a GUI that helps you to use GitHub without having to deal with the command line (which, let’s face it, does tend to discourage a lot of people). You could think of it as the umpire in a sort of complicated game of tennis involving three players, except they will be bouncing around files instead of tennis balls. Files get stored in a repository (repo for short) which is like a separate locker for each project. The repo also stores each file’s revision history.

The three players are:

  • Upstream – the “official” project files that live on the main repo in GitHub,
  • Origin – your fork of the project files that live in your GitHub account, and
  • Local – the files on your local machine where you will be making your changes.

The objective of this tutorial is to show you how to contribute to an open source project by working on files from some remote repository and then submit them (make a pull request) so they can be merged into the “official” project. It is important to understand the interaction between the three players at all stages in this process. The diagram above will be used throughout this tutorial to illustrate the various exchanges. Boxes are shown in blue when they are synchronised with the current official repo; red means they have got out of sync; green is used when the upstream repo has been changed.

Note that each of the steps will get their own articles in the future as parts of this series.

Step 1 – Fork the “official” files

You obviously can’t work directly on the main project files, so you first need to take a copy of them to your own GitHub account. This is called a fork and it involves copying the files from the “official” repo (upstream) to your own account (origin).

Step 2 – Clone the fork to your local computer

In order to work on the files easily, you will need to make another copy on your local machine. You can do this through GitHub Desktop by cloning the files from origin. Note that all players are still in sync.

Step 3 – Create a branch, work on some files and commit the changes

Now, it’s time to get to work and start making your changes to the file(s). You should do this in a branch; this keeps your workspaces separate and manageable. Once you have created a branch, make quite sure GitHub Desktop is showing it as your current active branch, then go in and start work. You can commit these as you go at any time. GitHub will keep track of everything and it’s easy to roll back to a previous commit. Your local files will now be out of sync with origin and upstream.

Step 4 – Publish your changes to origin when you are done

When you are happy with the changes you’ve made, you can publish (push) them to your GitHub account. Now both local and origin will be different to upstream.

Step 5 – Create a pull request

A pull request (PR) sends a message to the people who maintain the “official” repo, asking them to consider adding in your edits. There is probably a form template that you will need to use, to show you’ve followed the correct coding standards and done all the necessary tests. Maintainers may ask questions to clarify the changes, how they have been tested, or they may ask for some revisions. This process may take take a while because people are busy, but it’s acceptable to ping someone on your PR and ask them to take a look.

Step 6 – Make some revisions to your PR

Sometimes you might find the need to make some extra changes to your initial pull request, or perhaps the maintainers of the “official” repo have suggested you make some revisions. It’s recommended NOT to open a new PR for this – just do another commit to your file(s) in local, push to origin, and your latest changes will automatically flow through to the existing PR on upstream.

Step 7 – Wait for merge

If all goes well, you will get a message to say that your edits have been approved and merged into the main project. Note that in the diagram below, you are still not in sync with the “official” repo. This is because your edited files still live in branches and your main (default) branch is now out of date. Other people may have been making changes to the upstream files as well.

Step 8 – Fetch the new upstream files and merge into local

You now need to update the files in your local computer to reflect the new “official” repo files. You do this by fetching the upstream files to local and merging them in with the files there (it’s a good idea to do this regularly, to keep up with all the changes). You can also delete the branch as this is no longer required.

Step 9 – Push the new files in local to origin

Finally, you need to update the files in your GitHub repo by pushing the new files in local up to origin.

All players are now back in sync. Game, set and match!

Glossary

Branch – A branch is any set of code changes that has been given a unique name. It is a workspace created for a specific set of changes, and the name should describe the changes that are being made in that job.

Clone – Forked files live in your GitHub account (origin), but you work on them on your local machine. You can do this through GitHub by cloning the files from origin to local.

Fetch – This is the term used to describe downloading any changed files from a remote repository into your local repository. Note that after this process you still need to merge them into your own local files.

Fork – In order to work on remote files you first need to take a copy of them to your own GitHub account. This is called a fork and it involves copying the files from the “official” repo (upstream) to your own account (origin).

Local – The files on your local machine where you will be making your changes.

Merge – This is the process for combining different sets of changed files. You will be alerted if there are any conflicts that need to be resolved.

Origin – Your fork of the project files that live in your GitHub account.

Push – You push (or publish) files from your local machine to your GitHub repository.

Pull – This is the process that is used to fetch and download content from a remote repository and immediately update the local repository to match that content. So pull is a combination of fetch and merge.

Pull Request – A pull request (PR) sends a message to the people who maintain the “official” repo, asking them to consider adding in your edits.

Publish – see Push.

Repository – Files get stored in a repository (repo for short) which is like a separate locker for each project. The repo also stores each file’s revision history.

Upstream – The “official” project files that live on the main repo in GitHub.

This article has been provided by Alan Coggins and was originally published on SimplyComputing.work. The original post can be found here.

How To Setup ClassicPress on Ubuntu 16.04 Using VestaCP at Digital Ocean

In this guide, you will learn how to set up, install and configure ClassicPress on an unmanaged web server at Digital Ocean VPS.

The server we are going to set up should be running on Ubuntu 16.04 with a working Vesta Control Panel that can be used to manage multiple websites, email accounts, Ftp accounts, Mysql Databases, DNS records and more.

Requirements:

  • Your time.
  • A cup of water.

Let’s go steadily and consistently.

To start with, let’s discuss…

An Unmanaged Server

As the name explains, an unmanaged server is one that is not automatically controlled or managed by a hosting provider or other service; it is managed by you. The hosting provider gives you access to a dedicated server where you install the necessary components to keep your server & website running. There is no support mechanism to could guide you if anything goes wrong.

So, you can either hire skilled people to help you with the configuration or you can do it yourself with a manual installation guide. (Be aware that you can mess things up if you aren’t skilled enough.)

For a moment, let’s assume you have a knowledge of how to set up a server and you got your website running successfully. Fortunately for you, in time your business/website starts to gain traction and your business starts to grow. But, over time, you notice your website has become a resource hog. Your dedicated unmanaged server isn’t capable of serving your website anymore.

All is not lost! You have three options:

  1. Add more resources to the existing server. This may or may not be possible, depending on your hosting provider. Some hosting providers allow for an upgrade, while others do not. If you are lucky and your provider supports an upgrade, then you can add more resources. However, there are usually limits to how much you can add and, depending on how it is set up, you may experience some downtime during the transition. 
  2. Add more servers and distribute them accordingly. This can be a daunting task, as you have to manually configure them yourself or hire knowledgable people to do it for you.
  3. Migrate to a cloud server. A cloud server is capable of scaling automatically as the need arises.  You can automatically upgrade CPU, Ram, or Disk Space with little to no downtime. 

This guide will assist you in registering and configuring your cloud server at DigitalOcean.

What is a DigitalOcean VPS?

DigitalOcean is a cloud hosting provider that offers, among others, Virtual Private Servers (called Droplets). Like a dedicated server, you own your Droplet. You have the privilege of choosing your OS during deployment and you’ll also be able to configure the VPS to your liking.

The benefits of using Digital Ocean’s VPS solution are that they maintain the hardware for you, and you can automatically scale when the need arises.

If you feel like learning more about DigitalOcean, I created an article on that: What is Digital Ocean and What Are Droplets Used For [Simple Guide!]

With that understanding, we are ready to move into the main meat of this guide. (Who doesn’t love meat anyway? 😉 )

Note: I’ll assume you have a registered domain name

Let’s buy a server at DigitalOcean and get on to setting up ClassicPress.

Registering at DigitalOcean

If you have a registered domain, then you want to point the domain name to your Droplet. (You’ll remember I said a Droplet is Digital Ocean’s name for a Virtual Private Server). You need to purchase a Droplet to proceed.

Hey: Get $100 free credit for 60-days when you use ClassicPress referral link, this way, you not only enjoy free credit but you also help in supporting ClassicPress infrastructure. 

This is a no-referral link, if you prefer: Register with DigitalOcean

Step by Step Instruction:

  1. Click on the ClassicPress referral link above, and fill in your details as shown below:
    Register DigitalOcean alt
    I obfuscated some fields for personal reasons 😉

     

  2. Sometimes, you might be redirected to a Recaptcha page upon clicking the “Create Your Account” button. Verify you are not a robot and you will be redirected to the below image. Click “Create Account”

     

    Register DigitalOcean 2
    You will only see the green box saying you’ve received free $100 when you use ClassicPress referral code
  3. You will be sent a confirmation link to confirm your email address. 

  4. Once you’ve verified your email address, you will need to set up your billing account. This is necessary in order to eliminate frauds and spammers. Fill in your credit card details or use PayPal to make the process faster.
    DigitalOcean credit card details
    You may see a temporary authorization hold on your card, which your bank should release soon. DigitalOcean does not charge you until you start using paid services.

     

  5. Don’t be surprised if your account is automatically locked after verifying your payment details. Don’t be scared; you will be unlocked after the team checks it manually, This could take a few hours, so if you don’t want to wait, contact them using this email address: [email protected]
    Tips: In case you are asked the reason for choosing DigitalOcean, reply by saying:  I want a better cloud hosting with a greater uptime for my website. 

Hopefully, your account is now unlocked, and you are ready for the next step. We’ve covered a lot already, this is where the information you learn above should merge together like ice-blocks 😉

Creating a Droplet on DigitalOcean/Creating an SSH

Droplet is the nickname of Digital Ocean’s VPS (Virtual Private Server). They are virtual machines that run on top of a virtualized hardware. They mimic a real server in that you are provided with a set amount of CPU, SSD (Solid State Disk) Storage, and RAM.

Let’s create our first Droplet:

  1. Click on your new project and fill the fields: Name of your project, description, and purpose.

    Add new project alt

     

  2. Click on “Get Started With a Droplet”Get started with a droplet
  3. Select Ubuntu 16.04.6 x64

  4. Wait! Don’t select the $40 Droplet, you don’t need it if you are just starting out. The $5 Droplet can handle more than you think it can. Select the $40 Droplet if you know what you are doing. If you use the ClassicPress referral link, the $40 Droplet covers you for two months, which is $80, then you pay $40 every following month.

    For me, the $5 Droplet is okay for now.
    Don't select 40 bucks alt
    .
    $5 droplet
    $10 Droplet isn’t bad either if you feel 5 bucks is too cheap 😉

     

  5. Select your datacenter region (where you want your data hosted, e.g if your users are based in New York, select it, if you don’t have an idea, kindly ignore and select at random).
    Data centre and more alt
    Please tick those boxes the red arrow is pointing to

     

  6. Please Select SSH as your authentication. Secure Shell is more secure than using a password to login on your server. SSH helps to communicate remotely with another computer in a secure way by ensuring that the exchange of data is encrypted. Encrypting the data keeps it from being intercepted by an unauthorized system. There is more to this, but for now, just see SSH as being stronger when compared to Password authentication.

    Let’s proceed.
    Select SSH alt
    Select SSH and Click on NEW SSH KEY
    Add a public ssh key alt
    Enter Your SSH Name Here

     

In completing these steps, some stuff could get complicated along the way. Let me briefly explain the concept of how SSH works:

Do you remember when I said “SSH helps to communicate remotely with another computer”? 

There are two pairs of SSH keys: Private and Public. The private is known as the client key (those are the ones in your physical or local computer); the public key is stored in your server (in this case, your Droplet).

When the client tries to connect to the server, the client does this to the server:

  • Client: “Hey server, I am your boss, I have the private keys.”
  • Server: “Hmm, where is your signature if you are my boss?”
  • Client: “……….” (note: the client isn’t actually sending the private keys. It demonstrates to the server that he is the owner of the private key, in the form of a digital signature)
  • Server: “Let me verify from my Public key.”

The server verifies the signature and if it correlates, the client is given access to the server.


We need a way to generate the Private and Public Keys. On windows we use a program called PuTTY, on Mac and Linux, you use Openssh.

I am on Windows, so, I will be using PuTTy. Mac and Linux users can follow the on-screen instructions here:

 SSH Keys for Linux and Mac
Scroll using the scrollbar to follow the above image for openssh!

 

Steps for windows are as follows:

Go to the PuTTy website, and download the setup appropriate to your system:

PuTTy setup
Download the 32-bit version if you are on a 32-bit system, I am on a 64-bit system, so I should be downloading the 64-bit version

 

Install PuTTy on your local computer by double-clicking the putty program file,

 Putty installation wizard 1

Upon clicking on Next in the above image, click on the subsequent Next and wait for PuTTY to complete the installation.

Once that is done, search for PuTTYgen or locate it inside this folder: C:\Program Files\PuTTYand open puttygen.exe

To go to this folder on a 32-bit system: C:\Program Files (x86)\PuTTY

Open PuTTY gen

Click Generate and then move your mouse randomly over the blank area. (This is called the entropy of mouse motion. Bring in thousands of users, and no one would ever predict your mouse movement. This means no one can reproduce your keys. If you are curious to learn more, you can read this StackExchange answer .)

Your key looks like this, once it is generated:
The generated ssh key alt

You can also password protect your SSH key by filling the Key passphrase field. This way, if someone gains access to your computer, they will need to provide a passphrase to access it. Keep in mind that you must provide this passphrase every time you use this key.

Note: Don’t use a simple password or password you’ve used elsewhere; use something stronger. You can generate one here: Password generator

Once generated, store the password inside a private book at home. (No, don’t keep it on your PC.)

Save your Private Keys in a folder in your local computer:

Save private key

We are getting there!

Copy Public Key
.

Copy the Public Key and paste it in your DigitalOcean account. Make sure you copy everything:

Paste Public Key in DO

Click “Add SSH Key”

The last step of finalizing our Droplet: Choose your name, add tags and Click “Create Droplet”

Finalize DigitalOcean
You can also enable backup

You will see a progress bar:

Progress bar DO droplet

You see this once the progress bar is done setting the server up:

26. Done with DO setup

The next part is initial server configuration and a basic server security enhancement that helps in securing your server a bit. When we are done with that, we will point our domain name to our DigitalOcean IP and finally install VestaCP.

Connect to your Droplet with PuTTY on Windows

Since we have PuTTy installed, let’s configure it to connect to our DigitalOcean Droplet

    1. Open PuTTy: Locate it inside this folder: C:\Program Files\PuTTY and open putty.exe, if you are on a 32-bit system, goto this folder C:\Program Files (x86)\PuTTY and open putty.exe
      27. Open PuTTy
      .
      28. Putty opened
      Putty window ↑

       

    2. Copy The Droplets IP: Copy your Droplet IP address in the control panel, and paste it in the putty IP field:
      29. Copy Droplet IP
      Copy Droplet IP in DigitalOcean control panel ↑
      30. Paste Droplet Ip to Putty
      Paste it in the field Hostname ↑

       

    3. Add SSH Key: Add the private ssh key we generated in putty
      31. Add the ssh authentication
      Add ssh authentication ↑
      32. Select the ssh private key
      Select the private key we generated from putty the other time ↑

       

    4. Add Root User: root is the default administration user on an ubuntu server. Let’s add it to the Auto-login username field:
      33. Add The Root Username
      Type in root ↑

       

    5. Lastly: Save your session for recurrent login
      34. Save New Session
      Type in the session name, in my case, I wrote “My New Session” ↑

       

Once you are done with the above steps, you can open up PuTTY and select your new session to access your server.

Note: The first time you connect to the Droplet, PuTTY’s security alert pop-up asks you to confirm that you trust the server. Please choose “Yes” to save the server host key as this is the first time you are connecting, or select “No” to connect without saving the identity.

35. Load the new session
Load the new session you saved ↑
36. Confirm the server security
Select Yes ↑

 

PuTTY automatically adds your root username. Since we are using an SSH key, you will be prompted for the password you set on your key. Input the password and you should be automatically connected to your Droplet server:

Putty prompting for passkey of user root ↑
You can see we are connected to the Droplet server ↑

Initial Server Setup In Ubuntu (Recommended)

I almost skipped this part!
This section is highly recommended if you care about tightening your server security, usability and reliability.

I won’t cover this in this guide, as I already wrote a detailed tutorial on how to do this: Initial Server Setup on Ubuntu 16.04 [Enhancing Server Security]

If you prefer an automatic method, you can use a setup script from Jason Hee; it does the heavy lifting for you.

In my opinion, you should go with the manual method. You will not only learn how to troubleshoot issues in the future but also see what is going on step by step. Ultimately it is up to you.

Pointing DigitalOcean Nameservers to Your Domain Name

I am using Namecheap, so, the control panel could be different from yours, but it should be similar regardless of the panel.

Go into domain manager:

39. Domain Manager Namecheap

Add Digitalocean nameservers:

40. Custom DNS Namecheap
This should be ns1.digitalocean.com, ns2.digitalocean.com, and ns3.digitalocean.com

Now, head back to the Digitalocean control panel and create 2 new domain names. One should be your real domain name (e.g websitename.com) and the other should be your panel name (e.g panel1.websitename.com):

41. Add a domain
Click on Add a domain

42. add the domain name in the field and click create domain

 

Repeat the above step and create a new domain for your control panel URL: panel1.websitename.com where websitename should be the name of your domain. 

If you’ve done that, you should now have this:

43. Listed Domain Name

Navigate into the websitename.com, and add a CNAME record pointing www.websitename.com to websitename.com:

44. cname www. to domain.com

If everything is done properly, you should have the below DNS records:

45. Last DNS records

Remember: “websitename.com” should be your domain name, I’ve used this only as an illustration.

Installing Vesta Control Panel

First, log in to your non-root user account. If you don’t have a non-root user, follow this guide Initial Server Setup on Ubuntu 16.04 [Enhancing Server Security]

Download bash install script using the following command:

sudo curl -O http://vestacp.com/pub/vst-install.sh

You might be prompted for a password to confirm you are the new user. Enter the password for the non-root user and proceed by removing group admin using:

sudo groupdel admin

Finally, use this to install vesta:

sudo bash vst-install.sh

You will be asked to confirm the software you want to install on your system, enter y and hit enter:

46. Vestacp first prompt

You will be asked to enter your email address, please enter one:

47. Vestacp 2nd prompt_email

Lastly, you will be asked to enter your FQDN (Fully Qualified Domain Name), this should be the panel URL: mine is panel1.devsrealm.com

Note: Devsrealm is the name of my domain, so you should replace it with yours:

48. Vestacp 3rd prompt_fqdnl

Vestacp takes about 15 minutes to complete the setup, so sit back, take a sip of your water, and watch.

Once that is done, Vesta gives us the info to access our control panel:

49. Info to login the vestacp

Copy the panel and paste in your preferred browser, this is mine: https://panel1.devsrealm.com:8083

Note: If you aren’t able to access your panel URL, it probably has to do with the DNS propagation. It might take anywhere between 30 minutes – 48 hours. If this happens to you, you can use your Droplet IP to login instead; e.g 157.245.94.17:8083. You can also check the url using whatsmydns.net to see if your url has propagated yet.

You will get an SSL warning like this, kindly click on advance and proceed. The warning is normal for first-time access:
50. SSL warning when connecting to new vestaSetting Up Your Vestacp

Log in with the user and password Vesta generated for you:

51. Login to vesta using the given admin and pass

Don’t be like the average Joe! The first thing you should do is change your Vestacp password.

Hover over the admin area, and click Edit:

52. Hover the vestacp admin area and click edit

You can either let Vesta generate the password for you, or you can generate it yourself using Password generator

Wait! Don’t save the settings yet. You can also change other settings like the user’s first and last name, but the most important part to change is the Nameserver:

Change both fields to ns1.digitalocean.com & ns2.digitalocean.com:

53. Change the Nameserver to DO's own

Press Save when you are done fiddling with the settings. Take your time!

When you are done saving, Navigate to the Web Section:

54. Navigate to web section in vestacp

You should see this:

55. Vestacp web section

Before we continue editing, visit the URL to confirm all is in place properly. You should see an Apache Ubuntu Default Page, telling you it works!

56. Apache Ubuntu Default Page

 

You can read those later, head back to the web section in Vestacp and click on add web domain name.

Adding New Domain

57. Web section ADD DOMAINt

Add your domain name and change the IP address to the IP address of your Droplet like so:

59. Adding domain name_1

Click Advanced Options, and use the following setting:

  • Aliases should be www.yourdomainname.com, this way your user can access your website using www
  • Web Template – Default
  • Proxy Support – check
  • SSL Support – check
  • Let’s Encrypt Support – check
  • Web statistics – choose Awstats, I love how it shows me the bandwidth I am consuming
  • Statistics authorization – check, and add a unique user & pass
  • Additional FTP – If you feel you need one for uploading to your hosting easily, check and create the user and password; leave the path as is
  • Save.

 

60. Vestacp Advance section in web

 

Access your website URL (e.g yourdomain.com) and you should see something similar:

61. empty domain vestacp

 

Adding A New Email Account

Go to the mail section and hover over the domain you’ll want to add the email support for:

62. Add mail account for domain name

Add your username in the Account field; add a unique password and click on the advanced section

62. Mail account vestacp simple field

The Quota allows you to set a mailbox size limit. This is useful since you’ll want to reserve disk space for other things. You can press the infinity icon to give it an unlimited storage

Aliases allow you to add other email addresses that forward to that main account. You don’t need this in most cases. The only case you might need is when you have an email account on another service, and you want to keep your emails on that service.

Send login credential to an available email of yours and click Add

63. Advance section vesta mail

To access your email, use panel.example.com/webmail, where example.com should be your domain name. Log in with the user and password you just setup, and you should be ready to go!

Note: You can also use branded nameservers if you have one. It is possible to brand your nameserver if, for instance, you want to use a custom nameserver for every website you are using e.g (ns1.yourwebsite.com). This is beyond the scope of this guide, but if you want to host multiple websites on one Droplet, just point your new domains to the default DigitalOcean nameservers at your domain registrar (ns1.digitalocean.com, ns2.digitalocean.com, and ns3.digitalocean.com) and add new domain as we’ve done above. When adding new domains, make sure you select public address from the listed IP addresses.

Installing ClassicPress Via Softaculous

Softaculous comes pre-installed in Vestacp. It is useful for using scripts to install platforms like ClassicPress, Presta, Joomla, Abantecart, and WordPress.

Unfortunately, ClassicPress isn’t available in the free version of Softaculous, but there are workarounds. We can either use a free “Softaculous one-month trial license” to install ClassicPress or use wp-cli to download and install ClassicPress. Installing via wp-cli is a little more complex than we want to get into for this example, so for now, let’s use the free month trial.

Note: You can also buy a VPS license for $12 a year. The price is very reasonable!

Visit Softaculous Free Premium for your free trial. Enter your Droplet IP and click issue license

64. Softaculous free trial

Give it about 5 minutes to process, and log in to your panel.

Click on App at the upper section:

65. Accessing softacoulous in vestacp

 

Search for ClassicPress:

66. Search for classicPress in softacoulous

You should see the ClassicPress page. Hover over the Install tab and choose Custom Install:

67. Use custom install for cp

Use this setting to complete the installation:

  • Software Setup – Choose your domain name, and make sure the In Directory is blank
  • Site Settings – Add the website name and your preferred description
  • Admin Account – You need this to access your admin panel, input user, password and email of the account
  • Enter your email in the Email installation details, and Install

 

68. ClassicPress Custom install setting

When you are done installing, you will be given info details, which should look something like this:

69. ClassicPress installation detail in softaculous

Access the admin dashboard(e.g https://yourwebsite.com/wp-admin) and go rock with ClassicPress.

I hope you enjoy the guide! This is a journal on how I did the setup, so if you are confused or some sections aren’t clear, please don’t hesitate to ask on the Forums. You can also message me privately on the ClassicPress Slack workspace @Horlaes. I would be happy to help you out if I can.

Credit: Thanks to Wade Striebel & William Patton for pointing out errors and demystifying complex terminologies.

Props to the hard-working people at ClassicPress, Wade, James, Tim Hughes & Tim Kaye, Klein, Lan, John, Alan, Earle, Elisabetta, Fabian, Michelle and others I didn’t mention.

This article has been provided by Ahmed Faruq and was originally published on DevsRealm.com. The original post can be found here.

How to install ClassicPress in Softaculous installer

We have discussed before how to move an existing site into Softaculous here. But how do you install a new site? Easy! Here’s how.

BEFORE INSTALL: Make sure your hosting supports PHP 7.0 and above, recommended when installing ClassicPress

Step 1: Getting started

Open Softaculous and search for ClassicPress in the search bar, then open the ClassicPress summary page – As you can see there is an option to install:

There are two install methods, Quick Install and Custom Install:

Below, choose the appropriate step 2 for Quick or Custom.

Step 2: Quick Install

As you can see from the screenshot below, the only information required for this method are Domain, Installation Folder and Admin Account

After entering the info just hit the install button at the bottom of the page and you will be redirected to:

SUCCESS!! You have installed ClassicPress from the Softaculous installer!

Step 2: Custom Install

The Custom Install is recommended for advanced users who need more set up options.

Just select Custom Install from the drop-down and you will be redirected to this:

Here you can fill in Software Setup, Site Settings, Admin Account and Advanced Options (DISCLAIMER: this is a test site, created on a testing free hosting, options shown may vary according to the settings your hosting allows for Softaculous), then all you need to do is hit the Install button at the bottom of the page, and you will be redirected to this:

SUCCESS!! You have installed ClassicPress from Softaculous installer!

How to install ClassicPress with Installatron

A while ago we explained how to import your existing sites into Installatron in this article. In this post I will give a step by step tutorial for how to install a new site.

BEFORE INSTALL: Make sure your hosting supports PHP 7.0 or above, recommended when installing ClassicPress

Step 1: Getting started

Navigate to the Application browser of Installatron.

Once there, select the ClassicPress icon.

Click “Install this application” in the right corner.

Step 2: Settings

Now, fill in the Location and Version.

Under Location you fill in the Domain name you want to use and optionally the directory in which you want ClassicPress to be placed.

Under Version you pick the ClassicPress Version, Language and Automatic Update settings. If you are not sure what update setting you should pick, “Update new minor versions and security releases” is probably the one you need.

After this you need to fill in the Settings and Advanced settings.

Under Settings you chose your admin’s Username, Password and Email. You also pick your site’s Title and Tagline.

After this you can decide wether you want to fill in the Advanced settings yourself or let Installatron do it for you. If you let Installatron do it, you can now click on “Install” and go to Step 3, otherwise go to Step 2½.

Step 2½: Advanced settings

In the Advanced settings you can configure some extra settings for your ClassicPress installation like Database, Notifications and Backups

Under the Database settings you can fill in an existing database. Fill in the username and password to give Installatron access. It also allows you to pick a prefix for your table. You do not need to change this, but it is helpful to change it to something unique if you are already running other ClassicPress sites from the same Database.

The other Advanced settings allow you to pick what email notifications to receive, where automatic back-ups are stored and how often back-ups should be made.

When all of this has been filled in, you can click “Install”.

Step 3: Wait

Now simply wait for this progress bar to fill up

Once the above turns into:

You are done. Congratulations, Now get to work!

ClassicPress made it to Softaculous!

Tim Hughes and James Nylen did it again. ClassicPress has been added to Softaculous in version 5.3.5. Now you can use the Softaculous one-click installer to install a new ClassicPress site, or import your existing installs into Softaculous as ClassicPress. Of course, it is important to know how to import these sites, so below you will find a tutorial.

Moving your site into Softaculous

If you currently have an existing site and want to move it into Softaculous, here is how you do it.

You may want to do this under the following circumstances:

  • You have an existing site that was originally installed as a WordPress site by Softaculous, but you’ve migrated this site to ClassicPress.
  • You have an existing ClassicPress site, and you’d like to manage its updates using Softaculous.

Step 1: Disconnect your current install.

If you have a site installed in Softaculous as a WordPress site, you will first need to remove it from the existing management system so that Softaculous doesn’t detect your ClassicPress site incorrectly and prompt you to “upgrade WordPress”.

If your site was not installed by Softaculous as a WordPress site, then you can skip this step.

Reach the “All Installs” button located top right and click it.

Next, select the install you need to disconnect and click the red X

Disconnect the existing install from Softaculous

Now uncheck all the boxes as per the screenshot below, this will disconnect the install from Softaculous without touching the files and database.

Uncheck all the boxes

After this, click on Remove Install at the bottom of the page as shown here:

Remove Install

You will be warned that the operation can’t be reverted, click ok.

Step 2: Importing into Softaculous

Now, all you have to do is import the site in Softaculous linking it to ClassicPress, so that it can be managed via Softaculous.

Search for ClassicPress (in the Portals/CMS category) and select the ClassicPress page within the installer.

Click import as shown below:

Importing into Softaculous

On the tab From this Server fill in the required information (http/https and the folder) and click the Import button at the bottom of the page:

Fill in the required information

Step 3: Hold your breath

This page:

ClassicPress has been imported into Softaculous

means you successfully imported your install as ClassicPress in Softaculous!

Step 4: Rejoice

Congrats!

Installatron now offers ClassicPress!

Thanks to the tireless work of Tim Hughes, with more than a little help from James Nylen, we are able to bring you joyous news. And it is something that is surely one step forward for ClassicPress. Installatron has decided to support ClassicPress in their popular auto-installer. Installatron makes installing ClassicPress even easier and we are very pleased that they’ve decided to include our CMS.

So, when will you start seeing ClassicPress becoming available as an option? Installatron added ClassicPress to their software in version 9.1.48-3. If you host your own Installatron, you should update to this version when you are able. If you are with a hosting provider and don’t control your own Installatron, ask them when they are planning to update.

Moving your site into Installatron

If you currently have an existing site and want to move it into Installatron, here is how you do it.

You may want to do this under the following circumstances:

  • You have an existing site that was originally installed as a WordPress site by Installatron, but you’ve migrated this site to ClassicPress.
  • You have an existing ClassicPress site, and you’d like to manage its updates using Installatron.

Step 1: Remove it from the current management system

If you have a site installed in Installatron as a WordPress site, you will first need to remove it from the existing management system so that Installatron doesn’t detect your ClassicPress site incorrectly and prompt you to “upgrade WordPress”.

If your site was not installed by Installatron as a WordPress site, then you can skip this step.

Go to your application.

Click on the Advanced tab.

Click the checkbox to remove the application from Installatron and click Save All.

Step 2: Navigate to ClassicPress

Now, select the Installatron Applications Installer option from your control panel and go to the Application Browser. Choose ClassicPress from the Content Management section.

Step 3: Run the import

You will be importing an existing application, so choose this option from the menu to the right of the big Install this application button.

Choose the Continue button under From this account.

Then make sure the domain name format is correct (http or https, www or non-www, etc). When you have all the details correct, click the Import button (you can always change the details later).

Step 4: Celebrate

You should now be presented with a screen showing the details of your application. Congratulations… your ClassicPress site is now being recognized and correctly managed as a ClassicPress site by Installatron.