How Do You Use the ip_hash Directive in Nginx Running in Docker and Be Able to Stop and Start the Docker Container Again?

Problem scenario
You are using Nginx as a reverse proxy (a server that is essentially a landing page that is invisible to users and passes connection requests to other web servers like a router).  You noticed that when you added the “ip_hash;” directive in the “upstream server {}” section (also known as a block) of the /etc/nginx/conf.d/default.conf file, you lose the Docker container.  That is if you stop the Docker container once the Nginx default.conf file has this “ip_hash;” directive,

How Do You Set up Nginx as an HTTP Load Balancer So Client Requests (from Web Browsers) Do Not Go to Nginx Servers That Have Failed Several Times in Recent Attempts?

Problem scenario
To improve performance of your HTTP load balancing mechanism, you want to configure how failed members of the load balancer are dealt with. Some Nginx instances may fail in your environment. You do not want attempts to send web traffic to these instances immediately after several failures.  How do you granularly keep track of failed attempts and remove the instance from the distribution algorithm after a certain limit has been reach to improve performance by attempting only more reliable instances?

How Do You Deploy Several Docker Containers with Nginx and Have Each of Them Work Simultaneously on a Single RedHat Server?

Problem scenario
You want to create several Docker containers each supporting Nginx.  You want to be able to browse to the different instances of Nginx from a web browser.  How do you have multiple Docker containers support Nginx on one RedHat Enterprise Linux host server?

Solution
These directions are geared toward a RHEL host server instance in AWS.

#1 Install Docker.

How Do You Have Text Fields That Have Hints (Suggested Text)?

Problem scenario
You are using PHP files (with HTML).  You have text fields that are blank by default.  These fields accept user input from the keyboard.  You want the clear text fields to have suggested text by default (to help explain to the user the type of input that is appropriate or to remind the user of content restrictions).  How do you do this?

You have a field that requests text like this HTML code (in a .php file):

<html>

How Do You Install Octopus Deploy server to a Windows 2016 Server?

Problem scenario
You want to install Octuopus Deploy (e.g., with the 45 free trial) to an AWS instance of Windows Server 2016.  How do you do this?

Solution
This is a simple deployment of Octopus Deploy server for testing or evaluation purposes.  Literally any AWS flavor will work as only 512 MB of RAM is needed for Octopus Deploy server to work for minimal evaluation.

How Do You Deploy JetBrains TeamCity to an AWS Windows Server 2016?

Problem scenario
You want to deploy TeamCity to an AWS instance running Windows Server 2016.  How do you do this?

Solution
This is a simple deployment of TeamCity server for testing or evaluation purposes. The flavor of server will depend on the way you use TeamCity server.  For a basic deployment, one processor and 1 GB of RAM is sufficient.  This is far from enough CPU and memory for any “real” usage of TeamCity.

How Do You Run a SQL Query to Identify the Primary Key of a Table in a PostgreSQL Database?

Problem scenario
You are using PostgreSQL and currently administering a database you inherited from a different company.  You want to determine the primary key of a given table.  How do you identify the primary key of a table?

Solution
Modify the query below so you replace “contint” with the name of the table you are interested in.  The result of this SQL query will be the primary key of that table.

How Do You Create a Primary Key in a PostgreSQL Table That Already Exists?

Problem scenario
You have a table that you would like to have a primary key.  You would like to add a new column to be the primary key.  How do you do this?

Solution
Here is a SQL command that is an illustration.  Assuming the table’s name is “contint” and the new column you want to add is “continual_col” with a value type of integer,

How Do You Troubleshoot the Ansible Message ‘Error while linking: [Errno 2] No such file or directory … “state”: “absent”‘?

Problem scenario
You are using the file module in Ansible.  But you get the error ‘Error while linking: [Errno 2] No such file or directory … “state”: “absent”‘.

What should you do?

Solution
Some people get this problem with different versions of Ansible 2.x.  It is documented on this external page.

Rewrite your Ansible playbook so it uses a “shell” module and some “ln -s” command.

How Do You Solve This SQL Problem When You Receive the Message “ERROR: Syntax Error at or Near”?

Problem scenario
You are trying to update a SQL table with a SQL statement (using the “UPDATE” keyword).  You keep getting “ERROR:  syntax error at or near” with a reference of the value you are trying to give to a cell in a row in a SQL table.  You verified you have no extra commas, apostrophes, or semicolons in your SQL UPDATE statement.  You verified that the columns exist in the table and are spelled correctly in your UPDATE statement.