Invalid command 'WSGIScriptAlias', perhaps misspelled or defined by a module not included in the server configurationAction 'configtest' failed
Asked Answered
R

5

53

I got the below error while I was configuring CKAN DataPusher.

Invalid command 'WSGIScriptAlias', perhaps misspelled or defined by a module not included in the server configurationAction 'configtest' failed.

How can I fix this?

Raynata answered 17/12, 2013 at 6:21 Comment(0)
R
106

Try to enable wsgi mod in Apache

sudo a2enmod wsgi

If you come across below error

ERROR: Module mod-wsgi does not exist!

You will have to install mod wsgi as below. What you have to do is run the following commands,

sudo apt-get install libapache2-mod-wsgi
sudo a2enmod wsgi
sudo service apache2 restart
Raynata answered 17/12, 2013 at 6:21 Comment(2)
At first it didn't work, but using apt-get update --fix-missing updated the packages and i could then install.Foreland
Thanks for this. I had to install libapache2-mod-wsgi-py3 to get this working with python3Saving
L
7

To enable wsgi_mod in httpd, install the module

sudo yum install mod_wsgi

and make sure to load the module in the httpd config file

sudo nano /etc/httpd/conf/httpd.conf

then add the following line in the config file, to the list of other loaded module:

LoadModule wsgi_module modules/mod_wsgi.so
Louise answered 3/4, 2019 at 21:6 Comment(2)
I am using windows OS, how can I fix this?Pelagias
Sorry friend, I can't help you. I hope someone else will post an answer to your question. Good luck!Louise
S
5

I had this error after messing up my Apache installation and restarting the setup after an apt purge apache2. This also seems to have removed the wsgi mod but Ubuntu 20 LTS kept thinking it's still around.

So I had to to purge and reinstall the wsgi mod from scratch:

apt purge -y libapache2-mod-wsgi-py3
apt install -y libapache2-mod-wsgi-py3
a2enmod wsgi

After that, Apache was able to find it again.

Starlike answered 5/5, 2021 at 4:12 Comment(0)
B
3

I faced this problem because

  1. I installed mod_wsgi which was compatible with python3.5, but my project's virtual environment was using python3.7. So, mod_wsgi for 3.7 was required. I installed that as well (python3.7 -m pip install mod_wsgi). But a configuration was missing from apache2 which resulted in this issue.

  2. run : mod_wsgi-express module-config
    add the output in /etc/apache2/apache.conf ( LoadModule wsgi_module "/home/user/.local/lib/python3.7/site-packages/mod_wsgi/server/mod_wsgi-py37.cpython-37m-x86_64-linux-gnu.so" WSGIPythonHome "/usr" )

    then restart - sudo service apache2 restart

This solved the problem.

Brufsky answered 21/1, 2021 at 17:42 Comment(0)
C
0

I think you might need to add this line in your apache2.conf

LoadModule wsgi_module "/usr/local/lib/python3.6/dist-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so"

Below command will give you the above output

mod_wsgi-express module-config
Ce answered 19/9, 2019 at 6:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.