12

I am looking into deploying a Django project on a shared server running Apache. This is my first time doing this. I have a shared folder on the server for my work and I have been added to the sudo group so I can install new software.

How do I check via Terminal command line if mod_wsgi is already installed? and preferably what version it is?

I can ssh onto the server, the version of Apache is

$ apache2 -v
Server version: Apache/2.2.22 (Ubuntu)
Server built:   Jul 12 2013 13:37:10
$ 

Any help is much appreciated.

EDIT:

Just for future reference, after I ran the command $ dpkg -s libapache2-mod-wsgi provided by Dirk Eschler it showed me that it was not installed. It returned

Package `libapache2-mod-wsgi' is not installed and no info is available.
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.

Hope this helps someone else.

Deepend
  • 4,057
  • 17
  • 60
  • 101

4 Answers4

17

To check if it is installed:

$ dpkg -s libapache2-mod-wsgi

In case it is installed, you might check if it's loaded by Apache:

$ apache2ctl -t -D DUMP_MODULES
Dirk Eschler
  • 2,539
  • 1
  • 21
  • 41
12

Though you are on Ubuntu.

This might help someone else on CentOS, Fedora or Red Hat

rpm -q mod_wsgi
Kudehinbu Oluwaponle
  • 1,045
  • 11
  • 11
  • this result `mod_wsgi-3.4-12.amzn2.0.2.x86_64` in my amazon ec2 linux 2 instance. But browser shows 403 forbidden error – alhelal Aug 20 '20 at 14:08
7

Since you're on Ubuntu, which is Debian-based, you can look in /etc/apache2/mods-enabled.

Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
  • Thanks man. great tip. At least I now know where it should appear when I have it installed. – Deepend May 27 '14 at 13:55
  • if ```mods-enabled``` exists, does this means mod_wsgi is installed? or the directory exists nevertheless? – sutan Jun 21 '22 at 17:07
1

if you working with python in Red Hat search this for mod_wsgi installed or not yum search python3-mod_wsgi

or search this for module is loaded or not rpm -q python3-mod_wsgi

Ronny Dsouza
  • 358
  • 2
  • 12