• Home
  • About
  • Publications
  • Contact
  • Imprint
  •  

    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:

    1. Start yast (from the command line)
    2. Select “Network Services”
    3. Select “HTTP Server”
    4. Select “Server Modules”
    5. Select “Network Services”
    6. Scroll to “env”
    7. Select “Toggle Status”
    8. Select “Finish”

    Done.

    Related Posts:

    6 Responses to “Django Invalid command ‘SetEnv’ in OpenSUSE”

    1. andrew cooke says:

      thanks – that just saved me some time! :)

    2. Uwe says:

      Thanks a lot – one problem less!

    3. casualprogrammer says:

      Actually I ran into the very problem when trying to start Apache for the first time (openSUSE 11.3), not sure why this isn’t enabled by default.

      Anyway, thanks for the hint.

    4. [...] Modul env aktivieren (Hinweis) [...]

    5. John Stephen says:

      I just found this post incredibly useful, thank you!

    Leave a Reply

    WordPress SEO fine-tune by Meta SEO Pack from Poradnik Webmastera