[Mongrel] mongrel_cluster on FreeBSD

Redd Vinylene reddvinylene at gmail.com
Tue Jul 29 14:05:21 EDT 2008


hello, im attempting a mongrel_cluster + nginx + rails.

i've just installed mongrel_cluster on my FreeBSD server, but there
are no rc.d startup scripts so im not sure what to do..

this is how i plan to set up my mongrel cluster:

-

cd /usr/home/rv/myapp

mongrel_rails cluster::configure -e production -p 5000 -N 3 -c
/usr/home/rv/myapp -a 127.0.0.1 --user www --group www

mongrel_rails cluster::start

-

and this is my nginx.conf

user www www;

worker_processes 5;

events { worker_connections 1024; }

pid /var/run/nginx.pid;

http {

  sendfile on;

  upstream mongrel {

    server 127.0.0.1:5000;

    server 127.0.0.1:5001;

    server 127.0.0.1:5002;

  }

  server {

    listen 80;

    server_name myapp.com www.myapp.com;

    root /usr/home/rv/myapp/public;

    location / {

      proxy_set_header X-Real-IP $remote_addr;

      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

      proxy_set_header Host $http_host;

      proxy_redirect false;

      proxy_max_temp_file_size 0;

      if (-f $request_filename) {

        break;

      }

      if (-f $request_filename/index.html) {

        rewrite (.*) $1/index.html break;

      }

      if (-f $request_filename.html) {

        rewrite (.*) $1.html break;

      }

      if (!-f $request_filename) {

        proxy_pass http://mongrel;

        break;

      }

    }

    error_page 500 502 503 504 /500.html;

    location = /500.html {

      root /usr/home/rv/myapp/public;

    }

  }

}

-

i found this tutorial through google, but where's the actual script?

http://rubyforge.org/pipermail/mongrel-users/2006-August/000921.html

many thanks,
redd


More information about the Mongrel-users mailing list