Recently when a Linux monitoring script using CURL to monitor a https URL broke when migrated to a VM from Oracle Linux v6.7 to v6.9. This post i will try to explain the root cause of the issue and solution to fix the issue.
To simply view the logs on your system, you can execute the following command:
This will display the logs with the oldest entries first. Although this is simple, it is not very useful since we do not tend to read logs like a book.
By default journalctl displays the logs in a pager. It shows you one page of logs requiring you to hit the space bar to proceed.
Diplaying Logs by Date (more…)
One important part of using SSL is to keep track of expiration dates on certificates. Most client software will rightfully refuse to connect to a server that presents an expired certificate, resulting in interrupted services. For CentOS and other RHEL based distributions, the crypto-utils package contains a very useful utility called certwatch, which can be used to detect whether a certificate will expire in the near future. (more…)
yum install opendkim
Create private and public key:
mkdir /etc/opendkim/keys/myhostname.lt /usr/sbin/opendkim-genkey -D /etc/opendkim/keys/myhostname.lt/ -d myhostname.lt -s default chown -R root:opendkim /etc/opendkim/keys/myhostname.lt chmod 640 /etc/opendkim/keys/myhostname.lt/default.private chmod 644 /etc/opendkim/keys/myhostname.lt/default.txt
In order to set the network adapter and get get CentOS to communicate on the network the Ethernet adapter will need to be configured. In this lesson I will set a static IP address for the network adapter. To view a list of your network adapters use the command ip addr.
The configuration file for the network adapter should be located at /etc/sysconfig/network-scripts/ifcfg-enp0s3. With the minimal installation of CentOS there are not many options available to configure the network adapter. One option is to use the vi editor or nano to configure ifcfg-enp0s3. Another option is to use the nmtui utility to edit the network adapter. (more…)
CentOS timezone config files and directories
- /usr/share/zoneinfo/ – The system timezone directory contains the files as per timezone name. For example, the file /usr/share/zoneinfo/America/New_York represents time zone for New York.
- /etc/localtime – It is a symlink to the file localtime or to the correct timezone file in the system located in /usr/share/zoneinfo/ directory.
The inotify-tools can be used to watch a directory or file for activity and take an action when a file is changed, added, edited or simply read. You can find a workaround (or call it solution) for the absence of the inotify-tools in the repositories here.
Sometimes, for various reasons, a directory needs to be watched for new files, file changes, etc. When a change occurs, a certain action should be taken, like copying the files elsewhere or send an email with to notify someone of the changes. There are a lot of such imaginable scenarios to think of. (more…)
Step 1: Enabling Google’s mod_pagespeed Repository
Create a file called /etc/yum.repos.d/mod-pagespeed.repo with the help of your favourite editor and add the following lines of code to it based on your OS bit. (more…)