How to install and use Nginx on CentOS 7 / RHEL 7

To install Nginx on CentOS 7 or RHEL 7, you can use the following steps: Add the Nginx repository to your system: sudo nano /etc/yum.repos.d/nginx.repo Paste the following configuration in the file and save it: [nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/7/$basearch/ gpgcheck=0 enabled=1 Install Nginx using the yum command: sudo yum install nginx Start Nginx service: sudo … Read more

How to install Spotify on Linux

To install Spotify on Linux, follow these steps: Add the Spotify repository to your system: sudo apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv-keys 931FF8E79F0876134EDDBDCCA87FF9DF48BF1C90 echo deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/spotify.list Update the package list: sudo apt-get update Install Spotify client: sudo apt-get install spotify-client Once the installation is complete, you can launch Spotify from … Read more

How to install PHP 7.2 on CentOS 7/RHEL 7

To install PHP 7.2 on CentOS 7/RHEL 7, follow these steps: Add the remi repository: sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm Enable the remi-php72 repository: sudo yum-config-manager –enable remi-php72 Install PHP 7.2 and its dependencies: sudo yum install php72 Verify the installation by checking the version of PHP: php -v This should display … Read more

How to configure Nginx with Let’s Encrypt on CentOS 7

To configure Nginx with Let’s Encrypt SSL certificate on CentOS 7, follow these steps: Install certbot: sudo yum install certbot Install the Nginx plugin for certbot: sudo yum install certbot-nginx Stop Nginx: sudo systemctl stop nginx Obtain a SSL certificate using certbot: sudo certbot –nginx certbot will run an SSL certificate check and automatically configure … Read more

How to set and use sudo password for Ansible Vault

Ansible Vault allows you to encrypt sensitive data such as passwords, certificates, and keys, so that they can be stored safely in version control. To set a sudo password for Ansible Vault, you need to use the ansible-vault command as follows: Create an encrypted file: ansible-vault create secret.yml Enter a password for the vault. Enter … Read more

How to install KVM on CentOS 7 / RHEL 7 Headless Server

To install KVM on a headless CentOS 7 / RHEL 7 server, follow these steps: Verify Hardware: Check if your hardware supports virtualization. Run the following command to check: egrep -c ‘(vmx|svm)’ /proc/cpuinfo If the output is greater than 0, your hardware supports virtualization. Install KVM and QEMU: sudo yum install qemu-kvm qemu-img virt-manager libvirt … Read more

How to add network bridge with nmcli (NetworkManager) on Linux

To add a network bridge using the nmcli command-line tool with the NetworkManager service in Linux, follow these steps: Install the NetworkManager command line tool: sudo yum install NetworkManager-cli or sudo apt-get install NetworkManager-cli Create a bridge interface: sudo nmcli connection add type bridge ifname <bridge_interface_name> con-name <connection_name> Replace <bridge_interface_name> with a unique name for … Read more

How to redirect standard (stderr) error in bash

You can redirect standard error (stderr) in bash to a file, or to another standard stream, such as standard output (stdout), using the following syntax: command 2> file.txt This will redirect the standard error stream from the “command” to the file “file.txt”. To redirect standard error to standard output, which can then be redirected to … Read more