Where Is The “Welcome to Nginx!” Page Stored in a Docker Container?

Problem scenario
You installed Nginx in a Docker container on a RedHat Linux server.  You go to this container with a web browser and see the default screen.  Where is the default file (on the back-end) that users see from the front-end by default that says “Welcome to nginx!”?

Solution
This is the name and location of the file (assuming the Docker container was created via the public repository):

/usr/share/nginx/html/index.html

How Do You Determine which yum-config-manager Repos Can be Enabled?

Problem scenario
You want to see options for the yum-config-manager command. How do you find which repositories can be enabled for a Red Hat Enterprise Linux server?

Solution
Run this command: sudo yum repolist all

With the output on the left, you will need what is left of the “/” (forward slash) if one appears in a command like this: sudo yum-config-manager –enable rhui-REGION-rhel-server-rhscl

Let’s say you see this output below from the sudo yum repolist all command:

rhui-REGION-rhel-server-source-supplementary/7Server/x86_64 Red Hat Enterprise Linux Server 7 Supplementary (SRPMs) disabled

To use this output,

How Do You Use rpm to Remove a Repository You Installed?

Problem scenario
You accidentally used a command like this:
sudo rpm -ivh http://path/to…

You accidentally installed and configured a remote repository that you do not want to retrieve packages from. How do you use rpm to remove the configuration?

Solution
1. Run this command: cd /etc/yum.repos.d/
2. Delete the file that is there as a consequence of your “rpm” command.

How Do You Troubleshoot a Web Server in GCP Not Working via a Web Browser when Port 80 Is Not Blocked?

Problem scenario
From a web browser these commands succeed (where x.x.x.x is the external IP address of the Linux VM serving the web service):

Test-NetConnection -ComputerName x.x.x.x -Port 80
Test-NetConnection -ComputerName x.x.x.x -Port 443

But when you open a web browser and go to the x.x.x.x IP address, but the page does not load. You may get an error message about it timing out or not being reached or available.

How Do You Send a Multi-Line Email from the Command Prompt Using Mailx on a RHEL Server?

Problem scenario
You want to send more than one line of text as the body of an email. You want to use the command prompt of a RedHat Enterprise Linux server.

Solution
Prerequisites
You have installed mailx. If you need to do this, run this command: sudo yum -y install mailx

Procedures
1.

How Do You Troubleshoot The Error “yum-config-manager: command not found”?

Problem scenario
You are trying to use the “yum-config-manager” command. But you get this error:

“yum-config-manager: command not found”

How do you troubleshoot this error “-bash: yum-config-manager: command not found”?

Solution
Run this command: sudo yum -y install yum-utils

How Do You Find the Version of Java that is Installed on Your Windows Server?

Problem scenario
You want determine what version of Java is installed (if any). What do you do?

Solution
Open PowerShell and run this command:
(Get-WmiObject Win32_Product | Where {$_.Name -match “Java”}).Version

Alternative way without PowerShell:
1. Go to Control Panel -Uninstall a Program
2. See if Java is installed

How Should You Automate Linux Tasks with Python 2 vs Python 3?

Problem scenario
You have been given a task to automate tasks in Python. You were advised to never use “import os” in a previous position. You were told that this time speed is very important. What should you do?

Possible Solution #1
If you are doing basic file manipulations such as copying or moving files, or changing files’ permissions, you may want to looking into “import shutil”.

How Do You Get Oracle VirtualBox Guest Servers to Communicate with Each Other?

Problem scenario
You want to allow for TCP/IP connectivity between two VMs running Linux in Oracle VirtualBox. What do you do?

Solution
The network settings for the VMs should be as follows:

  • The “Attached to:” setting hould be “Host-only Adapter”
  • The “Adapter type:” setting should be “Paravirtualized Network”
  • The “Cable connected” option should be checked.