Linux: How to view log files on the shell

Many Linux servers are administered on the command line e.g. with an SSH connection. In the following article, I will explain several shell commands that make it easy to view log files. These commands will work on all major Linux distributions inc. CentOS, Debian, Fedora, and Ubuntu. Get the last N lines of a log ... Read more

[SOLVED] The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 DEB.SURY.ORG Automatic Signing Key

Here is the solution if you've got the following error message when updating package lists on Debian (apt-get update): The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 DEB.SURY.ORG Automatic Signing Key The sury.org Debian package repository has changed its package signing key. To fix the error, just download the new key: wget https://packages.sury.org/php/apt.gpg -O /etc/apt/trusted.gpg.d/php-sury.gpg Finally, ... Read more

Redirect domains without www (e.g. domain.com) to www.domain.com with apache rewrite rules

Apache www redirect rule

If all your visitors shall access your website with a URL like www.domain.com and not without www, use the following apache rewrite rule for redirecting them. RewriteEngine On RewriteCond %{HTTP_HOST} !^www RewriteRule (.*) http://www.%{HTTP_HOST}$1 [L,R] The apache rewrite rule can be added in a .htaccess file in the website root directory or if you use ... Read more