skip to Main Content

I have a VPS server with CentOS 7. I have on it two PHP websites working OK on several VirtualHosts and now I want to deploy a Django (Python3) project, so I need mod_wsgi module.

If I do systemctl status httpd I get this response get this response so Apache is installed and running (and serving my PHP websites).

But if I do yum install mod_wsgi CentOS tell me that I need to install httpd package. If I install the httpd package, then the PHP not works and can’t start httpd service anymore.

If I execute whereis httpd I get httpd: /opt/apache/bin/httpd /opt/ferozo/bin/httpd

2

Answers


  1. Chosen as BEST ANSWER

    I get it solved without reinstalling entire httpd.

    1. Update server using yum update -y
    2. Install Python3.6 following this steps
    3. Download manually, compile and install mod_wsgi module following this steps important note: in my case I have to indicate manually the path of Apache and Python when do ./configure
    4. Then edit httpd.conf to load mod_wsgi.so module
    5. Restart Apache service with systemctl restart httpd and now Apache is running with mod_wsgi module enabled!

  2. Take backup before doing this. (I am not responsible for any data loss)

    You will have to copy your config files to /etc/httpd after doing the following commands. You will have to setup everything again.

    First remove the version of apache you are using.

    You will have to reinstall apache using:

    yum install httpd
    

    And then install mod_wsgi using:

    yum install mod_wsgi
    

    And to install PHP:

    yum install php
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search