How Do You Solve the Problem with Apache Web Server That Says “Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}”?

Problem scenario
Your website is not working.  When you browse to the login page, the browser loads forever.  There seems to be a problem with the web server itself.

On the back end, you run this command from the operating system’s command line:
netstat -anlp | apache2

It produces output like this:


[Sun Aug 06 21:03:22.088579 2017] [core:warn] [pid 30144] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Sun Aug 06 21:03:22.088682 2017] [core:warn] [pid 30144] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Sun Aug 06 21:03:22.088697 2017] [core:warn] [pid 30144] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Sun Aug 06 21:03:22.088701 2017] [core:warn] [pid 30144] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Sun Aug 06 21:03:22.088712 2017] [core:warn] [pid 30144] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Sun Aug 06 21:03:22.099496 2017] [core:warn] [pid 30144] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Sun Aug 06 21:03:22.099764 2017] [core:warn] [pid 30144] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Sun Aug 06 21:03:22.099775 2017] [core:warn] [pid 30144] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}

What should you do to fix this?

How Do You Solve the Apache Web Server Problem That Says “AH00558: apache2: Could not reliably determine the server’s fully qualified domain name”?

Problem scenario
Your website is not working.  When you browse to the login page, the browser loads forever.  There seems to be a problem with the web server itself.

On the back end, you run this command from the operating system’s command line:
netstat -anlp | apache2

You see this as the result of this command:
“AH00558: apache2: Could not reliably determine the server’s fully qualified domain name,

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 Troubleshoot a 500 URL Return Code with a PHP Web Page That Is Using pg_connect?

Problem scenario
You have an Apache web server with PHP code.  You are trying to integrate web pages with Postgresql.  When browsing to a web page (.php), you are getting a 500 URL return code.  Your PHP web page file is using the reserved command “pg_connect.”  How do you overcome this 500 URL return code error and have the web page work?

Solution
Possible solution #1:  Reboot the web server.

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 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 Get PHP to Have a Separate Line for an Input Field in a Submit Form?

Problem scenario
In a PHP “submit form” you have various fields.  Two of the fields are on the same row.  That is, when you open the page with a web browser, two input box fields are the same distance from the top and bottom of the page.  You want each field to be on its own line.  How do you do you get the PHP form to render the way you want?

How Do You Have PHP Return an Informative Error Message When a SQL Command Returns No Results?

Problem scenario
You have a PHP web page that integrates with Postgres behind the scenes.  You find that when a SQL command returns nothing (e.g., when a table name is used and it is known to not exist in the underlying database), the PHP web page is blank.  You want the result to be more clear about what happened or potentially happened.  How do you handle an exception or commonly occurring SQL query with no results using PHP?  

How Do You Install Npm and/or node.js on a AWS Instance of RHEL?

Problem scenario
Using a RHEL server in AWS, you try this command “npm -v”, and it shows that npm is not installed.  You want to use the npm utility or you want Node.js to be installed on your RedHat version 7 Linux server in AWS.  You may have tried various yum commands but received errors about dependencies.  Various other scripts fail to get npm to be a recognized command.  How do you install npm and/or Node.js without changing yum repositories and without using the wget command?