How Do You Search the Logs of a Website that Is Not Functioning Properly?

Problem scenario
You have a website that is not working. You tried using Fiddler on the front-end. You want to examine the logs on the backend to find the problem. What should you do?

Possible Solution #1
Use a case insensitive grep for “error” or “violation”. Search also for patterns such as “40” and “50” in separate searches.

To get help finding the logs,

What is an Apache Web Server Container?

Problem scenario
You are reading about Apache Web Server containers. These are not related to Docker containers. You often see them near or tags. What are Apache Web Server containers?

Answer
They are portions of text that contain Apache web server configuration. (The source of this is https://httpd.apache.org/docs/2.4/sections.html.) The configuration includes directives often related to the VirtualHost in Apache web server.

What is a VirtualHost in Apache Web Server?

Problem scenario
You do not think that Apache web server does virtualization (like a hypervisor). But you see the term Virtual Host when you read about Apache web server configurations. What is a VirtualHost in the context of Apache web server?

Solution

“Apache Virtual Hosts A.K.A Virtual Host(Vhost) are used to run more than one web site(domain) using a single IP address.

How Do You Change the Apache Web Server Default Directory for a Website’s Files?

Problem scenario
You updated the Directory section of apache2.conf. You changed the DocumentRoot stanza in apache2.conf too. But when you browse to the website, you are not getting to the files in the directory you changed it to. You are getting files from /var/www/html/. Apache has been installed on Debian Linux. What do you do?

Solution

  1. Find this file: 000-default.conf
  2. Back it up.

Why Does a PHP Program Call to a Python Program Work from the Back-End but Not from the Front-End?

Problem scenario
In your PHP program, the Python binary is executing regardless of how the PHP program is run (e.g., from a command line with the php command or when downloaded from a web browser). The PHP program will launch Python programs if the PHP program is invoked from the back-end with PHP. But Python programs are not being interpreted by Python when a web browser loads the PHP file.

How Do You Get a PHP Program to Invoke a Python Program via Browsing a Website?

Problem scenario
You want Debian/Ubuntu Linux to support a website. You want a Python program to run every time a web page is downloaded. How do you get a PHP program to invoke a Python program on Debian/Ubuntu Linux?

Solution

Prerequisites
i. This assumes you have Apache2 and PHP installed. If you need assistance run this: sudo apt -y install apache2 php
ii.

How Do You Troubleshoot a Docker Container Supporting a Web Service That Web Browsers Cannot Seem to Reach?

Problem scenario
You have configured a Docker container with a web service (e.g., Apache web server or Nginx).  You configured the listening, external port to be 80 or a different port number.  You find the web server (either Apache or Nginx) is not working from a web browser.  How do you find what is wrong?

Solution
#1  Use nmap to test the port and IP address. 

How Do You Get Apache Web Server Configuration File Changes To Take Effect without Interrupting the Service?

Problem scenario
You want to change the main configuration file for Apache web server (e.g., httpd.conf). But you do not want to drop current web surfers viewing the website. How do you change a security module or listening port for an Apache web server and have the changes take effect without interrupting the service by doing a regular restart?

Solution
Use the “graceful” directive.

How Can Nginx Be an HTTP Load Balancer for Apache Web Servers?

Problem scenario
You have an Nginx server that you want to be a traffic distributor to Apache web servers.   What has to be done to configure Nginx’s HTTP load balancing function to relay inbound connection requests to Apache web servers?

Solution
Nothing special has to be done for the web servers.  Nginx can be a reverse proxy to either Nginx web servers or Apache web servers.