getgrnam("root") failed

John Mccarthy lists at ruby-forum.com
Tue Apr 21 08:33:33 MSD 2009


Hi, I'm a deployment newbie and ran into an error in my nginx config
file (pasted below).  Any pointers are very much appreciated.  I am
setting up NGINX on Mac OS 10.5.6 to test before deploying a Rails app
on an AWS Ubuntu Hardy ami.  The error message is:

[emerg] 14296#0: getgrnam("root") failed in
/usr/local/nginx/conf/nginx.conf:1


My nginx.conf file looks like:

user  root root;
worker_processes  4;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

pid        /usr/local/nginx/logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local]
$request '
                      '"$status" $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /usr/local/nginx/logs/access.log  main;

    #sendfile        on;
    tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    gzip  on;
  gzip_http_version 1.0;
  gzip_comp_level 2;
  gzip_proxied any;
  gzip_disable "MSIE [1-6].(?!.*SV1)";
  gzip_types  text/plain text/html text/css application/x-javascript
        text/xml application/xml application/xml+rss text/javascript;

  include /etc/nginx/vhosts/*.conf;
}

-------------------------------------------------------------------------------


And my /etc/nginx/vhosts/site_name.conf looks like:

 # Load balance to mongrels
upstream mongrel_cluster1 {
  server 0.0.0.0:8040;
  server 0.0.0.0:8041;
  server 0.0.0.0:8042;
  server 0.0.0.0:8043;
  server 0.0.0.0:8044;
}

# Begin virtual host configuration
server {
    listen       80;
    server_name  localhost;
  root /Users/John/rails/site_name/public;
  client_max_body_size 50M;
    access_log  /usr/local/nginx/logs/site_name.access.log  main;
    error_page   500 502 503 504  /50x.html;

  # First rewrite rule for handling maintenance page
  if (-f $document_root/system/maintenance.html) {
    rewrite ^(.*)$ /system/maintenance.html last;
    break;
  }

    location / {
        index  index.html index.htm;

    # Forward info about the client and host
    # Otherwise Rails app won't have access to it.
    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_max_temp_file_size  0;

    # Directly serve static content
    location ~ ^/(images|javascripts|stylesheets)/ {
      expires 10y;
    }
    if (-f $request_filename) {
      break;
    }

    # Directly serve cached pages
    if (-f $request_filename.html) {
      rewrite (.*) $1.html break;
    }

    # Otherwise let Mongrel handle the request
    if (!-f $request_filename) {
      proxy_pass http://mongrel_cluster1;
      break;
    }
    }

}

-------------------------------------------------------------------------------

Also, if I define two mongrel clusters, can I configure with an extra
proxy_pass statement as follows?:

upstream mongrel_cluster1 {
  server 0.0.0.0:8040;
  server 0.0.0.0:8041;
  server 0.0.0.0:8042;

}
upstream mongrel_cluster2 {
  server 0.0.0.0:8050;
  server 0.0.0.0:8051;
  server 0.0.0.0:8052;

}

# Otherwise let Mongrel handle the request
    if (!-f $request_filename) {
      proxy_pass http://mongrel_cluster1;
                        proxy_pass http://mongrel_cluster2;
      break;
    }


Thank you!,
John
-- 
Posted via http://www.ruby-forum.com/.





More information about the nginx mailing list