RailsMachine + Mint

Hi,

I just deployed my first Rails app at railsmachine.com (highly
recommended; check out their five-minute deployment guide.) After
installing PHP on my Rails Machine (and passing the Mint compatibility
test), I still cannot get Mint to work.

I can see the index page for Mint stats, but the count never updates
even though I have the correct tag in my page header.

Has anyone else successfully deployed Mint on RailsMachine?

Thanks,
Brandon

I can see the index page for Mint stats, but the count never updates
even though I have the correct

this allows Apache to translate /mint/?js into /mint/index.php?js
(this is my understanding anyway).

(highly recommended; check out their five-minute deployment guide.)

+1

Daniel L. wrote:

I’m not sure if this problem corresponds to yours but the key for me was
to add the following to my application’s httpd conf file inside the
VirtualHost:

<Directory /path_to_app/public/mint>
DirectoryIndex index.php
… other Directory options, fairly standard ones but
not eager to reveal all of server configuration :slight_smile:

Let me clarify that a little. Make the change in
/etc/httpd/conf/apps/app_name.conf, inside the VirtualHost declaration
in that file.

best,
Dan

Daniel L. wrote:

Daniel L. wrote:

I’m not sure if this problem corresponds to yours but the key for me was
to add the following to my application’s httpd conf file inside the
VirtualHost:

<Directory /path_to_app/public/mint>
DirectoryIndex index.php
… other Directory options, fairly standard ones but
not eager to reveal all of server configuration :slight_smile:

Let me clarify that a little. Make the change in
/etc/httpd/conf/apps/app_name.conf, inside the VirtualHost declaration
in that file.

best,
Dan

Daniel,

Thanks for the guidance…

I am still having a few issues. I updated the public/.htaccess file and
added the DirectoryIndex to my app’s httpd conf file. When I go to
mint/ in the browser window, Rails is still processing “mint” as a
controller. But if I go to mint/index.php, I see the stats page (with
zero stats.)

Do you still have to access your stats by going to mint/index.php, or
does mint/ work for you? Also did you have to edit any of the mint
configuration files to get it to work?

Thanks again for your help…

Brandon

Brandon S. wrote:

I am still having a few issues. I updated the public/.htaccess file and
added the DirectoryIndex to my app’s httpd conf file. When I go to
mint/ in the browser window, Rails is still processing “mint” as a
controller. But if I go to mint/index.php, I see the stats page (with
zero stats.)

I also have a ProxyPass directive to make the Proxy part look like (same
conf file):

ProxyPass /mint !
<Proxy balancer://appname_cluster>
BalancerMember http://127.0.0.1:8000

And added the line:
RewriteCond %{REQUEST_URI} ^/mint.*

before all the other Rewrite… directives (but after RewriteEngine On).

Dan

Daniel L. wrote:

Brandon S. wrote:

I am still having a few issues. I updated the public/.htaccess file and
added the DirectoryIndex to my app’s httpd conf file. When I go to
mint/ in the browser window, Rails is still processing “mint” as a
controller. But if I go to mint/index.php, I see the stats page (with
zero stats.)

I also have a ProxyPass directive to make the Proxy part look like (same
conf file):

ProxyPass /mint !
<Proxy balancer://appname_cluster>
BalancerMember http://127.0.0.1:8000

And added the line:
RewriteCond %{REQUEST_URI} ^/mint.*

before all the other Rewrite… directives (but after RewriteEngine On).

Dan

Daniel,

This is what the beginning of my public/.htaccess file looks like:

General Apache options

AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

If you don’t want Rails to look in certain directories,

use the following rewrite rules so that Apache won’t rewrite certain

requests

Example:

RewriteCond %{REQUEST_URI} ^/notrails.*

RewriteRule .* - [L]

RewriteCond %{REQUEST_URI} ^/mint.*
RewriteRule .* - [L]

Redirect all requests not available on the filesystem to Rails

By default the cgi dispatcher is used which is very slow

For better performance replace the dispatcher with the fastcgi one

Example:

RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

RewriteEngine On

Is the ProxyPass directive also required to make this work? Or is that
optional?

Daniel figured this one out… I made changes to my app’s .conf file
(/etc/conf/apps/my_rails_app.conf) and now I am running Mint on
RailsMachine.

Here is an exerpt from my .conf file:

DocumentRoot /var/www/apps/my_rails_app/current/public

<Directory /var/www/apps/my_rails_app/current/public>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all

<Directory /var/www/apps/my_rails_app/current/public/mint>
DirectoryIndex index.php

Configure mongrel_cluster

<Proxy balancer://my_rails_app_cluster>

BalancerMember http://127.0.0.1:8000

RewriteEngine On

RewriteCond %{REQUEST_URI} ^/mint.*
RewriteRule .* - [L]

Brandon S. wrote:

This is what the beginning of my public/.htaccess file looks like:

Hmmm, I actually don’t think that the public/.htaccess file does
anything, since mongrel doesn’t use it anyway. Could be wrong.

Is the ProxyPass directive also required to make this work? Or is that
optional?

I’m fairly sure you need this since mongrel wouldn’t know what to do
with the Mint PHP, so we have to make sure that Apache doesn’t proxy it
on. I’m really fumbling in the dark here.

My email is dan at fluentradical dot com Get in touch and I’ll show you
my config.

Dan

BTW… thanks again for the help Daniel!