ubuntu20.04にapache2とMod_wsgi

$ Mod_wsgi on
$ sudo apt install apache2 apache2-utils ssl-cert libapache2-mod-wsgi
$ sudo systemctl restart apache2
$ sudo mkdir -p /var/www/scripts
$ sudo vi /var/www/scripts/test_wsgi_script.py

def application(environ, start_response):
	status = '200 ok'
	html = '<html>\n' \
			'<body>\n' \
			'hello, mod_wsgi is working\n' \
			'</body>\n' \
			'</html>\n'
	response_header = [('Content-type', 'text/html')]
	start_response(status, response_header)
	return

$ sudo vi /etc/apache2/conf-available/mod-wsgi.conf

WSGIScriptAlias /test_wsgi /var/www/scripts/test_wsgi_script.py

$ sudo a2enconf mod-wsgi
$ sudo systemctl restart apache2
http://192.168.33.10/test_wsgi