Posts

Fix semanage command not found in Centos 8

 In this tutorial, I have fix semanage command not found in Centos 8. Semanage is an SELinux (Security-Enhanced Linux) management tool  Error semanage command not found in Centos 8  bash: semanage: command not found I use yum command  [root@DevopsRoles ~]# yum provides /usr/sbin/semanage The terminal output as below: Last metadata expiration check: 1:04:49 ago on Sun 09 Aug 2020 12:50:49 PM UTC. policycoreutils-python-utils-2.9-9.el8.noarch : SELinux policy core python utilities Repo        : BaseOS Matched from: Filename    : /usr/sbin/semanage It's missing policycoreutils-python-utils package in Centos 8. Now, I install package it. [root@DevopsRoles ~]# yum install policycoreutils-python-utils Once the install complete, you try semanage command on Centos 8. # man semanage OR # semanage --help I hope this helps you! have a nice day!

How to Upgrade php version on Centos 7

 In this tutorial, How to upgarde php version on Centos 7. My Server have installed php71. I will upgrade php to version php74 Type the following command to check the current version PHP. # php -v # yum list installed | grep -i php Now, Let go upgade php version to php74 If your has no remi repo, then Turn on Remi repo: # yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm Install yum-utils package # yum install yum-utils If you want to install PHP 7.1, PHP 7.2, PHP 7.3 or PHP 7.4 on CentOS 7. Just enable it as below # yum-config-manager --enable remi-php71 # yum-config-manager --enable remi-php72  # yum-config-manager --enable remi-php73 # yum-config-manager --enable remi-php74 For exmaple, I will chose php74 in this tutorial. # yum-config-manager --enable remi-php74 Update Centos 7  server. # yum update Checking version one more time # php -v You have update php version to php74 running on Centos 7 Server.

How to Install Specific Version of Package use YUM

Image
In this tutorial, I will use YUM command to install specific version of Package. Step 1: How to list the available package version in our repository. Syntax: # yum --showduplicate list [package_name] For Example [root@devopsroles ~]# yum --showduplicate list nodejs Remi's Modular repository for Enterprise Linux 8 - x86_64                                                                                                                          207 kB/s | 539 kB     00:02 Safe Remi's RPM repository for Enterprise Linux 8 - x86_64                                                                                                                         388 kB/s | 1.4 MB     00:03 Available Packages nodejs .x86_64                                                                            1:10.19.0-1.module_el8.1.0+277+2bccb1a9                                                                            AppStream Step 2: Install the specific version of the nodejs packag

How to resolve Error: rpmdb open failed In CentOS

In this tutorial, How to resolve Error: rpmdb open failed Error In CentOS. I was testing on nginx web server in Centos 7 VM Linode . Unfortunaely, I have install new package with yum command , I got this error message: error: rpmdb: BDB0113 Thread/process 3050/139803232012096 failed: BDB1507 Thread died in Berkeley DB library error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Packages index using db5 -  (-30973) error: cannot open Packages database in /var/lib/rpm CRITICAL:yum.main: Error: rpmdb open failed It seemes like YUM broke down. I have not run any yum command. Solve problem, just do the following steps.   First backup the rpm database using command as root user: # mv /var/lib/rpm/__db* /tmp Run the following command: # yum clean all # yum update Clean backup # rm -i /tmp/__db* I hope this helps you.

Remove old kernels in CentOS, RHEL and Fedora

Image
Your system to many old kernels version. How to remove old kernels in CentOS , RHEL and Fedora . For example, I have three kernel,and to keep two kernel on system. How to do it! To check kernel release on centos/RHEL and Fedora [huupv@huupv ~]$ uname -sr The output kernel release as below: Linux 4.15.15-300.fc27.x86_64 Checking installed kernel [huupv@huupv ~]$ rpm -q kernel The output three kernel as below: kernel-4.15.13-300.fc27.x86_64 kernel-4.15.14-300.fc27.x86_64 kernel-4.15.15-300.fc27.x86_64 Delete / Remove Old Kernels To install yum-utils [root@huupv huupv]# yum install yum-utils The output as below: Last metadata expiration check: 2:54:35 ago on Sat 14 Apr 2018 07:14:37 PM +07. Dependencies resolved. ================================================================================  Package                  Arch        Version                 Repository   Size ================================================================================ Installi

How to install aide centos

In this tutorial, How to install aide Centos. What does Aide mean AIDE is one of the most popular tools for monitoring the server changes in a LINUX based system.  It call as Advanced Intrusion Detection Environment. Install AIDE on Centos $ sudo yum install aide Check AIDE Version on your system $ sudo aide -v Configure AIDE $ sudo cp /etc/aide.conf /etc/aide.conf_BK Add lines not check /tmp and /proc in aide.conf file !/tmp !/proc Create the database $ sudo aide --init $ sudo mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz $ sudo cd /var/lib/aide Run the AIDE check $ sudo aide --check Set cronjob to run AIDE check $ sudo vi /etc/cron.daily/aide // The content as below: #!/bin/bash MAILTO=root LOGFILE=/var/log/aide/aide.log AIDEDIR=/var/lib/aide /usr/sbin/aide  -u > $LOGFILE cp $AIDEDIR/aide.db.new.gz $AIDEDIR/aide.db.gz x=$(grep "Looks okay" $LOGFILE | wc -l) if [ $x -eq 1 ] then     echo "A

After install setup Fedora 30

Image
In this tutorial, Things to Do After Fresh Installation Fedora 30. Let do it! TO DO 1. Update your Fedora Always keep your system updated to the latest version of packages. $ sudo dnf update 2. Change the hostname $ sudo hostnamectl status # view current hostname $ sudo hostnamectl set-hostname --static "VivoS15" # set up new hostname 3. DNF tweak edit /etc/dnf/dnf.conf file $ sudo cp /etc/dnf/dnf.conf /etc/dnf/dnf.conf_ORIG [huupv@localhost ~]$ cat /etc/dnf/dnf.conf [main] gpgcheck=1 installonly_limit=3 clean_requirements_on_remove=True fastestmirror=true deltarpm=true 4. Install RPM fusion repository $ sudo dnf update --refresh $ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm $ sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm 5. Player and codecs $ sudo dnf install youtube-dl vlc $ sudo dnf in

Checks for open/closed ssh ports using nmap command

Image
In this tutorial, How to checks all ports if they are closed or open and if the current ssh version? Using nmap command. Read man nmap page. The first, you have install nmap. For ubuntu $ sudo apt-get install nmap For centos $ sudo yum install nmap For example, checks for open/closed ports and current ssh version [huupv@huupv huuphan.com]$ sudo nmap -sV -p22 --version-all  localhost The output Checks for open/closed ssh ports using nmap command as below

Zimbra FOSS Two-Factor Authentication

Image
Two Factor Authentication for Zimbra Open Source edition. Look like Buy Now The work will consist of the following parts: A patch to the login screen to support entering the 2FA code. PrivacyIDEA and PrivacyIDEA LDAP Proxy docker containers to run and maintain the 2FA toekens on your Zimbra* Zimlet for integrating in the web-ui of Zimbra (SOAP based) with extension on the server (java soap api) Install documentation All released under GNU GPLv2. More details zimbra FOSS Two-Factor Authentication.

Leverage browser caching for Nginx

In this tutorial, How to configure Leverage browser caching for nginx. What does Leverage browser caching mean? Page load times can be significantly improved by asking visitors to save and reuse the files included in your website. Reduces page load times for repeat visitors Particularly effective on websites where users regularly re-visit the same areas of the website Benefit-cost ratio: high Access needed You should add that inside of an existing server block. For example, I will add that inside server block /etc/nginx/sites-enabled/default file. server {     listen       80;     server_name  localhost;     location / {         root   /usr/share/nginx/html;         index  index.html index.htm;     }         location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {             add_header Cache-Control "public, no-transform";             expires         7d;     } } You can test speed up site On GTmetrix