This article is to show how to log Nginx’s access logs locally using UDP to the local rsyslog daemon, which will send the logs to a remote rsyslog server using TCP and compression. In general, logs could generate a lot of traffic and using UDP over distant locations could result in packet loss respectively logs’ lines loss. The idea here is to log messages locally using UDP (non-blocking way) to a local Syslog server, which will send the stream to a remote central Syslog server using TCP connections to be sure no packets are lost. In addition, we are going to enable local caching (if the remote server is temporary unreachable) and compression between the two Syslog servers.
Our goal is to use
UDP for our client program (Nginx in the case) for non-blocking log writes.
TCP between our local machine and the remote syslog server – to be sure not to lose messages on bad connectivity.
local caching for our client machine – not to lose messages if the remote syslog is temporary unreachable.
compression between the local machine and the remote syslog server.
The first is the old syntax, which is still supported and the second is the new syntax. F simplicity, all of the following configuration will be using the new syntax, because the old one is depricated.
Add a rule to catch the tag containing “nginx” and execute action to forward the messages to the remote server
This tutorial will show you the simple steps of installing a modern Linux Distribution Fedora 31 KDE Plasma Desktop with KDE for the user graphical interface. First, we present the basic steps for installing the Operating system in addition to your present operating systems (here we have two: Windows 10) and then you can see some screenshots of the installed system and the look and feel of it. We have another tutorial showing more screenshots of the installed and working Fedora 31 (Gnome and KDE plasma) – so you can decide which of them to try first – coming soon.
The Fedora 31 KDE Plasma Desktop comes with
Xorg X server – 1.20.5 XWayland is used by default
It is a LIVE image so you can try it before installing it. The easiest way is just to download the image and burn it to a DVD disk and then follow the installation below:
SCREENSHOT 1) Here is our “UEFI BIOS->Boot->Boot Override” and in most modern motherboard you can choose to override the default boot devices.
Choose the “UEFI: HL-DT-STDVDRAM…” to boot and install Fedora KDE Plasma Desktop 31 with UEFI support. You should do this, because most of the new hardware like video cards would not work properly without beeing in UEFI mode.
Always put your root partition separate from the storage (aka data) partitions. root partition should be only for system files and nothing more! Keeping this simple rule you may easily change your operating system (or clean install or clean upgrade) without deleting the user’s data thus preserving the old storage partitions.
Our storage has 2 storage partitions, which means they hosts only data and no system files and there are separate partitions for Linux booting (grub2) and system files (root partition). Here is the partitions layout:
Of course, when there are partitions above 2T the GPT is mandatory.
You can skip the software RAID1 setup if you use only one controller or you have system partitions only in one disk (virtual drive and so on). Here we have two hardware controllers, which we want to use both for the system partitions.
4 RAID1 devices:
EFI partition (/boot/efi)
boot parition (/boot)
root partition (/)
The best practice is have total between 30G and 50G for the 4 partitions (in fact, boot partition could be skipped). Have in mind most modern Linux distributions cannot be installed on less than 10G~20G and for optimal results just separate between 30G and 50G for 4 partitions above (or 3 if you choose to skip the boot one).
Upgrade to CentOS 8 with clean install over our old CentOS 7 system partitions preserving the big data partitions.
Couple of things before start:
UEFI installation will be selected. So boot in UEFI mode.
IPMI KVM is used to install the new Linux distribution – CentOS 8
Preparing the preseed for unattended installation sometimes could be challenging. This article presents the right way to analyze an installation failure in one of the main steps – “select and install software”.
There is a ubuntu installation preseed file for our Bionic unattended installation, which uses the “pkgsel” to install first packages in the new system:
When an installation step in the preseed of a unattended installation fails the setup stops with a “Continue” confirmation.
Here is what you can do to check what exactly fails in step “select and install software”:
Start a shell in the current installation boot. Press “Ctrl+Alt+F2” to start the shell. You may use “Ctrl+Alt+F3” and “Ctrl+Alt+F4” for two more consoles and “Ctrl+Alt+F1” to return to the installation wizard.
Check the /var/log/syslog, in which file the debconf writes the logging information.
Find the lines where the step “select and install software” starts and look for errors after that. In this file, you can see all the step titles during, which the setup passes and they are named the same way the windows’ titles during the installation wizard.
Here is the real world output
Presing the “CTRL+ALT+F2” to start the BusyBox built-in shell, which is ash not bash!
Be careful there are some difference between ash and bash.
Last 20 lines shows the problem – pkgsel failed to install packages in step “select and install software”.
The installation wizard stops.
The problem is in the package “ntp”, the setup cannot install the “ntp” package because of unmet dependencies.
Because it is not so important to install ntp at this stage we added the package to the script executed in “preseed/late_command” and removed the package from the pkgsel line in the preseed file. In general, our problem was because we set local repositories for the bionic packages, but the setup cannot update list of available packages when the you set Bionic mirror to be unofficial local repository.