(转)POSTFIX邮局系统搭建全过程1
原文:http://blog.csdn.net/liuyunfengheda/article/details/5805043POSTFIX邮局系统搭建全过程(postfix+courier-imap+maildrop+cyrus-sasl+ extman+ SpamAssassin+ clamav+ amavisd-new搭建mail服务器)作者:刘运锋 前言:现在网上有很多搭建postfix邮局系统的文章,其中也不乏优秀的文章,但是根据那些并不能完整的将postfix邮局系统架设起来。笔者也深受一些错误文章的影响,在搭建的过程中遇到这样和那样的问题,此次将postfix邮局系统完成的搭建一遍,并将搭建过程中遇到的问题及时更改,并更新到文档中,提供一个全方位的文
(转)Nginx安装
./configure --prefix=/usr/local/nginx安装Nginx时报错./configure: error: the HTTP rewrite module requires the PCRE library.安装pcre-devel解决问题yum -y install pcre-devel错误提示:./configure: error: the HTTP cache module requires md5 functionsfrom OpenSSL library. You can either disable the module by using--without-http-cache option, or install the OpenSSL library into the system,or build the OpenSSL library statically from the source with nginx by using--with-http_ssl_module --with-openssl=&l
(转)innodb_doublewrite_file
原文:http://www.orczhou.com/index.php/2010/02/innodb-double-write/记得刚开始看InnoDB文档的时候,Double Write一节(其实只有一小段)就让我很困惑。无奈当时内力太浅,纠缠了很久也没弄明白。时隔几个月,重新来整理一下。涉及到的概念:Buffer Pool简称BP,Dirty Page,Log file,Flush,innodb tablespace。1. 什么是Double Write在InnoDB将BP中的Dirty Page刷(flush)到磁盘上时,首先会将Page刷到InnoDB tablespace的一个区域中,我们称该区域为Double write Buffer。在向Double write Buffer写入成功后,再择机将数据拷贝
LVS-DR VIP和RIP不同网段的配置方法
在网上流传的很多文章中,LVS-DR模式都要求VIP和RIP在同一网段,很少有在不同网段配置成功的案例。但章文嵩博士已经在官网上明确回答了是可以在不同网段的(见http://zh.linuxvirtualserver.org/node/155),负载调度器只要有一个网口和真实服务器是通过不分段的网络连接起来就可以,真实服务器可以通过自己的路由器将响应报文发送给客户。也就是说Director至少要有两个网口才满足VIP和RIP不在同一网段。 LVS-HOWTO(http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.LVS-DR.html)也说明了LVS-DR的要求。 从realse
RouterOS防火墙
/ ip firewall filter add chain=input connection-state=invalid action=drop comment="丢弃非法连接数据" disabled=no/ip firewall filter add chain=input protocol=icmp action=drop comment="禁止外网Ping" disabled=no in-interface=ADSLadd chain=input protocol=tcp psd=21,3s,3,1 action=drop comment="探测并丢弃端口扫描连接" disabled=no add chain=input protocol=tcp connection-limit=3,32 src-address-list=black_list action=tarpit comment="压制DoS攻击" disabled=no add ch
RouterOS优化
Web 80端口优先/ip firewall mangleadd chain=prerouting protocol=tcp dst-port=80 action=mark-packet new-packet-mark=web passthrough=yes comment="web" disabled=no/queue treeadd name="web" parent=ether1-WAN packet-mark="web" limit-at=0 queue=default priority=3 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no小包优先/ ip firewall mangle add chain=forward protocol=tcp tcp-flags=syn action=change-mss new-mss=1440 comment="" disabled=no
RouterOS 限速脚本和限线程脚本
限线程脚本: :for aaa from 2 to 254 do={/ ip firewall filter add chain=forward src-address=("192.168.1." . $aaa) protocol=tcp connection-limit=120,32 action=drop comment="Connection limit"} 限速脚本: :for aaa from 2 to 254 do={/ queue simple add name=("queue" . $aaa) target-address=("192.168.1." . $aaa) limit-at=0/0 max-limit=400000/3000000 burst-limit=600000/10000000 burst-threshold=400000/3000000 burst-time=30/30 comment="Speed limit"} 说明:
Error: Exception was raised when calling per-thread-terminate function in extension lrwreplaymain.dl
在使用LR进行压力测试时,出现Error: Exception was raised when calling per-thread-terminate function in extension lrwreplaymain.dll: System Exceptions: EXCEPTION_ACCESS_VIOLATION的提示。解决方法:在C盘(或是其它盘均可以)新建TEMP文件夹(为了后续设置临时文件准备) 右键"我的电脑"->高级->环境变量->编辑修改所有TEMP变量目录,指身上面新建的目录,如我的指向C:TEMP ,保存即可。[@more@]
HandlerSocket安装记录
HandlerSocket[@more@]tar zxvf ahiguti-HandlerSocket-Plugin-for-MySQL-1.0.6-23-g4cfc840.tar.gzcd ahiguti-HandlerSocket-Plugin-for-MySQL-4cfc840./autogen.shYou should add the contents of `/usr/share/aclocal/libtool.m4' to `aclocal.m4'.cat /usr/share/aclocal/libtool.m4 >> aclocal.m4./configure --with-mysql-source=/root/Percona-Server --with-mysql-bindir=/usr/local/Percona-Server-5.1.51-rel11.5-132-Linux-x86_64/bin --with-mysql-plugindir=/usr/local/Percona-Server-5.1.51-rel11.5-132-Linux-x86_6
(转)Linux find命令详解
find的使用格式如下:$ find <指定目录> <指定条件> <指定动作>- <指定目录>: 所要搜索的目录及其所有子目录。默认为当前目录。- <指定条件>: 所要搜索的文件的特征。几种常用的条件包括:[@more@]+n 大于n,-n 小于nn 等于n-amin n查找系统中最后N分钟访问的文件-atime n查找系统中最后n*24小时访问的文件-cmin n查找系统中最后N分钟被改变状态的文件-ctime n查找系统中最后n*24小时被改变状态的文件-empty查找系统中空白的文件,或空白的文件目录,或目录中没有子目录的文件夹-group gname查
Linux命令笔记
1、清空进程间通信消息队列ipcs -q|awk '{print $2}'|xargs -n1 ipcrm -q注意xargs一定要加-n1参数,不然一次只清掉一行[@more@]
does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!
用ssh 时,会有这样的提示$ ssh 192.168.1.156Address 192.168.1.156 maps to localhost, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!是因为DNS服务器把 192.168.x.x 的地址都反向解析成 localhost ,而DNS服务器不是自己的,不能改。 解决的办法就是,编辑 ssh 客户端的 /etc/hosts 文件,把出问题的IP 地址和主机名加进去,就不会报这样的错了。[@more@]
(转)SQL Server 2005安装过程出现意外错误并终止安装
1、在安装向导过程中,出现如下错误:{英文原意如下When you install Microsoft SQL Server 2005, you receive the following error message: There was an unexpected failure during the setup wizard. You may review the setup logs and/or click the help button for more information.}[@more@]2、当我检查C:Program FilesMicrosoft SQL Server90Setup BootstrapLOGSummary.txtMicrosoft SQL Server 2005 9.00.1399.06 ============================== OS Version : Microsoft Windows Server 2003 family, Enterprise Edition Serv
LINUX修改SSH端口和禁止ROOT远程登陆设置
linux修改ssh端口22 vi /etc/ssh/ssh_config vi /etc/ssh/sshd_config然后修改为port 1234 以root身份service sshd restart为增强安全 先增加一个普通权限的用户: #useradd myuser#passwd myuser//设置密码生产机器禁止ROOT远程SSH登录: #vi /etc/ssh/sshd_config把 PermitRootLogin yes 改为 PermitRootLogin no 重启sshd服务 #service sshd restart远程管理用普通用户myuser登录,然后用 su - root 切换到root用户拿到最高权限。[@more@]
MySQL存储过程中的sql_mode问题
在my.cnf中设置了sql_mode='STRICT_TRANS_TABLES';却发现还是有非法数据的写入,比如无符号整数字段本来值是0,还可以减,结果当然溢出了,经检查发现存储过程中默认的sql_mode并没有使用global的sql_mode,测试如下:CREATE PROCEDURE p_test()BEGIN select @@session.sql_mode,@@global.sql_mode;END;call p_test();+--------------------+---------------------+| @@session.sql_mode | @@global.sql_mode |+--------------------+---------------------+| | STRICT_TRANS_TABLES |+--------------------+-------
国内最快的CentOS yum 源
CentOS 中国科学技术大学 USTC mirror(每小时更新一次)http://centos.ustc.edu.cn/centos/安装CentOS 5 后请按照以下步骤修改CenOS-Base.repo,以后就可以方便的用yum安装软件了.cd /etc/yum.repos.dmv CentOS-Base.repo CentOS-Base.repo.savewget http://centos.ustc.edu.cn/CentOS-Base.repo.5mv CentOS-Base.repo.5 CentOS-Base.repo如果在配置YUM源后,第一次运行yum update命令,出现如下错误。warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID*****这是由于yum安装了旧版本的GPG keys造成的,解决办法就是rpm –
(转)netstat和awk命令来统计网络连接数
原文:http://ilexes.blog.51cto.com/705330/175666/netstat -n | awk '/^tcp/ {++state[$NF]} END {for(key in state) print key,"t",state[key]}'会得到类似下面的结果,具体数字会有所不同:LAST_ACK 1SYN_RECV 14ESTABLISHED 79FIN_WAIT1 28FIN_WAIT2 3CLOSING 5TIME_WAIT 1669状态:描述CLOSED:无连接是活动的或正在进行LISTEN:服务器在等待进入呼叫SYN_RECV:一个连接请求已经到达,等待确认SYN_SENT:应用已经开始,打开一个连接ESTABLISHED:正常数据传输状态FIN_WAIT1:应用说它已经完成FIN_WAIT2:另一边已同意释放
(转)超级详细Tcpdump 的用法
第一种是关于类型的关键字,主要包括host,net,port, 例如 host 210.27.48.2,指明 210.27.48.2是一台主机,net 202.0.0.0 指明 202.0.0.0是一个网络地址,port 23 指明端口号是23。如果没有指定类型,缺省的类型是host.第二种是确定传输方向的关键字,主要包括src , dst ,dst or src, dst and src ,这些关键字指明了传输的方向。举例说明,src 210.27.48.2 ,指明ip包中源地址是210.27.48.2 , dst net 202.0.0.0 指明目的网络地址是202.0.0.0 。如果没有指明方向关键字,则缺省是src or dst关键字。第三种是协议的关键字,主要包括 fddi,
(转)LVS三种模式配置总结
原文:http://www.6curl.com/lvs-config/近日.做服务器集群,使用的是LVS架构解决方案,为管理方便,总结LVS三种(LVS-DR,LVS-NAT,LVS-TUN)模式的简要配置,省的自己下次需要去网上LVS是什么我就不介绍的了,参考http://www.linuxvirtualserver.org/VS-NAT.html http://www.linuxvirtualserver.org/VS-IPTunneling.htmlhttp://www.linuxvirtualserver.org/VS-DRouting.html[@more@]首先是安装ipvsadm管理程序下载:http://www.linuxvirtualserver.org/software/注意对应自己的内核版本ipvsadm-1.24.tar.gztar zxvf ipvsadm-1.24.tar.gzcd ipvs
(转)CentOS添加永久静态路由
原文: http://blog.chinaunix.net/u/504/showart_2181493.html在使用双网卡,同时使用2个网关的时候就需要加一条静态路由了。当然还有很多时候会需要加路由。一:使用 route 命令添加使用route 命令添加的路由,机器重启或者网卡重启后路由就失效了,方法://添加到主机的路由# route add –host 192.168.1.11 dev eth0# route add –host 192.168.1.12 gw 192.168.1.1//添加到网络的路由# route add –net 192.168.1.11 netmask 255.255.255.0 eth0# route add –net 192.168.1.11 netmask 255.255.255.0 gw 192.168.1.1# route add –ne