Home > Mobile >  Is there another way to use WSGIScriptAliasMatch for a Django app running through Apache / mod WSGI?
Is there another way to use WSGIScriptAliasMatch for a Django app running through Apache / mod WSGI?

Time:08-25

I'm running a Python 3.9/Django 3 app through Apache, connected through WSGI (4.9). Is WSGIScriptAliasMatch not supported any more in Apache? I had previously configured this in a virtual hosts file, /etc/apache2/sites-enabled/000-default-le-ssl.conf,

    WSGIScriptAliasMatch ^/api/(.*) /var/www/html/web/directory/wsgi.py/$1 process-group=ssl_directory

but now when I restart Apache or check its config, I get this error complaining about the above line

$ sudo apachectl configtest
AH00526: Syntax error on line 41 of /etc/apache2/sites-enabled/000-default-le-ssl.conf:
Invalid option to WSGI script alias definition.
Action 'configtest' failed.
The Apache error log may have more information.

Is there another way to write WSGIScriptAliasMatch?

CodePudding user response:

This occurred because my WSGI module got reset from version 4.9 to version 3.6, where "WSGIScriptAliasMatch" was not supported.

  • Related