Kamloops Website Design, Kamloops Website Development and Kamloops Website Hosting - Adroit Technologies (ATWS)


How to Migrate your Website


Welcome to part two of our guide about how to migrate your website! This guide is a five part series describing some high level techniques that are common to website and server migrations. Don't forget to check out part one of this guide for information on site backup, local hosts configuration and Apache virtual hosts!

What's Going On?

This is part two of a five part guide concerning website and server migration. In this part we will be discussing the monitoring of your website logs and server administration techniques.

Website log monitoring

With the setup and configuration of a new site, you may find you run into some errors and problems that require some basic troubleshooting. Let us begin out monitoring session with the use of the Linux screen application! Screen allows you to have multiple terminal sessions open under a single connection and switch between them in a terminal window. This is effectively terminal multiplexing and can be achieve at a local console with the virtual terminals by using ALT+F1-ALT+F9.

You can also achieve this same effect by opening another terminal windows and having them run side by side; some times this is more effective but at times the remote server may not permit multiple connections from the same IP.

Start up screen with the follow command:

screen -a

Screen effectively operates as a virtual container for shell sessions--somewhat like an MDI parent container. The following are useful commands for screen:

  1. Create a new screen/shell:
    CTRL+a c
  2. Switch between screens:
    • Next Screen:
      CTRL+a n OR CTRL+a <spacebar>
    • Previous Screen:
      CTRL+a p OR CTRL+a <backspace>
    • Toggle between two screens:
      CTRL+a CTRL+a
  3. Display a list of screens:
    CTRL+a "
  4. Lock your screen session:
    CTRL+a x
    This allows your leave your connection open and leave the keyboard. You will have to reenter your username's password to continue the session.
  5. Detach (background) the screen session:
    CTRL+a d
    This allows you to background all of the active screen sessions so you can come back (reattach) the session later. This is useful if you have to restart the SSH server or change the network configuration. To reattach a detached session, execute screen -r

With our configuration outline in part one of this guide, we assume that Apache is being used as the web server. With a default configuration of Apache, the error logs will typically be located in:


Let's setup a new screen session with a scrolling list of Apache errors:

  1. Create a new screen with
    CTRL+a c
  2. In this new shell, execute the following command:
    tail -n25 -f /var/log/apache2/error.log
    This allows 25 lines to be displayed from the error log which will continually update as new errors occur.

Using this method, we can maintain an active scrolling log on one screen and work on another. This allows us to quickly check the logs without severely disrupting our work!

Getting Fancy with tail + grep

If you are on a shared environment, or don't have your own set of logs files to follow with tail, or even just to watch for specific errors you can use grep to filter your tail results. Without going into too much detail, we will present you with a few examples of what is possible:

Filter Results to only show any lines which contain the word "services"

tail -n25 -f /var/log/apache2/errors.log | grep services

Filter Results to show results that DO NOT Contain the word "services".

tail -n25 -f /var/log/apache2/errors.log | grep -v services

Once you introduce grep into the mix, the possibilities become endless!

These are just a few basic examples but please feel free to comment with some tips techniques that you utilize. Also, look out for part three of the site migration series where we discuss the setup and configuration of Apache Rewrite Rules using the mod_rewrite engine!

Recent Entries

Site Migration Series (3 of 5)
How to Migrate your Website

Site Migration Series (2 of 5)
How to Migrate your Website

Site Migration Series (1 of 5)
How to Migrate your Website

Use Google Page Speed to speedtest your website.
Use Google Page Speed to check the speed of your website, focusing on DNS and other common issues

ModX Ditto RSS - Wrong Copyright Year
How to correct the copyright year in ModX's Ditto RSS Feed Builder



Recent Work

View our work portfolio

Learn about us

Discover Adroit Technologies

Our Services

Services matching your needs

Read our blog

Follow our latest news