views:

101

answers:

1

Apache keeps serving up my Rails files with a Content-Type of 'text/plain' in the header. I have mod_mime installed, a mime.types files with all the correct MIME assignments, and the following code in my configuration. Any thoughts?

DefaultType text/plain

<IfModule mime_module>
    TypesConfig /etc/apache2/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
</IfModule>

Not sure if it's relevant, but here is the file in my sites-available folder:

<VirtualHost *:80>
  ServerName app.com
  ServerAlias www.app.com

  DocumentRoot /home/demo/public_html/app/public

  RewriteEngine On

  <Proxy balancer://mongrel1>
    BalancerMember http://127.0.0.1:5000
    BalancerMember http://127.0.0.1:5001
    BalancerMember http://127.0.0.1:5002
  </Proxy>

  # Redirect all non-static requests to thin
  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
  RewriteRule ^/(.*)$ balancer://mongrel1%{REQUEST_URI} [P,QSA,L]

  ProxyPass / balancer://mongrel1/
  ProxyPassReverse / balancer://mongrel1/
  ProxyPreserveHost on

  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>

  # Custom log file locations
  ErrorLog  /home/demo/public_html/app/log/error.log
  CustomLog /home/demo/public_html/app/log/access.log combined
</VirtualHost>

EDIT: I just created another Rails app from scratch, and the default Rails "Welcome aboard" page seems to be displaying correctly. I'm guessing this means something is messed up with my other Rails installation...

A: 

Grrr, looks like all I had to do was change

DefaultType text/plain

to

DefaultType text/html
NudeCanalTroll