puppet使用 apache passsenger 作为前端 (centos)
概要
使用 nginx + passenger 作为puppet master 的前端
nginx + passenger 配置
package 安装
通过 gem 的方式来安装 passenger,
# gem install rake rack passenger --no-rdoc --no-ri
安装完成之后, nginx 不能直接从 yum 的源来安装, 用下面的命令来安装,
这样安装的 nginx 中就包含了 passenger 模块.
root@master-2:~# passenger-install-nginx-module
# 根据提示完成安装, 中途可能会提示用 apt-get 安装一些缺失的包.
# 安装完缺失的包后, 再次执行 passenger-install-nginx-module 即可.
# 安装 nginx 之前, 会有如下选择
Do you want this installer to download, compile and install Nginx for you?
1. Yes: download, compile and install Nginx for me. (recommended)
The easiest way to get started. A stock Nginx 1.6.2 with Passenger
support, but with no other additional third party modules, will be
installed for you to a directory of your choice.
2. No: I want to customize my Nginx installation. (for advanced users)
Choose this if you want to compile Nginx with more third party modules
besides Passenger, or if you need to pass additional options to Nginx's
'configure' script. This installer will 1) ask you for the location of
the Nginx source code, 2) run the 'configure' script according to your
instructions, and 3) run 'make install'.
Whichever you choose, if you already have an existing Nginx configuration file,
then it will be preserved.
Enter your choice (1 or 2) or press Ctrl-C to abort: 1
# 根据情况, 如果熟悉的话, 可以选择2, 否则选择1 即可自动编译安装 nginx
配置文件设置
nginx 配置文件 nginx.conf
# cat /etc/nginx/conf/nginx.conf
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
passenger_root /usr/lib/ruby/gems/1.8/gems/passenger-4.0.57;
passenger_ruby /usr/bin/ruby;
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 logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
include /etc/nginx/conf.d/*.conf;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
nginx中作为puppet前端的配置.
# cat /etc/nginx/conf.d/puppetserver.conf
server {
listen 8140 ssl;
server_name puppet-server puppet-server.yunji.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 /usr/share/puppet/rack/puppetmasterd/public;
ssl_certificate /var/lib/puppet/ssl/certs/puppet-server.yunji.com.pem;
ssl_certificate_key /var/lib/puppet/ssl/private_keys/puppet-server.yunji.com.pem;
ssl_crl /var/lib/puppet/ssl/ca/ca_crl.pem;
ssl_client_certificate /var/lib/puppet/ssl/certs/ca.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;
}
rack 目录生成
centos 不像 debian, 没有自动生成 puppetmasterd 的 rack 目录.
[root@puppet-server ~]# cd /usr/share/puppet
[root@puppet-server puppet]# mkdir -p rack/puppetmasterd/public
[root@puppet-server puppet]# mkdir -p rack/puppetmasterd/tmp
[root@puppet-server puppet]# cp ext/rack/config.ru rack/puppetmasterd/
[root@puppet-server puppet]# chown puppet:puppet rack/puppetmasterd/config.ru
puppet使用 apache passsenger 作为前端 (centos)的更多相关文章
- puppet使用 apache passsenger 作为前端 (debian)
目录 1. 概要 2. nginx + passenger 配置 2.1. package 安装 2.2. 配置文件设置 2.3. 测试配置结果 2.4. 参考网址 概要 之前做过 apache + ...
- puppet 和 apache passenger的配置
目录 1. 概要 2. apache passenger 安装测试 2.1. 什么是 apache passenger 2.2. 安装 apache passenger 2.3. 配置 apache ...
- Install LAMP Server (Apache, MariaDB, PHP) On CentOS/RHEL/Scientific Linux 7
Install LAMP Server (Apache, MariaDB, PHP) On CentOS/RHEL/Scientific Linux 7 By SK - August 12, 201 ...
- How To Install Apache Tomcat 7 on CentOS 7 via Yum
摘自:https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-7-on-centos-7-via-y ...
- apache 安装配置 (centos)
1. 使用yum包安装Apache软件 [root@Apache ~]# yum -y install httpd* [root@Apache ~]# rpm -qa | grep httpd --查 ...
- How To Set Up Apache Virtual Hosts on CentOS 6
About Virtual Hosts 虚拟主机,用于在一个单一IP地址上,运行多个域.这对那些想在一个VPS上,运行多个网站的人,尤其有用.基于用户访问的不同网站,给访问者显示不同的信息.没有限制能 ...
- Linux搭建apache +PHP(CentOS系统)
1.安装MySQL bash # sudo yum install mysql-server (下载mysql) bash # service mysqld start (开启mysql服务) ba ...
- CentOS 6.5环境下使用HAProxy+apache实现web服务的动静分离
HAProxy提供高可用性.负载均衡以及基于TCP和HTTP应用的代理,支持虚拟主机,它是免费.快速并且可靠的一种解决方案.HAProxy特别适用于那些负载特大的web站点,这些站点通常又需要会话保持 ...
- CentOS 7 Apache服务的安装与配置
原文出处:http://blog.51cto.com/13525470/2070375 一.Apache简介 Apache 是一个知名的开源Web服务器.早期的Apache服务器由Apache Gro ...
随机推荐
- Linux命令-设置免密码登录
设置免密码登陆:[root@Redis01 test]# cd /install/[root@Redis01 install]# rm -rf test/[root@Redis01 install]# ...
- [转]rancher 初步
本文转自:https://blog.csdn.net/weixin_41709748/article/details/81515780 什么是 rancher Rancher是一个开源的企业级全栈化容 ...
- 【转载】ASP.NET自定义404和500错误页面
在ASP.NET网站项目实际上线运行的过程中,有时候在运行环境下会出现400错误或者500错误,这些错误默认的页面都不友好,比较简单单调,其实我们可以自行设置这些错误所对应的页面,让这些错误跳转到我们 ...
- 服务器文档下载zip格式
刚好这次项目中遇到了这个东西,就来弄一下,挺简单的,但是前台调用的时候弄错了,浪费了大半天的时间,本人也是菜鸟一枚.开始吧.(MVC的) @using Rattan.Core.Utility;@{ s ...
- ASP.NET MVC 学习笔记-5.Controller与View的数据传递
ViewData属性 ViewData属性是System.Web.Mvc.ControllerBase中的一个属性,它相当于一个数据字典.Controller中向该字典写入数据,ViewData[“K ...
- java_自定义标签运行原理
一.自定义标签运行原理: 二.文字说明 1.IE->web服务器 2.Web服务器->jsp 3.遇到自定义标签,首先实例化标签所对应的标签处理器类 4.调用setPageContext方 ...
- 【Java每日一题】20170209
20170208问题解析请点击今日问题下方的“[Java每日一题]20170209”查看(问题解析在公众号首发,公众号ID:weknow619) package Feb2017; public cla ...
- markdown基础入门
一.标题 语法:# 文字 注意:1个#号代表标题1,两个代表标题2,依次类推 # 标题1 ## 标题2 ### 标题3 #### 标题4 ##### 标题5 ###### 标题6 二.加粗,斜体 语法 ...
- nginx比apache处理静态文件速度快,但是nginx处理大量并发的php请求时,容易出现502错误,频率大概是多少
首先要明确一点的是502是怎么出现的,为什么会出现502呢? 一般而言,出现502的错误是因为php-cgi连接数不够导致的.举个例子:php-cgi开10个进程,前端发20个请求,每个请求的脚本都s ...
- Openlayer3之C++接口在javaScript的封装使用
0.写在前面: 1)涉及的关键词定义: 传入:JavaScript向CAPI传值 传出:CAPI向JavaScript传值 2)关于类和结构体的封装,需要严格执行内存对齐,以防止读取越界,但是避免不了 ...