Django Invalid command ‘SetEnv’ in OpenSUSE
Today I came upon a problem when I wanted to integrate a Django project into my Apache via mod_python on my OpenSUSE virtual server.
I put the snippet I need for Django into a separate config file called django.conf into the folder /etc/apache2/conf.d/ from which all files are automatically loaded whenever Apache starts.
Everytime I wanted to start my Apache it said
Syntax error on line 6 of /etc/apache2/conf.d/django.conf:
Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration
This seems to be a problem with the Apache configuration of OpenSUSE as mod_env which provides the SetEnv directive is installed but disabled.
Solution:
- Start yast (from the command line)
- Select “Network Services”
- Select “HTTP Server”
- Select “Server Modules”
- Select “Network Services”
- Scroll to “env”
- Select “Toggle Status”
- Select “Finish”
Done.






thanks – that just saved me some time!
Thanks a lot – one problem less!
[...] http://johannesluderschmidt.de/lang/en-us/django-invalid-command-setenv-in-opensuse/291/ http://docs.djangoproject.com/en/1.0/howto/deployment/modpython/ http://fosswire.com/post/2008/5/installing-mod_python-and-django-on-apache/ [...]