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!
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.
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 effectively operates as a virtual container for shell sessions--somewhat like an MDI parent container. The following are useful commands for screen:
CTRL+a n OR CTRL+a <spacebar>
CTRL+a p OR CTRL+a <backspace>
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:
tail -n25 -f /var/log/apache2/error.log
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!
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!