Forum: Ruby on Rails RailsMachine + Mint

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9e7cdfa62c6bc2a155f2f7950484e573?d=identicon&s=25 Brandon S. (deniedlates)
on 2007-01-04 05:52
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 <script> tag in my page header.

Has anyone else successfully deployed Mint on RailsMachine?

Thanks,
Brandon
0158871402c1ecfa57952e8a379cfd10?d=identicon&s=25 Daniel Lucraft (Guest)
on 2007-01-04 17:47
> I can see the index page for Mint stats, but the count never updates
> even though I have the correct <script> tag in my page header.
>
> Has anyone else successfully deployed Mint on RailsMachine?

Yes, I have managed to get this working after a lot of aggro. First, I
followed the instructions in
http://nubyonrails.com/articles/2005/12/05/mint-st...,
in particular about the public/.htaccess file, but I still had problems.
(The index page was visible, but not through quite the right link, and
the counters never updated).

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 :) ...
  </Directory>
  ...
Given that the link to the script in your app pages is something like:

<script src="/mint/?js" type="text/javascript"></script>

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
0158871402c1ecfa57952e8a379cfd10?d=identicon&s=25 Daniel Lucraft (Guest)
on 2007-01-04 17:55
Daniel Lucraft 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 :) ...
>   </Directory>
>   ...

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
9e7cdfa62c6bc2a155f2f7950484e573?d=identicon&s=25 Brandon S. (deniedlates)
on 2007-01-04 20:43
Daniel Lucraft wrote:
> Daniel Lucraft 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 :) ...
>>   </Directory>
>>   ...
>
> 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
0158871402c1ecfa57952e8a379cfd10?d=identicon&s=25 Daniel Lucraft (Guest)
on 2007-01-04 21:01
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
  </Proxy>

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

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

Dan
9e7cdfa62c6bc2a155f2f7950484e573?d=identicon&s=25 Brandon S. (deniedlates)
on 2007-01-04 21:10
Daniel Lucraft 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
>   </Proxy>
>
> 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?
0158871402c1ecfa57952e8a379cfd10?d=identicon&s=25 Daniel Lucraft (Guest)
on 2007-01-04 23:43
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
9e7cdfa62c6bc2a155f2f7950484e573?d=identicon&s=25 Brandon S. (deniedlates)
on 2007-01-05 12:32
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>

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

  # Configure mongrel_cluster
  <Proxy balancer://my_rails_app_cluster>

    BalancerMember http://127.0.0.1:8000

  </Proxy>

  RewriteEngine On

  RewriteCond %{REQUEST_URI} ^/mint.*
  RewriteRule .* - [L]
9e7cdfa62c6bc2a155f2f7950484e573?d=identicon&s=25 Brandon S. (deniedlates)
on 2007-01-05 12:32
BTW... thanks again for the help Daniel!
This topic is locked and can not be replied to.