【发布时间】:2011-03-04 12:29:47
【问题描述】:
Apache 一直在提供我的 Rails 文件,其标题中的 Content-Type 为“text/plain”。我安装了 mod_mime、一个 mime.types 文件,其中包含所有正确的 MIME 分配,以及我的配置中的以下代码。有什么想法吗?
DefaultType text/plain
<IfModule mime_module>
TypesConfig /etc/apache2/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
</IfModule>
不确定是否相关,但这是我的站点可用文件夹中的文件:
<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>
编辑:我刚刚从头开始创建了另一个 Rails 应用程序,默认的 Rails“欢迎加入”页面似乎正确显示。我猜这意味着我的其他 Rails 安装出了点问题……
【问题讨论】:
-
提供哪些 Rails 文件?您的公共文件夹中的那些?
-
是的,DocumentRoot 设置为 /home/demo/public_html/app/public
标签: ruby-on-rails apache content-type mime mime-types