How to enable auto updates in Ubuntu 20.04

Ubuntu Auto Update

It is important to keep your Linux server up to date with security updates. Linux distributions like Ubuntu and Debian release updates on a daily basis, so keeping the system up-to-date can become a tedious task. Fortunately, there is an option to install security updates automatically. Here are the steps to enable automatic security updates ... Read more

How to chmod files only on Linux

Sometimes, you might want to apply a chmod to files only and not directories. This guide shows you three different ways to achieve that goal on the Linux command line. How to chmod files only One of the easiest ways is to use the find command to select the files and then run the chmod command with ... Read more

[Solved] MySQL: Too many connections error

This guide shows you how to solve the error message "Connect to MySQL server Too many connections". The error can appear in any log file of a service that connects to the MySQL server. This may e.g. be the /var/log/mail.log file if your email system uses a MySQL database. The error means that the ... Read more

How to reset the MySQL root password

mySQL root password reset

The following steps describe the procedure to reset the MySQL root password on Linux. The same procedure works for MariaDB too. 1) Stop the MySQL server service mysql stop 2) Start the MySQL server manually without permission tables which allows us to login as root user without password: mysqld_safe --skip-grant-tables & 3) Login into MySQL ... Read more

How to redirect an HTTP connection to HTTPS in Apache webserver


HTTP connections can be redirected to HTTPS using the apache mod_rewrite module. Mod_rewrite should be available in every apache installation. Apache HTTP to HTTPS Redirect Create a file with the name .htaccess in the website root directory which contains the following lines: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} If you use ISPConfig 3, ... Read more

Redirect a subdomain in Apache and keep the URL in the address bar

Apache Redirect

This tutorial shows you how to use redirect rules in the Apache web server. If you want to redirect a subdomain like sub.domain.tld into a subdirectory of the website and keep the original URL in the browser location bar, you may use the following apache directive. RewriteEngine on RewriteCond %{HTTP_HOST} ^sub.domain.tld [NC] RewriteRule ^/(.*)$ /sub/$1 ... Read more

How to convert filenames or text to lowercase on the Linux command line

Linux tolower command

There is no simple 'tolower' command on the bash, but you can convert uppercase characters to lowercase with a little shell script. The script uses the tr command internally for converting the chars. Create a shell script with the name 'tolower' that converts all text that is given as a command-line argument to lower case: ... Read more

How to access a name based website without a DNS record

Hosts file

If you want to access a name-based website that you created e.g. in ISPConfig before the DNS records are set up, edit the hosts file on your workstation computer and add a line like this: Edit hosts file on macOS X To edit the hosts file on a computer running macOS X, ... Read more