6、修改完nginx.conf文件以后,我们要启动nginx及puppet-server,这时应该如何操作呢?

  1)我们首先关闭puppetmaster进程,然后先启动nginx,不然nginx是会启动失败的,命令如下所示:


/usr/local/nginx/sbin/nginx


  nginx占用puppetmaster默认的8140端口后,我们可以用如下命令来检查8140端口是否被nginx接管,如下所示:


lsof -i:8140


  此命令显示结果表明8140被nginx进程接管,如下所示:


COMMAND    PID    USER     FD     TYPE DEVICE SIZE/OFF NODE NAME
nginx     4121    root        6u    IPv4    20668            0t0    TCP *:8140 (LISTEN)
nginx     4122    www    6u    IPv4    20668            0t0    TCP *:8140 (LISTEN)


  我们再启动puppetmaster,命令如下所示:


service puppetmaster start


  如果ruby版本为1.8.5的话,等会运行puppetmaster会有如下警告,如下所示:


Starting puppetmaster:
Port: 8141** Ruby version is not up-to-date; loading cgi_multipart_eof_fix

                                                                                                [        OK        ]
Port: 8142** Ruby version is not up-to-date; loading cgi_multipart_eof_fix

                                                                                                [        OK        ]
Port: 8143** Ruby version is not up-to-date; loading cgi_multipart_eof_fix

                                                                                                [        OK        ]
Port: 8144** Ruby version is not up-to-date; loading cgi_multipart_eof_fix

                                                                                                [        OK        ]
Port: 8145** Ruby version is not up-to-date; loading cgi_multipart_eof_fix

                                                                                                [        OK        ]

  这段警告值的意思为:

  It's just a warning. Mongrel wants a Ruby version of at least 1.8.6.

  But it still runs just fine with previous versions. Just ignore the warning.

  翻译为中文的意思是:

  Mongrel需要ruby至少是1.8.6以上的版本,但它仍然在当前版本运行,请忽咯当前警告,为了保证整个puppet运行环境的稳定,我这里选择还是沿用1.8.5版本的ruby,大家有任何疑问,欢迎交流。