# Mongrel\_cluster on FreeBSD

**URL:** <https://www.ruby-forum.com/t/mongrel-cluster-on-freebsd/144452>\
**Category:** Mongrel\
**Created:** [July 29, 2008, 8:10pm UTC](https://www.ruby-forum.com/t/mongrel-cluster-on-freebsd/144452 "2008-07-29T20:10:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![reddvinylene](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/4af34b/32.png) [@reddvinylene](https://www.ruby-forum.com/u/reddvinylene)\
**Post date:** [July 29, 2008, 8:10pm UTC](https://www.ruby-forum.com/t/mongrel-cluster-on-freebsd/144452/1 "2008-07-29T20:10:46Z")

</div>

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](http://rubyforge.org/pipermail/mongrel-users/2006-August/000921.html)

many thanks,  
redd

---

<div class="post-metadata">

**Author:** ![reddvinylene](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/4af34b/32.png) [@reddvinylene](https://www.ruby-forum.com/u/reddvinylene)\
**Post date:** [July 29, 2008, 8:11pm UTC](https://www.ruby-forum.com/t/mongrel-cluster-on-freebsd/144452/2 "2008-07-29T20:11:57Z")

</div>

Turns out there’s a FreeBSD port which takes care of all this,  
/usr/ports/www/rubygem-mongrel\_cluster!

Thanks!
