Problem Statement
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.
Read More
Tag: centos
Diplaying Logs with journalctl [CentOS7]
To simply view the logs on your system, you can execute the following command:
journalctl
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 Read More
If you nead, automated certificate expiration checks on CentOS Linux
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. Read More
Postfix dkim and spf filtering
Installing OpenDKIM:
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
Setting static IP in CentOS 7 Minimal Installation
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. Read More
CentOS timezone config
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.
Statistics for webserver on CentOS7
Install & Configure AWStats
Now that YUM has its additional repository we are ready to install. From the commandline type:
yum install awstats
Modify AWStats Apache Configuration:
nano /etc/httpd/conf.d/awstats.conf
Read More
Create Self-Signed Certificates on Apache for CentOS
Install Mod SSL:
yum install mod_ssl
We need to create a new directory where we will store the server key and certificate:
mkdir /etc/httpd/ssl Read More
CentOS grub update (Linux and Windows Dual boot)
yum install epel-release
#yum search ntfs
yum install ntfs-3g Read More
Remove Old Kernels on Fedora, CentOS
Check Installed Kernels:
rpm -q kernel
Delete / Remove Old Kernels:
## Install yum utils ##
Read More
yum install yum-utils