How Do You Create a Certificate Signing Request (CSR) File and Set up an HTTPS Server for Basic Testing?

Problem scenarios
This is a two-in-one posting.  The same solution works for two different problem scenarios.

Problem scenario A
You want to create a certificate signing request permissions file (a csr.pem) to learn more about it.  You also want to try to use HTTPS as a test.  How do you do these things?

Problem scenario B
You want to implement a solution with TLS. 

How Do You Troubleshoot the Docker Error “User specified IP address is supported only when connecting to networks with user configured subnets.”?

Problem scenario
You are trying to create a Docker image and assign it an IP address with the –ip flag. But you get this error: “/usr/bin/docker-current: Error response from daemon: User specified IP address is supported only when connecting to networks with user configured subnets.”  How do you get your Docker command to work and resolve this problem?

Solution
#1  From the Linux server,

How Do You View Failed User Login Attempts to a PostgreSQL Instance?

Problem scenario
You are running a LAPP application on Ubuntu Linux with PostgreSQL.  A user has complained that she cannot log into your Postgres database via a LAPP application.  You are not sure if the attempts are even registering of if the user is entering an incorrect username.  How do you look at a log to see a history of unsuccessful attempts at logging into the Postgresql database?

Solution
Examine this file: /var/log/postgresql/postgresql-x.y-main.log

(Substitute x.y with the major and minor versions of PostgreSQL you are running e.g.,

How Do You Create an Option to Logout for a PHP Web Page to Destroy the Session?

Problem scenario
You have a LAMP (or LAPP) web page application.  The PHP code uses the session() functionality.  Once a user logs in successfully, he/she can browse to successive web pages.  You want to at least allow the user the opportunity to destroy the session (and terminate the authentication session).  How do you do this?

Solution
#1  Modify the .php file that you want to have the logout feature. 

How Do You Avoid Using the Root User When Doing Linux Administration?

Problem scenario
You’ve been given root credentials.  How do you create a new user and make it a sudoer so you can install and remove OS packages?

You know that it is best to use a non-root user for Linux administration. You have been given a root user.  How do you create a non-root user with full sudoer privileges?

Solution
This example assumes that the username is “mike.” 

How Do You Configure the LAPP Stack to Authenticate and Allow Subsequent Pages Navigable Based on the Original Authentication?

Problem scenario
You are deploying a LAPP (Linux, Apache, PostgreSQL, and PHP) stack. You want the authentication to be done via a Postgres database behind-the-scenes.  You can control the credentials from the back end this way.  You want the user to be able to click around in the application once logged in.  You want only one challenge for user login credentials.  

How do you create a PHP login page (i.e.,

How Do You Change a Firewall Rule in Google Cloud Platform?

Problem scenario
You want to create an exception to your GCP firewall to allow connectivity from a different workstation or server.  What should you do?

Solution
1.  In the upper right hand corner of the console, click the icon with three horizontal bars.  This is the “Products and Services” button.  Then go to “VPC Network” -“Firewall Rules.”

2.  Click “Create Firewall Rule.”

3. 

How Do You Deploy LAPP with Frontend User Authentication?

Problem scenario
You want a web page that asks for a username and password (e.g., to log in).  The users will not know if the authentication is done via Apache or Postgres.  You happen want the authentication to be challenged against a Postgres database.  This way if you have backend access to the Postgres database, you can use “CREATE ROLE” or “CREATE ROLE jane PASSWORD ‘veryfun’ LOGIN” to create users.  

How Do You Troubleshoot the Postgres Message “ERROR: permission denied to create database”?

Problem scenario
From a SQL front end you are connected to a Postgres database as user jdoe.  You try to create a database with the “create database verycool” SQL command.  You get this message: “ERROR: permission denied to create database.”

You try to enter the database from the back end, but you get ‘psql: FATAL: role “root” does not exist.’   Or you may even get the error “psql: FATAL: 

What Do You Do If You Run an Ansible Command and You Receive an Error “Failed to connect to the host via ssh: OpenSSH_6.6.1, OpenSSL 1.0.1e”?

Problem scenario
You run an Ansible command.  But you get an error like this:

” UNREACHABLE! => { “changed”: false, “msg”: “Failed to connect to the host via ssh: OpenSSH_6.6.1, OpenSSL 1.0.1e
-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 56:”

What should you do?

Solution
On the Ansible control server find the ansible.cfg file (find / -name ansible.cfg).  If you not using Mac OS, this stanza should not be in your ansible.cfg file:

[Sassy_Social_Share]