It's also possible to store snippets of HTML in files, and then print the contents of those file to stdout using the cat command.When an HTTP request is received, several environment variables are set by the web server and passed on to the script.People use them to monitor temperatures, voltages, weather conditions, and all sorts of other things.Once you've collected data, you need some way to display it.
One particularly important environment variable is QUERY_STRING, which holds arguments that are passed to scripts.
Before we can use Python scripts in Apache, we need to update its settings.
By default Python is configured to only execute scripts with specific endings such as
CGI scripts are usually stored in /usr/lib/cgi-bin, and they must have executable permission.
Scripts execute when they are requested by a browser.