日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Nginx >内容正文

Nginx

puppet集群之 Nginx and Passenger

發(fā)布時間:2025/4/5 Nginx 62 豆豆
生活随笔 收集整理的這篇文章主要介紹了 puppet集群之 Nginx and Passenger 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

?環(huán)境:puppet-3.1 (由于puppet 3.x系列版本不支持mongrel)則使用Nginx and Passenger來做集群。

? ? ? centos 6.3

?

1.配置yum源,包括puppet?Nginx?Passenger

  • rpm?-ivh?epel-release-6-8.noarch.rpm?
  • #puppet源?
  • [root@test?puppet]#?cat?/etc/yum.repos.d/puppet.repo??
  • [puppet]?
  • name=Puppet?for?EL?$releasever?-?$basearch?
  • baseurl=http://yum.puppetlabs.com/el/6/products/$basearch?
  • enabled=1?
  • gpgcheck=1?
  • gpgkey=http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs?
  • #nginx?源?
  • [root@test?puppet]#?cat?/etc/yum.repos.d/nginx.repo??
  • [nginx]??
  • name=nginx?repo??
  • baseurl=http://nginx.org/packages/centos/$releasever/$basearch/??
  • gpgcheck=0??
  • enabled=1?
  • 配置Passenger源

  • #http://passenger.stealthymonkeys.com/?
  • RHEL?6?/?CentOS?6?/?ScientificLinux?6:?(note,?these?packages?depend?on?EPEL)?
  • rpm?--import?http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc?
  • yum?install?http://passenger.stealthymonkeys.com/rhel/6/passenger-release.noarch.rpm?
  • 安裝Puppet:

  • yum install -y ruby rubygems ruby-devel
  • yum?install?-y?puppet?puppet-server?
  • 安裝nginx:

  • yum?install?nginx?
  • 安裝nginx-passenger:

  • yum?install?nginx-passenger?
  • 配置Puppet 與passenger結合:

  • #?mkdir?-p?/etc/puppet/rack/public?
  • #?cp?/usr/share/puppet/ext/rack/files/config.ru?/etc/puppet/rack/?
  • #?chown?-R?puppet:puppet?/etc/puppet/rack/?
  • 創(chuàng)建nginx 配置文件?/etc/nginx/nginx.conf:

  • user??nginx;?
  • worker_processes??1;?
  • ?
  • error_log??/var/log/nginx/error.log?warn;?
  • pid????????/var/run/nginx.pid;?
  • ?
  • events?{?
  • ????worker_connections??1024;?
  • }?
  • ?
  • http?{?
  • ????include???????/etc/nginx/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??/var/log/nginx/access.log??main;?
  • ?
  • ????sendfile????????on;?
  • ????tcp_nopush??????on;?
  • ?
  • ????keepalive_timeout??65;?
  • ?
  • ????#?Passenger?needed?for?puppet?
  • ????passenger_max_pool_size?15;?
  • ?
  • ????include?/etc/nginx/conf.d/*.conf;?
  • }?
  • 確保passenger_root的路徑:

  • #?passenger-config?--root?
  • 檢查/etc/nginx/conf.d/passenger.conf
  • [root@test puppet]# cat /etc/nginx/conf.d/passenger.conf passenger_root /usr/lib/ruby/gems/1.8/gems/passenger-3.0.19; passenger_ruby /usr/bin/ruby;
  • 創(chuàng)建nginx puppet server 配置文件?/etc/nginx/conf.d/puppet.conf:

    ?

  • server?{?
  • ??listen?????????????????????8140?ssl;?
  • ??server_name????????????????puppet?puppet.example.com;?
  • ?
  • ??passenger_enabled??????????on;?
  • ??passenger_set_cgi_param????HTTP_X_CLIENT_DN?$ssl_client_s_dn;??
  • ??passenger_set_cgi_param????HTTP_X_CLIENT_VERIFY?$ssl_client_verify;??
  • ?
  • ??access_log?????????????????/var/log/nginx/puppet_access.log;?
  • ??error_log??????????????????/var/log/nginx/puppet_error.log;?
  • ?
  • ??root???????????????????????/etc/puppet/rack/public;?
  • ?
  • ??ssl_certificate????????????/var/lib/puppet/ssl/certs/client.domain.com.pem;?
  • ??ssl_certificate_key????????/var/lib/puppet/ssl/private_keys/client.domain.com.pem;?
  • ??ssl_crl????????????????????/var/lib/puppet/ssl/ca/ca_crl.pem;?
  • ??ssl_client_certificate?????/var/lib/puppet/ssl/ca/ca_crt.pem;?
  • ??ssl_ciphers????????????????SSLv2:-LOW:-EXPORT:RC4+RSA;?
  • ??ssl_prefer_server_ciphers??on;?
  • ??ssl_verify_client??????????optional;?
  • ??ssl_verify_depth???????????1;?
  • ??ssl_session_cache??????????shared:SSL:128m;?
  • ??ssl_session_timeout????????5m;?
  • }?
  • 注意下,我這里puppet?server的hostname? 具體的key路徑之類的?大家自己按各自的環(huán)境自己改?。

    修改文件/etc/puppet/puppet.conf:

  • [main]?
  • ?
  • [agent]?
  • ??server?=?puppet.example.com?
  • ?
  • [master]?
  • ??certname?=?puppet.example.com?
  • 關閉puppet master開機自動運行:

  • #?chkconfig?puppetmaster?off?
  • 配置nginx:
  • #?service?nginx?configtest?
  • #?chkconfig?nginx?on?
  • #?service?nginx?start?
  • ?

    ?

    轉(zhuǎn)載于:https://blog.51cto.com/1076468/1195371

    總結

    以上是生活随笔為你收集整理的puppet集群之 Nginx and Passenger的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。