1

Running CentOS 6.4, Apache 2.2.15, Django 1.5.

User nobody
Group nobody

LoadModule wsgi_module /usr/lib64/httpd/modules/mod_wsgi.so
LoadModule alias_module modules/mod_alias.so
LoadModule authz_host_module modules/mod_authz_host.so
WSGIDaemonProcess project python-path=/var/www/project/
WSGIScriptAlias / /path/to/wsgi.py
WSGISocketPrefix run/wsgi

ErrorLog logs/error_log

Listen 80

Alias /static/ /path/to/static/

<Directory /static>
        Satisfy Any
        Allow from all
</Directory>

<Directory /path/to/wsgi.py>
        <Files wsgi.py>
                Order deny,allow
                Allow from all
        </Files>
</Directory>

<Location ~ "/path/to/project/(css/*|images/*|style/*|js/*|)">
    Satisfy Any
    Allow from all
    AuthType None
    Require all granted
</Location>

I've read the following SO questions and repsonses, but I'm still getting the "stylesheet was not loaded because its MIME type, "text/plain", is not "text/css". My ref in the HTML file specifies "text/css":

Apache Config - Exclude Location from Authentication

css was not loaded because its MIME type, "text/html", is not "text/css". (I can't actually get this to work. I'm getting various Syntax Errors).

I'm at a loss as to what else to try. I am fathoming a guess that something in my httpd configuration file is incorrect, but what is it?

Community
  • 1
  • 1
circuitBurn
  • 893
  • 11
  • 24

1 Answers1

1

The error does not come from the HTML, but from Apache telling your client the file it is serving is of type text/plain (in the HTTP response headers). You need to tell Apache how to determine the mime type of the files it is serving.

You should add those directives to your httpd config (at the top after the other LoadModule directives should be fine):

LoadModule mime_module modules/mod_mime.so
TypesConfig /etc/mime.types

More details: http://httpd.apache.org/docs/2.2/mod/mod_mime.html#typesconfig

Nicolas Cortot
  • 6,591
  • 34
  • 44