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.

How Do You View the Images That Are Part of Your WordPress Website?

Problem scenario
You are using WordPress, and you want to view the images of your website. You forget where a specific picture/photo (e.g., a JPEG or PNG file is). What should you do?

Solution
1. Log into the WordPress dashboard.
2. Go to Media -Library
3. Find the drop down menu that says “All media items” and choose “Images”

How Do You Get Python to Parse Web Pages to Find a String?

Problem scenario
You know a string is buried in a series of web pages. How do you get Python to read the web pages and find the string?

Solution
Change the URLs as you desire. Change the “searchterm” variable assignment to the word of your choice. Then run this Python 3 program:

import re
import requests
listofurls = [‘https://www.continualintegration.com/’, ‘https://www.continualintegration.com/miscellaneous-articles/page/1/’, …

How Do You Hyperlink to Specific Paragraphs (Not the Top) of a WordPress Article?

Problem scenario
You are using WordPress. You have a posting that is long, and you want a link to a paragraph at about halfway down in it. How do you create a hyperlink to a specific paragraph of a WordPress article?

Solution

  1. In your web UI editor for WordPress, click on the three vertically-stacked dots in the upper right-hand corner.

How Do You Modify Vertical Blocks of Text on a WordPress Web Page?

Problem scenario
There are vertical blocks of text that are common to every posting of your WordPress site. (Or you want to add advertisement banners to your website.) How do you modify the text in those?

Solution

  1. Log into the WordPress web UI
  2. Go to “Dashboard”
  3. Click on “Manage widgets” or “Appearance” (either will work)
  4. To the left of “Available Widgets”,

What Are Some Ways to Prevent MITM Attacks or Other Session Exploitative Attacks with a Web Page That Uses JavaScript?

Problem scenario
You know that sessions of a JavaScript can be exploited in today’s world. This category of vulnerability is related to imperfections in authentication and is listed as the #2 biggest web application security risk as of June of 2020 (according to OWASP). What are some techniques to stop such attacks from happening when designing a website that uses JavaScript?

Possible Solution #1
Ensure cookie information is passed using connections that leverage HTTPS (as paraphrased from page 23 of Node.js Security by Liran Tal).

How Do You Install and Configure OWASP ZAP?

Problem scenario
You want to install OWASP ZAP (aka Open Web Application Security Project’s Zed Attack Proxy). You want to test it out. How do you do this on Linux?

Solution
Note: It is advisable to only install ZAP on OSes that have JREs that have up-to-date patches with regular maintenance. If you need assistance installing the JRE, see this posting.