nginx +乘客的木偶服务器500错误

时间:2015-11-13 03:08:57

标签: passenger puppet

当我运行puppet client命令时,得到500错误。我在下面的puppet主服务器中找到了调试日志: (nginx版本:1.8.0,使用passenger-install-nginx-module安装乘客)

来自应用程序的消息:启动Web应用程序时发生错误。它宣传了一个Unix域套接字,其拥有者与预期不同(应该是UID 0,但实际UID是52)

乘客错误html原始输出:

An error occurred while starting the web application. It advertised a Unix domain socket that has a different owner than expected (should be UID 0, but actual UID was 52)
Raw process output:

(empty)
Error ID
178719de
Application root
/etc/puppet/rack/allinone_02
Environment (value of RAILS_ENV, RACK_ENV, WSGI_ENV, NODE_ENV and PASSENGER_APP_ENV)
production
Ruby interpreter command
/usr/bin/ruby
User and groups
uid=0(root) gid=0(root) groups=0(root)

General Ruby interpreter information
RUBY_VERSION = 1.8.7
RUBY_PLATFORM = x86_64-linux
RUBY_ENGINE = nil
RubyGems version = 1.3.7
RubyGems paths = ["/root/.gem/ruby/1.8", "/usr/lib/ruby/gems/1.8"]
Ruby configuration (RbConfig::CONFIG)
datarootdir = /usr/share
DLLWRAP = 
setup = Setup
OBJDUMP = 
TRY_LINK = 
LIBRUBY_LDSHARED = gcc -shared
SHELL = /bin/sh
sitearch = x86_64-linux
datadir = /usr/share
ARCH_FLAG = 
debugflags = 
vendordir = /usr/lib/ruby
LDFLAGS = -L.  -rdynamic -Wl,-export-dynamic
ASFLAGS = 
DLEXT = so
build_alias = x86_64-redhat-linux-gnu
LIBPATHENV = LD_LIBRARY_PATH
docdir = /usr/share/doc/$(PACKAGE)
ARCHFILE = 
TEENY = 7
LIBRUBYARG = -lruby
topdir = /usr/lib64/ruby/1.8/x86_64-linux
archdir = /usr/lib64/ruby/1.8/x86_64-linux
libdir = /usr/lib64
target_os = linux
CP = cp
PACKAGE_NAME = 
CPPFLAGS =   
build = x86_64-redhat-linux-gnu
INSTALL_DATA = /usr/bin/install -c -m 644
sitedir = /usr/lib/ruby/site_ruby
PACKAGE_TARNAME = 
libexecdir = /usr/libexec
AR = ar
MINOR = 8
CPPOUTFILE = -o conftest.i
sitelibdir = /usr/lib/ruby/site_ruby/1.8
psdir = /usr/share/doc/$(PACKAGE)
OUTFLAG = -o 
SOLIBS = -lpthread -lrt -ldl -lcrypt -lm 
target_vendor = redhat
configure_args =  '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-default-kcode=none' '--enable-shared' '--enable-pthread' '--disable-rpath' '--with-readline-include=/usr/include/readline5' '--with-readline-lib=/usr/lib64/readline5' '--enable-dtrace' '--with-sitedir=/usr/lib/ruby/site_ruby' '--with-sitearchdir=/usr/lib64/ruby/site_ruby' '--with-vendordir=/usr/lib/ruby' '--with-vendorarchdir=/usr/lib64/ruby' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'target_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing'
NM = 
target = x86_64-redhat-linux-gnu
prefix = /usr
LIBRUBY_SO = libruby.so.1.8.7
sbindir = /usr/sbin
ruby_mm_version = 1.8
DTRACE_HEADER = dtrace.h
vendorlibdir = /usr/lib/ruby/1.8
PACKAGE_BUGREPORT = 
ECHO_C = 
EXTSTATIC = 
exec_prefix = /usr
DEFS = 
LIBRUBYARG_SHARED = -lruby
sysconfdir = /etc
DLDFLAGS = 
EXEEXT = 
rubyw_install_name = 
RANLIB = ranlib
SET_MAKE = 
PATH_SEPARATOR = :
EXTOUT = .ext
RM = rm -f
target_alias = x86_64-redhat-linux-gnu
RUBY_INSTALL_NAME = ruby
MAJOR = 1
LIBRUBYARG_STATIC = -lruby-static
target_cpu = x86_64
INSTALL_SCRIPT = /usr/bin/install -c
RUBY_SO_NAME = ruby
cppflags = 
localedir = /usr/share/locale
MAINLIBS = 
host = x86_64-redhat-linux-gnu
PREP = miniruby
sharedstatedir = /var/lib
NROFF = /usr/bin/nroff
STATIC = 
LIBPATHFLAG =  -L%s
vendorarchdir = /usr/lib64/ruby/1.8/x86_64-linux
AS = as
OBJEXT = o
includedir = /usr/include
htmldir = /usr/share/doc/$(PACKAGE)
EXPORT_PREFIX = 
rubylibdir = /usr/lib/ruby/1.8
CFLAGS = -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing  -fPIC  
host_vendor = redhat
MAKEFILES = Makefile
PACKAGE_VERSION = 
RDOCTARGET = 
INSTALL_PROGRAM = /usr/bin/install -c
EGREP = /bin/grep -E
WINDRES = 
DLDLIBS =  -lc
GNU_LD = yes
build_vendor = redhat
PACKAGE_STRING = 
INSTALL = /usr/bin/install -c
ALLOCA = 
optflags = 
host_os = linux-gnu
localstatedir = /var
host_alias = x86_64-redhat-linux-gnu
YFLAGS = 
COMMON_LIBS = 
ruby_version = 1.8
oldincludedir = /usr/include
LIBRUBY = libruby.so.1.8.7
LIBS = -lpthread -lrt -ldl -lcrypt -lm 
dvidir = /usr/share/doc/$(PACKAGE)
pdfdir = /usr/share/doc/$(PACKAGE)
STRIP = strip -S -x
sitearchdir = /usr/lib64/ruby/site_ruby/1.8/x86_64-linux
ENABLE_SHARED = yes
LIBRUBY_A = libruby-static.a
mandir = /usr/share/man
MAKEDIRS = mkdir -p
CPP = gcc -E
MANTYPE = doc
arch = x86_64-linux
COMMON_MACROS = 
GREP = /bin/grep
LIBRUBY_ALIASES = libruby.so.1.8 libruby.so
RUBYW_INSTALL_NAME = 
build_cpu = x86_64
ECHO_T = 
bindir = /usr/bin
PATCHLEVEL = 352
LINK_SO = 
ECHO_N = -n
DLEXT2 = 
COMMON_HEADERS = 
LIBEXT = a
DESTDIR = 
ruby_install_name = ruby
CC = gcc
LDSHARED = gcc -shared
build_os = linux-gnu
LIBRUBY_DLDFLAGS = -Wl,-soname,libruby.so.1.8
infodir = /usr/share/info
cflags =  
RPATHFLAG = 
CCDLFLAGS =  -fPIC
LN_S = ln -s
host_cpu = x86_64
YACC = bison -y
Ruby load path ($LOAD_PATH)
/usr/lib/ruby/site_ruby/1.8
/usr/lib64/ruby/site_ruby/1.8
/usr/lib64/ruby/site_ruby/1.8/x86_64-linux
/usr/lib/ruby/site_ruby
/usr/lib64/ruby/site_ruby
/usr/lib64/site_ruby/1.8
/usr/lib64/site_ruby/1.8/x86_64-linux
/usr/lib64/site_ruby
/usr/lib/ruby/1.8
/usr/lib64/ruby/1.8
/usr/lib64/ruby/1.8/x86_64-linux

id puppet
uid=52(puppet) gid=52(puppet) groups=52(puppet)

the ps info:
puppet   22573  1.0  0.0 140756 49276 ?        S    11:00   0:01 Passenger AppPreloader: /etc/puppet/rack/allinone_02  

我想知道为什么Passenger AppPreloader以puppet而不是root开头。 如何将自己更改为root。

1 个答案:

答案 0 :(得分:0)

我想通过将以下配置添加到config.ru

来解决这个问题
ARGV << "--rundir"  << "/var/run/puppet"

现在一切正常