Where Are the apt-get Repo Configuration Files for a Debian/Ubuntu Linux Server?

Problem scenario
You run an apt-get command, and you get an error about a .deb file’s source not being found.  For example you try to run an apt-get command to install a package, but you are blocked by this error:
“E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/postgresql-9.5/libpq-dev_9.5.6-0ubuntu0.16.04_amd64.deb  404  Not Found [IP:…”

An updated version for the deb file may have superseded the older version.  Or the repository server’s hostname may have changed or its IP address has changed. 

How Do You Fix the Problem “Unable to locate package php-pgsql”?

Problem scenario
You are trying to integrate PHP and Postgresql on you Ubuntu/Debian Linux OS.  You run this command:  sudo apt-get -y install ​php-pgsql

You receive this error:

Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package ​php-pgsql

What should you do?

Solution
#1  Find out what version of php you have. 

How Do You Troubleshoot This Error “…docker.sock: read:: connection reset by peer”?

Problem scenario
You have Docker installed.  When running “docker ps” you get this error:  “An error occurred trying to connect: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json: read unix @->/var/run/docker.sock: read: connection reset by peer”

How do you fix this error so you can use Docker?

Solution
Just because Docker was installed does not mean that the kernel of your OS is supported.  Docker may not work despite being installed. 

How Do You Troubleshoot a PHP Page Showing the Raw Code in a Web Browser?

Problem scenario
You created a PHP web page, but it is not rendering correctly in a web browser.  You see the raw PHP code or text.  What do you do to get the PHP to display correctly as a web UI (and not raw code and uninterpreted text)?

Solution
Possible solution #1
Install PHP.  For assistance with installing it on a Debian/Ubuntu server,

How Do You Set up Nginx to Be a Reverse Proxy That Conveys Inbound Connections to the Web Server with the Fewest Active Connections?

Problem scenario
You want your website to perform well.  By default Nginx’s load balancing system uses the round-robin technique.  You want available yet under-utilized web servers to handle inbound connection requests (aka someone using a web browser to go to a web page).  Individual users can put a disparate load on a given Nginx instance.  Some website users will spend a significant amount of time on a web page.  Others will invoke various application features that will require more resources than others. 

How Do You Use the C++ Connector for Libpqxx?

Problem scenario
You want to integrate C++ programs with Postgresql on an Ubuntu instance of AWS.  You want to use pqxx (http://pqxx.org/development/libpqxx/) as it is an API connector for C++ to Postgres.  How do you use libqxx?

Solution
#1  Install Postgresql.  To install Postgresql, run this as root or with a “sudo ” in front of it: apt-get install postgresql

#2  To execute SQL commands,

How Do You Install pqxx on an AWS Instance of Ubuntu?

Problem scenario
You try to compile a C++ program (i.e., a .cpp file).  You get this message:  “fatal error:  pqxx/pqxx: No such file or directory.”  You want to install pqxx on your Ubuntu server in AWS.  What do you do?

Solution
#1  Log into the server.  Run this command as root or with a sudo in front it:

add-apt-repository ppa:jtv/ppa 
#Press enter in response to the prompt from the command above.

How Do You Find the Version of Postgres without Running a SQL Command?

Problem scenario
To find the version of Postgres when you can enter the SQL database, you would run this SQL command with no quotes: “SELECT version();”

In this situation you cannot enter the Postgres database (and therefore can run no SQL commands).  You want to know more about the installation of Postgres to troubleshoot why you cannot enter it.  How do you find the version of Postgresql that is installed?

How Do You Install Docker on an AWS Instance of Ubuntu?

Problem scenario
You want to install Docker on an AWS instance of Ubuntu.  But you do not know how.  How can you quickly do this?

Solution
Run these two commands:
sudo apt-get -y update
sudo apt -y install docker.io

An alternative set of directions is here.  For a variety of different directions for all different types of Linux,