记录关于Devops运维,虚拟化容器云计算,数据库,网络安全等各方面问题。
Oracle数据库无效对象问题处理 维护的数据库存在大量的无效对象,其中大量的无效对象(800多个)所有者为系统用户,虽然对应用暂时没有影响,但为了避免隐患,对无效对象进行了处理。$select object_name,object_type,owner,created,last_ddl_time,timestamp from dba_objects where status='INVALID' order by 1,2; OBJECT_NAME OBJECT_TYPE OWNER /c0c184e9_QsmaSqlValidationTar JAVA CLASS SYS /da5b87e_QsmaSqlTestCallback JAVA CLASS SYS /ec947e38_QsmaSqlParserJJCalls JAVA CLASS SYS _ALL_REPCOLUMN_GROUP VIEW &...
nginx配合modsecurity实现WAF功能modsecurity原本是Apache上的一款开源waf,可以有效的增强web安全性,目前已经支持nginx和IIS,配合nginx的灵活和高效,可以打造成生产级的WAF,是保护和审核web安全的利器。一.准备工作系统:centos 6.5 64位、 tengine 2.1.0, modsecurity 2.8.0tengine : http://tengine.taobao.org/download/tengine-2.1.0.tar.gzmodsecurity for Nginx: https://www.modsecurity.org/tarball/2.8.0/modsecurity-2.8.0.tar.gzOWASP规则集: https://github.com/SpiderLabs/owasp-modsecurity-crs依赖关系:tengine(nginx)依赖: pcre 、zlib、 openssl, 这三个包centos 6.5 系统源里都有:yum install zlib zlib-devel openssl openssl-devel pcre pcre-devel
modsecurty依赖的包:pcre httpd-devel libxml2 apryum install httpd-devel apr apr-util-devel apr-devel pcre pcre-devel libxml2 libxml2-devel
二.启用standalone模块并编译下载modsecurity for nginx 解压,进入解压后目录执行:./autogen.sh
./configure --enable-standalone-module --disable-mlogc
make
三.nginx添加modsecurity模块在编译standalone后,nginx编译时可...
配置ModSecurity防火墙与OWASP规则 from:http://resources.infosecinstitute.com/configuring-modsecurity-firewall-owasp-rules/0x00 背景ModSecurity是一个免费、开源的Apache模块,可以充当Web应用防火墙(WAF)。ModSecurity是一个入侵探测与阻止的引擎.它主要是用于Web应用程序所以也可以叫做Web应用程序防火墙.ModSecurity的目的是为增强Web应用程序的安全性和保护Web应用程序避免遭受来自已知与未知的攻击.OWASP是一个安全社区,开发和维护着一套免费的应用程序保护规则,这就是所谓OWASP的ModSecurity的核心规则集(即CRS)。我们可以通过ModSecurity手工创建安全过滤器、定义攻击并实现主动的安全输入验证.所以,在这篇文章中,我们将配置ModSecurity防火墙与OWASP的核心规则集。我们也将学习如何可以根据我们的需要自定义OWASP的核心规则集或创建自己的定制规则.0x01 安装过程本文是在Centos环境中安装和配置的,步骤如下:第1步以root用户身份登录到您的服务器,登录之后我们在安装ModSecurity之前需要安装一些依赖包,可以通过以下的命令安装:yum install -y gcc make libxml2 libxml2-dev...
微软于2015年7月20日发布安全公告,此次有1个严重补丁: MS15-078(严重),微软字体驱动中的漏洞可能导致远程代码执行 (3079904) 详情如下,请大家关注~ 安全漏洞预警公告(MS15-078) 1、漏洞发布日期 2015年7月20日 2、已确认被成功利用的软件及系统 Windows Vista/7/8/8.1, Windows Server 2008/2008 R2/2012/2012 R2, Windows RT/RT 8.1 3、漏洞描述 此安全更新可修复 Microsoft Windows 中的漏洞。如果用户打开了嵌入OpenType字体的精心构造的文档或不被信任的网页,将有可能导致远程代码执行。 4、漏洞检测方法 无 5、建议修补方案 微软已经发布补丁MS15-078,补丁地址: https://technet.microsoft.com/zh-CN/library/security/ms15-078
Oracle查询表空间使用情况 --查询表空间使用情况 SELECT UPPER(F.TABLESPACE_NAME) "表空间名", D.TOT_GROOTTE_MB "表空间大小(M)", D.TOT_GROOTTE_MB - F.TOTAL_BYTES "已使用空间(M)", TO_CHAR(ROUND((D.TOT_GROOTTE_MB - F.TOTAL_BYTES) / D.TOT_GROOTTE_MB * 100,2),'990.99') || '%' "使用比", F.TOTAL_BYTES "空闲空间(M)", F.MAX_BYTES "最大块(M)" FROM (SELECT TABLESPACE_NAME, ROUND(SUM(BYTES) / (1024 * 1024), 2) TOTAL_BYTES, ROUND(MAX(BYTES) / (1024 * 1024), 2) MAX_BYTES FROM SYS.DBA_FREE_SPACE GROUP BY TABLESPACE_NAME) F, (SELECT DD.TABLESPACE_NAME, ROUND(SUM(DD.BYTES) / (1024 * 1024), 2) TOT_GROOTTE_MB FROM SYS.DBA_DATA_FILES DD GROUP BY DD.TABLESPACE_NAME) D WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME ORDER BY 1; --查询表空间的free space select tablespace_name, count(*) as extends, round(sum(bytes) / 1024 / 1024, 2) as MB, sum(blocks) as blocks from dba_free_space gro...
lnmp已经成为比较流行的网站服务器端技术配备。越来越多的人开始不满足于能使用nginx,更多人开始关注如何能优化nginx的处理能力。使用nginx的目的就是为了提高并发处理能力,但是看到有部分人本机部署lanmp,在同一台机器上使用nginx方向代理apache,就有种脱裤子放屁的感觉。在window下运行nginx,还要跑出好的效果,同样是个伪命题,windows下的select模型注定nginx效率不会太高。最近看了篇英文文章,结合自己理解,写给大家看看吧。优化nginx包括两方面:1.是自己重写nginx代码(比如tengine)、本身nginx的代码已经足够优秀,如果不是每秒几千的请求,就忽略这个部分吧。2.另一个就是和优化nginx的配置,这是中小型网站可以重点优化的部分。nginx的配置文件是一种声明式定义,控制nginx的每一个细节。所谓负载调优,就是提高单台机器处理效率,降低单台机器的负载。为了提高单台机器的处理效率,cpu的处理速度是足够快的,我们能解决的就是降低磁盘I/O、网络I/O,减少内存使用。降低单台机器的负载我们能做的就是负载均衡,把流量打到多台机器处理。nginx推荐优化内容:1.open files数量优化ulimit -a查看系统参数其中open files (-n) 1024表示系统同时最多能打开的文件数...
nginx优化 实现10万并发访问量一般来说nginx配置文件中对优化比较有作用的为以下几项:worker_processes 8;1 nginx进程数,建议按照cpu数目来指定,一般为它的倍数。worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 0010000001000000 10000000;为每个进程分配 cpu,上例中将 8 个进程分配到 8 个 cpu,当然可以写多个,或者将一个进程分配到多个cpu。worker_rlimit_nofile 102400;这个指令是指当一个nginx进程打开的最多文件描述符数目,理论值应该是最多打开文件数(ulimit -n)与nginx进程数相除,但是nginx分配请求并不是那么均匀,所以最好与ulimit-n的值保持一致。use epoll;使用epoll的I/O模型,这个不用说了吧。worker_connections 102400;每个进程允许的最多连接数,理论上每台 nginx 服务器的最大连接数为worker_processes*worker_connections。keepalive_timeout 60;keepalive超时时间。client_header_buffer_size 4k;客户端请求头部的缓冲区大小,这个可以根据你的系统分页大小来设置,一般一个请求头的大小不会超过 1k,不过由于一般系统分页都要大于 1k,所以这里设置为分页大小。分页大小可以用命令getconf PAGESIZE取得。open_file_cache ...
Monitoring disk I/O using ZabbixDennis / February 2, 2014 How to set up disk monitoring on Linux in Zabbix. The standard Linux template in Zabbix provides monitoring on the filling of your disks, but not too much about real utilisation. For example, it doesn’t tell you how many writes per second are being handled by a disk or partition.However, this kind of information can be vital for the health of your servers. Disks are almost always a bottleneck, so I like to keep an eye on them.The inspiration for this blogpost and some code is from Renaldo Maclons’ weblog.Goal:Monitor the utilisation of my disk devices in Linux servers. Being lazy as a sysadmin is always a good thing, so I’m going to implement low-level discovery of my disk devices and create a template to go with it.We’ll be configuring the Zabbix agent which is running on my Linux boxes to support the low-level discovery of my disk devices, and the items we need to monitor on the host.For the quick-starters:1. Downlo...
Zabbix上硬盘IO监控 基本原理:通过分析/proc/diskstats文件,来对IO的性能进行监控。解释如下:+++++++++++++++++++++++++++对/proc/diskstats的解释++++++++++++++++++++++++++++++++++++++++++++[root@localhost bin]# cat /proc/diskstats | grep sda | head -18 0 sda 73840 10263 3178156 91219 1110085 4192562 42423152 1275861 0 447798 1366379第一至第三个域,分别是主设备号,次设备号,设备名称第4个域:读完成次数 ----- 读磁盘的次数,成功完成读的总次数。(number of issued reads. This is the total number of reads completed successfully.)第5个域:合并读完成次数, 第9个域:合并写完成次数。为了效率可能会合并相邻的读和写。从而两次4K的读在它最终被处理到磁盘上之前可能会变成一次8K的读,才被计数(和排队),因此只有一次I/O操作。这个域使你知道这样的操作有多频繁。(number of reads merged)第6个域:读扇区的次数,成功读过的扇区总次数。(number of sectors read. This is the total number of sectors read successfully.)第7个域:读花费的毫秒数,这是所有读操作所花费的毫秒数(用__make_request()到end_that_request_la...
如何用zabbix来监控磁盘IO 原作者博客地址: http://www.muck.net/19/getting-hard-disk-performance-stats-from-zabbixhttp://www.muck.net/pub/zabbix_FileServer_template.xmlI like zabbix… but it annoys me that it’s ops per second, and bytes per second data is broken for hard drives in the linux 2.6 kernel. So I created a work around Add the following code to your zabbix_agentd.conf file (/etc/zabbix/zabbix_agentd.conf by default), and restart the zabbix agent:UserParameter=custom.vfs.dev.read.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$4}'UserParameter=custom.vfs.dev.read.ms[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$7}'UserParameter=custom.vfs.dev.write.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$8}'UserParameter=custom.vfs.dev.write.ms[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$11}'UserParameter=custom.vfs.dev.io.active[*],cat /proc/diskstats | grep $1...
最新评论