Я пытаюсь получить Ruby on Rails на сервере Windows 2003. Я установил службу Mongrel и Apache (и RoR и т. Д.).Apache + Mongrel Cluster = Неверная конфигурация сервера!
Когда я служу приложение, используя только Mongrel, все отлично.
Итак, теперь я дошел до конфигурации Apache ... Видимо, я не могу понять, что это правильно. Когда я нахожусь на своих страницах, я возвращаю правильный HTML, но он возвращается с контентом Content-Type в text/plain вместо html или xhtml ... Кроме того, если я попытаюсь добраться до одной из страниц css, я получить 500 Внутреннюю ошибку сервера (отсылается как HTML, возвращается с текстом/plain Content-Type).
Вот мой виртуальный хост-файл (Любая помощь будет ОЧЕНЬ ОЧЕНЬ ОЧЕНЬ признателен!):
NameVirtualHost *:8080
#Proxy balancer section (create one for each ruby app cluster)
<Proxy balancer://myapp_cluster>
Order allow,deny
Allow from all
BalancerMember http://rails.localdomain.com:3010
#BalancerMember http://myapp:3011
</Proxy>
#Virtual host section (create one for each ruby app you need to publish)
<VirtualHost *:8080>
ServerName rails.localdomain.com
DocumentRoot c:/www/app/public/
<Directory c:/www/app/public/ >
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ProxyRequests Off
ProxyPass/balancer://myapp_cluster
ProxyPassReverse/balancer://myapp_cluster
ProxyPreserveHost On
#SetOutputFilter INFLATE;DEFLATE
#SetOutputFilter proxy-html
#log files
ErrorLog c:/www/log/app_error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog c:/www/log/app_access.log combined
#Rewrite stuff
RewriteEngine On
# Check for maintenance file and redirect all requests
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [L]
# Rewrite index to check for static
RewriteRule ^/$ /index.html [QSA]
# Rewrite to check for Rails cached page
RewriteRule ^([^.]+)$ $1.html [QSA]
# Redirect all non-static requests to cluster
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://myapp_cluster%{REQUEST_URI} [P,QSA,L]
# Deflate
#AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css
#BrowserMatch ^Mozilla/4 gzip-only-text/html
#BrowserMatch ^Mozilla/4\.0[678] no-gzip
#BrowserMatch \\bMSIE !no-gzip !gzip-only-text/html
</VirtualHost>
О, и я могу изменить текст «DefaultType text/plain» на «DefaultType text/html» в файле httpd.conf и получить, чтобы мои HTML-страницы отображались правильно, но все остальное все еще встречается ... .. (плюс я не думаю, что это правильный путь). –
(И когда я говорю «все остальное», я имею в виду такие вещи, как мои страницы CSS и JS и т. Д.) –