You may like:

How to Install Django Python Framework on CentOS 8

Step 1 – Prerequisites

Login to the CentOS 8 server console via SSH. Then must have python installed on our system. Use the following commands to install python as its dependencies on your system.

Step 2 – Install mod_wsgi Module

Before starting, you will need to install some prerequisite Apache components in order to work with mod_wsgi. You can install all the required components by simply running the following command: Restart Apache service to get mod_wsgi to work.

Step 3 – Configure Apache for WSGI

Next, create a python script to serve via the mod_wsgi Apache module. For testing, I have created a file under the default document root. And added the following content:

After that, configure the Apache server to serve this file over the web. Let’s create a configuration file to serve the script over a sub URL. Add the following content: After completing the above steps enable mod-wsgi configuration and restart Apache service.

Step 4 – Testing

The setup is ready now. You can test the script by accessing the following URL in a web browser. Change your-server-ip with the actual server IP or hostname. You will see the results as below:

How to Install Apache mod wsgi Module on CentOS 8   TecAdmin - 37