# Mongrel 1.0.3

**URL:** <https://www.ruby-forum.com/t/mongrel-1-0-3/118486>\
**Category:** Mongrel\
**Created:** [October 27, 2007, 6:07pm UTC](https://www.ruby-forum.com/t/mongrel-1-0-3/118486 "2007-10-27T18:07:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexanderl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@alexanderl](https://www.ruby-forum.com/u/alexanderl)\
**Post date:** [October 27, 2007, 6:07pm UTC](https://www.ruby-forum.com/t/mongrel-1-0-3/118486/1 "2007-10-27T18:07:26Z")

</div>

Hello!

# /usr/local/bin/ruby18 /usr/local/bin/mongrel\_rails start -d -e

development -a 10.164.28.7 -c /var/www/data/site/ --user root --group  
wheel -p 8080 -P log/mongrel.8080.pid -l log/mongrel.8080.log

Mongrel 1.0.1:

\*\* Starting Mongrel listening at 10.164.28.7:8080  
^^^^^^^^^^^^^^^^  
\*\* Changing group to wheel.  
\*\* Changing user to root.  
\*\* Starting Rails with development environment…  
\*\* Rails loaded.  
\*\* Loading any Rails specific GemPlugins  
\*\* Signals ready. TERM =\> stop. USR2 =\> restart. INT =\> stop (no  
restart).  
\*\* Rails signals registered. HUP =\> reload (without restart). It might  
not work well.  
\*\* Mongrel available at 10.164.28.7:8080  
\*\* Writing PID file to log/mongrel.8080.pid

Mongrel 1.0.3:

\*\* Starting Mongrel listening at :8080  
^^^^^ ???  
\*\* Starting Rails with development environment…  
\*\* Rails loaded.  
\*\* Loading any Rails specific GemPlugins  
\*\* Signals ready. TERM =\> stop. USR2 =\> restart. INT =\> stop (no  
restart).  
\*\* Rails signals registered. HUP =\> reload (without restart). It might  
not work well.  
\*\* Mongrel available at 10.164.28.7:8080  
\*\* Writing PID file to log/mongrel.8080.pid

–  
WBR

---

<div class="post-metadata">

**Author:** ![alexanderl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@alexanderl](https://www.ruby-forum.com/u/alexanderl)\
**Post date:** [October 27, 2007, 7:24pm UTC](https://www.ruby-forum.com/t/mongrel-1-0-3/118486/2 "2007-10-27T19:24:42Z")

</div>

On 10/27/07, Alexander L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> \*\* Starting Rails with development environment…  
> ^^^^^ ???  
> \*\* Starting Rails with development environment…  
> \*\* Rails loaded.  
> \*\* Loading any Rails specific GemPlugins  
> \*\* Signals ready. TERM =\> stop. USR2 =\> restart. INT =\> stop (no restart).  
> \*\* Rails signals registered. HUP =\> reload (without restart). It might not work well.  
> \*\* Mongrel available at 10.164.28.7:8080  
> \*\* Writing PID file to log/mongrel.8080.pid

It seems is not handling the IP binding…

Could you try the following in a IRB console?

require ‘rubygems’  
require ‘mongrel’  
s = Mongrel::HttpServer.new(“127.0.0.1”, 8081)  
puts “Host: #{s.host}, Port: #{s.port}”

It’s using a TCPServer inside, so it should work, unless mongrel\_rails  
is doing something else with the address (host) passed by.

## – Luis L. Multimedia systems

Leaders are made, they are not born. They are made by hard effort,  
which is the price which all of us must pay to achieve any goal that  
is worthwhile.  
Vince Lombardi

---

<div class="post-metadata">

**Author:** ![alexanderl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@alexanderl](https://www.ruby-forum.com/u/alexanderl)\
**Post date:** [October 27, 2007, 7:29pm UTC](https://www.ruby-forum.com/t/mongrel-1-0-3/118486/3 "2007-10-27T19:29:24Z")

</div>

On 10/27/07, Luis L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> It’s using a TCPServer inside, so it should work, unless mongrel\_rails  
> is doing something else with the address (host) passed by.

Also, you indicate was using FreeBSD, there is a exception for HTTP  
handling in Mongrel::HttpServer#configure\_socket\_options

Maybe that is affecting the result? wasn’t present in 1.0.1 AFAIK.

## – Luis L. Multimedia systems

Leaders are made, they are not born. They are made by hard effort,  
which is the price which all of us must pay to achieve any goal that  
is worthwhile.  
Vince Lombardi

---

<div class="post-metadata">

**Author:** ![alexanderl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@alexanderl](https://www.ruby-forum.com/u/alexanderl)\
**Post date:** [October 27, 2007, 7:59pm UTC](https://www.ruby-forum.com/t/mongrel-1-0-3/118486/4 "2007-10-27T19:59:13Z")

</div>

Regarding the listening port, there was a bug in bin/mongrel\_rails. I  
fixed it in trunk, and I’ll backport it to 1.0.4 in a day or so,  
giving time for more bugs to come in. Patch is below.

> Also, you indicate was using FreeBSD, there is a exception for HTTP  
> handling in Mongrel::HttpServer#configure\_socket\_options

I think is the correct triage for the IP6 bug. Not having FreeBSD,  
maybe someone else can figure what it’s supposed to be?

Not many people were using the RC’s except the team; in the future  
we’ll just continue to push point releases.

Evan

* * *

# Index: bin/mongrel\_rails

— bin/mongrel\_rails (revision 806)  
+++ bin/mongrel\_rails (revision 807)  
@@ -174,15 +178,14 @@

```
 def config_keys
   @config_keys ||=

```

- 

```
   %w(host port cwd log_file pid_file environment docroot

```

mime\_map daemon debug includes config\_script

- 

```
      num_processors timeout throttle user group prefix)

```

- 

```
   %w(address host port cwd log_file pid_file environment

```

docroot mime\_map daemon debug includes config\_script num\_processors  
timeout throttle user group prefix)  
end

```
 def settings
   config_keys.inject({}) do |hash, key|
     value = self.instance_variable_get("@#{key}")
     key = 'host' if key == 'address'

```

- 

```
   hash[key.to_sym] = value

```

- 

```
   hash[key.to_sym] ||= value
   hash
 end

```

end

---

<div class="post-metadata">

**Author:** ![alexanderl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@alexanderl](https://www.ruby-forum.com/u/alexanderl)\
**Post date:** [October 27, 2007, 7:59pm UTC](https://www.ruby-forum.com/t/mongrel-1-0-3/118486/5 "2007-10-27T19:59:13Z")

</div>

The FreeBSD code is as so:

```
  when /freebsd/
    # Use the HTTP accept filter if available.
    # The struct made by pack() is defined in

```

/usr/include/sys/socket.h as accept\_filter\_arg  
unless `/sbin/sysctl -nq net.inet.accf.http`.empty?  
$tcp\_defer\_accept\_opts = [Socket::SOL\_SOCKET,  
Socket::SO\_ACCEPTFILTER, [‘httpready’, nil].pack(‘a16a240’)]  
end

Something there must be IP6 specific.

Evan

---

<div class="post-metadata">

**Author:** ![alexanderl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@alexanderl](https://www.ruby-forum.com/u/alexanderl)\
**Post date:** [October 28, 2007, 2:28am UTC](https://www.ruby-forum.com/t/mongrel-1-0-3/118486/6 "2007-10-28T02:28:57Z")

</div>

Hello.

> Regarding the listening port, there was a bug in bin/mongrel\_rails. I  
> fixed it in trunk, and I’ll backport it to 1.0.4 in a day or so,  
> giving time for more bugs to come in. Patch is below.  
> It works, thanks! BTW:

# mongrel\_rails --version

Mongrel Web Server 1.0.2  
^^^^^

> > Also, you indicate was using FreeBSD, there is a exception for HTTP  
> > handling in Mongrel::HttpServer#configure\_socket\_options  
> > I think is the correct triage for the IP6 bug. Not having FreeBSD,  
> > maybe someone else can figure what it’s supposed to be?  
> > I’ll watch on this today.

–  
WBR

---

<div class="post-metadata">

**Author:** ![alexanderl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@alexanderl](https://www.ruby-forum.com/u/alexanderl)\
**Post date:** [October 28, 2007, 6:28am UTC](https://www.ruby-forum.com/t/mongrel-1-0-3/118486/7 "2007-10-28T06:28:26Z")

</div>

Yeah, the version string was hardcoded here and there, which I missed.  
We’ll fix this for 1.1, possibly for 1.0.4.

Thanks

Evan

---

<div class="post-metadata">

**Author:** ![alexanderl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@alexanderl](https://www.ruby-forum.com/u/alexanderl)\
**Post date:** [October 28, 2007, 2:31am UTC](https://www.ruby-forum.com/t/mongrel-1-0-3/118486/8 "2007-10-28T02:31:52Z")

</div>

Hello, Luis.

> > \*\* Starting Rails with development environment…  
> > \*\* Rails loaded.  
> > \*\* Loading any Rails specific GemPlugins  
> > \*\* Signals ready. TERM =\> stop. USR2 =\> restart. INT =\> stop (no restart).  
> > \*\* Rails signals registered. HUP =\> reload (without restart). It might not work well.  
> > \*\* Mongrel available at 10.164.28.7:8080  
> > \*\* Writing PID file to log/mongrel.8080.pid  
> > It seems is not handling the IP binding…  
> > Could you try the following in a IRB console?

> require ‘rubygems’  
> require ‘mongrel’  
> s = Mongrel::HttpServer.new(“127.0.0.1”, 8081)  
> puts “Host: #{s.host}, Port: #{s.port}”

> It’s using a TCPServer inside, so it should work, unless mongrel\_rails  
> is doing something else with the address (host) passed by.

Here is:

> > require ‘rubygems’  
> > =\> []
> 
> > require ‘mongrel’  
> > =\> []
> 
> > s = Mongrel::HttpServer.new(“127.0.0.1”, 8081)  
> > =\> #\<Mongrel::HttpServer:0x2a0ddad4 @num\_processors=1073741823,  
> > @timeout=0, @socket=#TCPServer:0x2a0dd9d0, @port=8081,  
> > @workers=#ThreadGroup:0x2a0dd980, @classifier={}, @host=“127.0.0.1”,  
> > @death\_time=60\>
> 
> > puts “Host: #{s.host}, Port: #{s.port}”  
> > Host: 127.0.0.1, Port: 8081  
> > =\> nil

–  
WBR
