index.html , python.cgi を作成
index.html
<!DOCTYPE html>
<html>
<head><meta charset="utf-8" /></head>
<h1>web_app</h1>
<form action="python.cgi" method="POST">
<input type="submit" name="submit" value="送信">
</form>
</body>
</html>
python.cgi
#!/opt/alt/python37/bin/python3
import sys
import io
sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8')
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8')
str = "<a href=" + "'" + "index.html" + "'" + ">戻る</a>"
print("Content-type: text/html; charset=utf-8\n")
print("<html>")
print("<body>")
print("<h1>web_app_out</h1>")
print(str)
print("</body>")
print("</html>")