[Mongrel] some questions about mongrel

Chris Hall christopher.k.hall at gmail.com
Mon Aug 7 09:30:24 EDT 2006


i posted some of these questions on the rails list, but thought that i
should probably post them here instead.

zed has already answered one of my questions, but i did have a couple more.

1) mongrel is not writing the pid file, which i have specified in the
config file

---
:cwd: /srv/www/railsapps/rftrack
:includes:
- mongrel
:log_file: log/mongrel.log
:config_script:
:pid_file: log/mongrel.pid
:num_processors: 1024
:environment: production
:group: webdev
:docroot: public
:user: mongrel
:timeout: 0
:host: 0.0.0.0
:mime_map:
:port: "3010"
:debug: false
:daemon: true


i start mongrel from within the application root as: mongrel_rails
start -C config/mongrel.yml

the mongrel.log file IS created and written to just fine.  all
directories in the app are group owned by 'webdev' and are group
writable and accessible.

2) i saw this in an earlier posting to the mailing list.  i switched
from apache2/fcgi to apache2/mongrel (with mod_proxy) on friday
morning.  apache2/mongrel is on a different server than the first
setup, basically a brand new install of the app.  everything ran fine
for the most part, except for a strange session issue which i am not
going to worry about unless it reappears.  i came in this morning and
all the rails apps i have running under apache2/mongrel would not
respond.  after looking into their respective apache logs, i saw the
following:

[Mon Aug 07 06:29:42 2006] [error] [client 10.200.14.187] proxy: error
reading status line from remote server localhost
[Mon Aug 07 06:29:42 2006] [error] [client 10.200.14.187] proxy: Error
reading from remote server returned by /
[Mon Aug 07 06:29:42 2006] [error] (111)Connection refused: proxy:
HTTP: attempt to connect to [::1]:3010 (localhost) failed
[Mon Aug 07 06:29:42 2006] [error] ap_proxy_connect_backend disabling
worker for (localhost)
[Mon Aug 07 06:29:42 2006] [error] proxy: HTTP: disabled connection
for (localhost)
[Mon Aug 07 06:29:42 2006] [error] proxy: HTTP: disabled connection
for (localhost)
[Mon Aug 07 06:30:29 2006] [error] proxy: HTTP: disabled connection
for (localhost)
[Mon Aug 07 06:30:29 2006] [error] proxy: HTTP: disabled connection
for (localhost)
[Mon Aug 07 06:30:31 2006] [error] proxy: HTTP: disabled connection
for (localhost)
[Mon Aug 07 06:30:31 2006] [error] proxy: HTTP: disabled connection
for (localhost)

each mongrel instance runs on it's own port, so this is the same for
each app, just a different port (3000, 3010 and 3020).

i had to kill each mongrel instance, restart them and then restart
apache.  everything seems ok now.

based on the previous conversation, only one of these applications has
anything to do with uploading and that app was never even accessed
apparently, except when it produced that error.

trying to access the apps directly, rather than via apache/proxy
exhibited the same behavior i n the browser (app would not render).

here is my basic apache/proxy setup, which is the same for each app.

<VirtualHost *:80>
        ServerAdmin root at localhost
        ServerName rftrack.[protected].com
        ServerAlias rftrack
        DocumentRoot /srv/www/railsapps/rftrack/public
        CustomLog /var/log/apache2/rftrack_access_log common
        ErrorLog /var/log/apache2/rftrack_error_log
        AddDefaultCharset utf-8
        <Directory /srv/www/railsapps/rftrack/public>
          Options -Indexes FollowSymLinks
          AllowOverride All
          Order allow,deny
          Allow from all
        </Directory>
        ProxyRequests Off
        ProxyPass / http://localhost:3010/
        ProxyPassReverse / http://localhost:3010/
        ProxyPreserveHost On
        RewriteEngine On
        RewriteRule "^(images|stylesheets|javascripts)/?(.*)" "$0" [L]
</VirtualHost>

i've seen mention of adding

SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1

hoever, the errors related to this 'fix' aren't the same errors i am
experiencing.

system info:

rails: 1.1.4
mongrel: 0.3.13.3
ruby 1.8.4
apache2 2.2.0

thanks for any/all help.

Chris


More information about the Mongrel-users mailing list