ansible源码安装zabbix agent

名词解释
	[root@iZ23nvakegvZ zabbix_agent]# ls  
	files  需要安装包  
	handlers  重启相关信息  
	meta  galaxy_info相关信息  
	tasks  安装部署的任务  
	templates  相关的模板配置文件 
	vars   变量配置文件  
	[root@iZ23nvakegvZ zabbix_agent]#
目录结构
	[root@iZ23nvakegvZ zabbix_agent]# tree
	
	.
	
	├── hosts
	├── roles
	│   └── zabbix_agent
	│       ├── files
	│       │   └── zabbix-2.4.5.tar.gz
	│       ├── handlers
	│       ├── meta
	│       │   └── main.yml
	│       ├── tasks
	│       │   ├── copy.yml
	│       │   ├── delete.yml
	│       │   ├── install.yml
	│       │   └── main.yml
	│       ├── templates
	│       │   ├── zabbix_agentd
	│       │   └── zabbix_agentd.conf
	│       └── vars
	│           └── main.yml
	└── site.yml
	
	8 directories, 11 files
	
	[root@iZ23nvakegvZ zabbix_agent]#
[Read More]

ansible-playbook语法检查

列出主机

	[root@ops-test-01 nginx_v2]# ansible-playbook -i hosts --list-hosts web-tls.yml
	
	playbook: web-tls.yml
	
	  play #1 (Configure webserver with nginx and tls): host count=1
	
	    web_test01
	
	[root@ops-test-01 nginx_v2]#

语法检查

	[root@ops-test-01 nginx_v2]# ansible-playbook --syntax-check  web-tls.yml
	
	playbook: web-tls.yml
	
	[root@ops-test-01 nginx_v2]#
[Read More]

ansible playbook

ansible playbook安装nginx https

查看目录结构

    [root@iZ23nvakegvZ nginx_v2]# tree

    .

    ├── files

    │   ├── nginx.crt

    │   ├── nginx.key

    ├── hosts

    ├── templates

    │   ├── index.html.j2

    │   └── test.conf.j2

    └── web-tls.yml



    2 directories, 8 files

    [root@iZ23nvakegvZ nginx_v2]#
[Read More]

使用nginx模块简单防止ddos攻击

使用nginx模块简单防止ddos攻击

第一种方法: 官方模块:http://nginx.org/en/docs/http/ngx_http_limit_conn_module.html 1.在Nginx配置文件nginx.conf的http选项中添加如下内容 在nginx.conf的配置中添加了Nginx白名单 ### Nginx Limint config geo $limited{ default 1; 127.0.0.1 0; 192.168.100.18 0; } map $limited $limit{ 1 $binary_remote_addr; 0 ""; } limit_req_zone $limit zone=one:10m rate=5r/s; 2.在虚拟目录中直接应用 [root@frontend-01 ~]# cat /etc/nginx/conf.d/test.conf server{ listen 80; server_name yourdomain.com; root /yourdist/; access_log /yourdomain.com.access.log json; error_log /yourdomain.com.error.log warn; location /test/api/v3/ { ## 只针对api接口调用做Nginx IP地址限速 limit_req zone=one burst=10 nodelay; proxy_pass http://test; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Host $server_name; proxy_set_header Host $host; add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Headers "accept, content-type"; } location /test/auth/v3/ { proxy_pass http://test; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Host $server_name; proxy_set_header Host $host; add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Headers "accept, content-type"; } } [root@frontend-01 ~]# 3. [Read More]
nginx 

编译nginx status模块以及zabbix监控nginx状态

编译nginx status模块以及zabbix监控nginx状态

背景原因:
因刚换工作,突然发现nginx status状态没有被监控,然后在准备添加nginx status的时候,发现之前同事在编译nginx的时候没有编译nginx status模块,可恶,常用的模块都不编译.主要两部分,
第一部分:编译nginx模块
第二部分:zabbix 监控nginx status,其实之前写过,稍微把监控方式优化了下。
一、nginx 编译模块
1.下载nginx安装包
root@gcs:/home/steven# wget http://nginx.org/download/nginx-1.6.3.tar.gz
--2015-09-09 17:27:40--  http://nginx.org/download/nginx-1.6.3.tar.gz
Resolving nginx.org (nginx.org)... 206.251.255.63, 2606:7100:1:69::3f
Connecting to nginx.org (nginx.org)|206.251.255.63|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 805253 (786K) [application/octet-stream]
Saving to: ‘nginx-1.6.3.tar.gz’

100%[============================================================================================================>] 805,253      569KB/s   in 1.4s

2015-09-09 17:27:42 (569 KB/s) - ‘nginx-1.6.3.tar.gz’ saved [805253/805253]

root@gcs:/home/steven# ls
nginx-1.6.3.tar.gz
root@gcs:/home/steven#
[Read More]
nginx