How to enable mod_mime on apache2

1

I am running apache2 on debian 6. I am wondering how do I enable mod_mime? according to an Answer here, I need mod_mime loaded so that my webserver can load .css files. Current Modules I have loaded Are:

$ sudo apache2ctl -M
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
Loaded Modules:
 core_module (static)
 log_config_module (static)
 logio_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 alias_module (shared)
 auth_basic_module (shared)
 authn_file_module (shared)
 authz_default_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cgi_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 mime_module (shared)
 mime_magic_module (shared)
 negotiation_module (shared)
 php5_module (shared)
 reqtimeout_module (shared)
 setenvif_module (shared)
 status_module (shared)
Syntax OK

when I try sudo a2enmod mod_mime I get ERROR: Module mode_mime does not exist!

Richard

Posted 2013-02-18T16:49:55.440

Reputation: 741

Answers

2

Try this instead

sudo a2enmod mime

The mod_ prefix is implicitly added.

a2enmod will look for /etc/apache2/mods-available/MODULENAME.load where MODULENAME is the name you supplied as an argument.

The file would then be symlinked to /etc/apache2/mods-enabled/MODULENAME.load.

If you look at the contents of that file, it should say:

LoadModule mime_module /usr/lib/apache2/modules/mod_mime.so

This tells us that the mod_mime.so library will later be loaded as mime_module.

Der Hochstapler

Posted 2013-02-18T16:49:55.440

Reputation: 77 228

hmmm, says it is already enabled. mod_mime obviously must be the same as mime_module – Richard – 2013-02-18T16:59:43.873

@Richard: You're correct. I added additional information to my answer. – Der Hochstapler – 2013-02-18T17:04:23.447

Thanks for your help. Do you know how I setup apache to load .css files. I added lines AddType text/css .css and AddType text/javascript .js to apache.conf, however style sheets are still not loading. – Richard – 2013-02-18T17:13:33.370

@Richard: I don't really understand the linked question. Apache shouldn't really care about the type of the file. The settings regarding mod_mime affect what Apache will tell the client what type the file is. Please feel free to post an additional question outlining your original problem. Maybe we can find a solution :) – Der Hochstapler – 2013-02-18T17:21:10.487