Missing Apache2 Module mod_env in Ubuntu? Follow This…

So easy to fix but hard to find the solution. Hope this helps all you who are stuck with this. If your Apache server doesn’t start and you get an error message like this:

Failed to start apache :

* Starting web server apache2
Syntax error on line 63 of /etc/apache2/sites-enabled/mythweb.conf:
Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration
Action 'start' failed.
The Apache error log may have more information.

It means you need to enable Apache module mod_env.

A simple check for the module with sudo a2enmod at the command line might show the following available modules:

actions alias asis auth_basic auth_digest auth_kerb
authn_alias authn_anon authn_dbd authn_dbm authn_default
authn_file authnz_ldap authz_dbm authz_default
authz_groupfile authz_host authz_owner authz_user autoindex
cache cern_meta cgi cgid charset_lite dav dav_fs dav_lock dbd
deflate dir disk_cache dump_io env expires ext_filter fcgid
file_cache filter headers ident imagemap include info ldap
log_forensic mem_cache mime mime_magic mod-security negotiation
php5 proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp
proxy_http proxy_scgi reqtimeout rewrite setenvif speling ssl
status substitute suexec unique_id userdir usertrack vhost_alias

Tell me if you can spot mod_env. I couldn’t and a 30 minute journey through Google couldn’t show me how to install mod_env.so. I eventually found a German forum where someone used  ‘a2enmod env’. Guess what? ‘env’ is the name of the module needed.

When you need to enable mod_env, do it like this:

sudo a2enmod env

Then restart Apache with:

sudo service apache2 restart

My problem started after installing MythTV. Yours might start with Zend or something similar. Hope you found this page in your first search attempt. Please share and link back to JournalXtra to help others find this page quickly.

Sharing is caring!

Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Newest Most Voted
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x