ubuntu-edgy配置笔记
原文URL:http://blog.zhangjianfeng.com/?p=490
####装中文输入
#vi /etc/apt/sources.list 在打开的编辑器中将所有内容删除, 把下面的内容复制进去
##中国 台湾省台湾大学 更新服务器
阅读全文——共7477字
Web&P2P系统架构及优化
原文URL:http://blog.zhangjianfeng.com/?p=490
####装中文输入
#vi /etc/apt/sources.list 在打开的编辑器中将所有内容删除, 把下面的内容复制进去
##中国 台湾省台湾大学 更新服务器
阅读全文——共7477字
作者: Jeffrey
出处:http://blog.zhangjianfeng.com/?p=460
”中文垃圾邮件过滤规则集“安装配置笔记(sendmail+Spamassassin+mimedefang环境)
1.安装sendmail
阅读全文——共6898字
作者: Jeffrey
出处:http://blog.zhangjianfeng.com/?p=342
电子邮件系统的组成5部分:MTA,MSA,MUA,MDA,MAA1, 邮件用户代理(Mail User Agent,MUA)MUA是一个邮件系统的客户端程序,它提供了阅读,发送和接受电子邮件的用户接口。最常用的MUA有:linux中的mail,elm,pine等。Windows的outlook ,foxmail等2, 邮件代理器(Mail Transfer Agent,MTA)MTA负责邮件的存储和转发(store and forward)。MTA监视用户代理的请求,根据电子邮件的目标地址找出对应的邮件服务器,将信件在服务器之间传输并且将接受到的邮件进行缓冲。在linux下的MTA程序有:sendmail,qmail等,3, 邮件提交代理(Mail Submmission Agent,MSA)MSA负责消息有MTA发送之前必须完成的所有准备工作和错误检测,MSA就像在MUA和MTA之间插入了一个头脑清醒的检测员对所有的主机名,从MUA得到的信息头等信息进行检测。4, 邮件投递代理(Mail Ddlivery Agent,MDA)MDA从MTA接收邮件并进行适当的本地投递,可以投递个一个本地用户,一个邮件列表,一个文件或是一个程序。Linux下常用的MDA是mail.local,smrsh和procmail(www.procmail.org)5, 邮件访问代理(Mail Access Agent,MAA)MAA用于将用户连接到系统邮件库,使用POP或IMAP协议收取邮件。Linux下常用的MAA有UW-IMAP,Cyrus-IMAP,COURIER-IMAP等邮件中继:就是当邮件向目的地址传输时,一旦源地址和目的地址都不是本地系统,那么本地系统就是邮件的中继(中转站)MUA 使用者透过这个程序与邮件服务器沟通,包括收信(以 POP3 连接收信服务器程序 imapd)或寄信(以SMTP 连接 MTA),例如: Outlook Express……等。MTA 使用 SMTP 通讯协议将信件传递到不同邮件主机上面,例如: sendmail, postfix, Qmail……等。MSA 是新版 sendmail 发展给 SSMTP 进行 TLS/SSL 联机的 client 端代理器。MDA 收到信后将信件分配到不同使用者信箱内,算是 MTA 的一个子系统,譬如 BBS 从定义上来说也算是 MDA( BBS 功能复杂,当然不仅仅是 MDA),有些 MDA 被设计来进行滤信动作,它们必须在 local 端运作,因此又被称为 LDA,例如: procmail……等。MailBox 尚未被使用者下载的邮件,会暂存在服务器的硬盘空间里,称之为信箱。所有使用者信箱的总合必须约等于该分割区总容量的一半,以避免造成信箱尚有空间但邮件系统却无法运作的现象。Mail Gateway 是一种特殊的邮件服务器,通常扮演代理器的角色,负责统筹某机构内所有信件的收发,并分配邮件给下属的邮件服务器们,透过这个机制能够加速邮件的交换,并且能够进行一致的滤信控制。
阅读全文——共5849字
++ IP访问限制
在server.xml中,对需要限制的context以下修改:
<Context path=”/kintai” reloadable=”true” docBase=”d:\vod” >
<Valve className=”org.apache.catalina.valves.RemoteAddrValve”
阅读全文——共977字
作者: Jeffrey
出处:http://blog.zhangjianfeng.com/?p=303
++检查是否安装相应程序包,如没装,需要安装一下# rpm -qa|grep nfs-utilsnfs-utils-1.0.6-65.EL4# rpm -qa|grep portmapportmap-4.0-63
++配置服务配置NFS服务主要使用/etc/exports# Syntax: SharePath allowIP/data 192.168.25.2(ro,sync,root_squash) #共享/data目录中所有文件,后面是允许使用此共享目录的客户端主机的IP地址,直接写主机名也可;当主机名是*时,表示任何主机均被允许使用此共享目录.#参数ro表示共享目录文件对客户端只能读,不能写. rw表示可以读写.#sync表示服务器在请求所做的改变被写入磁盘之前就不会回复这些请求.#root_squash表示禁止客户端的root用户映射为nfs服务器端的root用户,参数no_root_squash可禁止这种映射,将客户端root用户映射为NFS服务器端的root用户.
阅读全文——共1759字
原文地址:http://www.5ilinux.com/samba.html
Samba服务器调试需要实现他的基本功能,文件共享服务。
环境是: 假如公司有财务,技术,领导3个部门,我们分别为3个部门建立3个用户组为caiwu,network,lingdao;
阅读全文——共2257字
端口镜像(Port Mirroring)可以让用户将所有的流量从一个特定的端口复制到一个镜像端口。如果您的交换机提供端口镜像功能,则允许管理人员自行设置一个监视管理端口来监视被监视端口的数据。监视到的数据可以通过PC上安装的网络分析软件来查看,通过对数据的分析就可以实时查看被监视端口的情况。如下图所示:大多数三层交换机和部份两层交换机,具备端口镜像功能,不同的交换机或不同的型号,镜像配置方法的有些区别,下面我们提供常见交换机的镜像配置方法:Cisco CATALYST交换机端口监听配置CISCO CATALYST交换机分为两种,在CATALYST家族中称监听端口为分析端口(analysis port)。1、Catalyst 2900XL/3500XL/2950系列交换机端口监听配置(基于CLI)以下命令配置端口监听:port monitor例如,F0/1和F0/2、F0/5同属VLAN1,F0/1监听F0/2、F0/5端口:interface FastEthernet0/1port monitor FastEthernet0/2port monitor FastEthernet0/5port monitor VLAN12、Catalyst 4000/5000/6000系列交换机端口监听配置(基于IOS)以下命令配置端口监听:set span例如,模块6中端口1和端口2同属VLAN1,端口3在VLAN2,端口4和5在VLAN2,端口2监听端口1和3、4、5,set span 6/1,6/3-5 6/23COM交换机端口监听配置在3COM交换机中,端口监听被称为“Roving Analysis”。 网络流量被监听的端口称作“监听口”(Monitor Port),连接监听设备的端口称作“分析口”(Analyzer Port)。以下命令配置端口监听:指定分析口feature rovingAnalysis add,或缩写 f r a例如:Select menu option: feature rovingAn alysis addSelect analysis slot: 1Select analysis port: 2指定监听口并启动端口监听feature rovingAnalysis start,或缩写 f r sta例如:Select menu option: feature rovingAn alysis startSelect slot to monitor (1-12): 1Select port to monitor&nb sp; (1-8): 3停止端口监听feature rovingAnalysis stop,或缩写 f r stoDELL交换机端口监听配置在Dell交换机中,端口监听被称为“端口镜像”(Port Mirroring)。使用交换机的管理界面,参数如下:Destination Port(目的地端口):定义端口通信要镜像到的端口号;Source Port(源端口):定义被镜像端口的端口号。Add(添加):添加端口镜像操作。Type(类型):指定要镜像的端口通信类型。 可能的字段值包括:“RX”-表示镜像进入网络的数据;“TX”-表示镜像流出网络的数据;Both()-表示镜像所有数据。Status(状态):表示端口的状态。 可能的字段值包括: “Active”-表示端口被启用;“Not Active”-表示端口被禁用。Remove(删除):删除端口镜像会话。 可能的字段值包括: “已选取”-删除端口镜像会话;“未选取”-保留端口镜像会话。具体设置:1、在Port Mirroring对话框中的Destination Port中选中目的端口(镜像端口),再单击Add按钮;2、在系统将打开“Add Source Port”(添加源端口)页面中,定义“Source Port”(源端口)和“Type”(类型)字段,并单击“Apply Changes”(应用更改), 使系统接收更改。(注:如果需要从端口镜像会话删除副本端口,请打开“Port Mirroring”(端口镜像)页面,选取“Remove”(删除)复选框,再单击“Apply Changes”(应用更改)。 系统将删除端口镜像会话,并更新设备。)以下命令配置端口监听:指定分析口CLI 命令实例:Console(config)# interface ethernet 1/e1Console(config-if)# port monitor 1/e8Console# show ports monitorSource port Destination Port Type Status———– —————- —– ——-1/e1 1/e8 RX, TX ActiveNetCore交换机端口监听配置NetCore交换机中,端口监听被称为“端口镜像”(Port Mirroring)。交换机提供四种监视状态:Off 关闭Mirror功能Rx 捕获被监视端口的接收数据Tx 捕获被监视端口的发送数据Both 捕获被监视端口的接收和发送的数据进入NetCore的超级终端,在主菜单中输入“5”进入端口镜像设置界面,输入“1”设置端口镜像状态。如设置端口1为镜像端口,端口8为被镜像端口,捕获该端口的接收和发送数据。配置命令如下:1. 选择配置的选项 (1,off, 2.Rx, 3.Tx, 4.Both) :42. 选择捕获端口:13. 选择被镜像端口:8按Esc键退回镜像设置界面,设置成功。Intel交换机端口监听配置Intel 称端口监听为“Mirror Ports”。 网络流量被监听的端口称作“源端口”(Source Port),连接监听设备的端口称作“镜像口”(Mirror Port)。配置端口监听步骤如下:● 在navigation菜单,点击Statistics下的Mirror Ports,弹出Mirror Ports信息。● 在Configure Source 列中点击端口来选择源端口, 弹出Mirror Ports Configuration。● 进行源端口设置:● 源端口是镜像流量的来源口,镜像口是接收来自源端口流量的端口。● 点击Apply确定可以选择三种监听的方式:1.连续(Always):镜像全部流量。2.周期(Periodic):在一定周期内 镜像全部流量。镜像周期在Sampling Interval configuration中设置。3.禁止(Disabled):关闭流量镜像。Avaya交换机端口监听配置在Avaya交换机用户手册中,端口监听被称为“端口镜像”(Port Mirror)。以下命令配置端口监听:{set|clear } Port Mirror设置端口侦听: set port mirror source-portmirror-portsampling { always } [ max-packets -sec] [ piggyback-port ]禁止端口监 听:clear port mirror命令中,mod-port-range 指定端口的范围;mod-port-spec 指定特定的端口;piggyback-port 指定双向镜像的端口;sampling 指定镜像周期;max-packets-sec 仅在sampling设置为periodic时使用,指定监听口每秒最多的数据报数量。华为交换机端口监听配置华为交换机用户手册中,端口监听被称为“端口镜像”(Port Mirroring)。使用Huawei Lanswitch View管理系统添加一个镜像端口:选择 Device Setup或Stack Setup。Port Mirroring。Add按钮。对于堆叠,点击Switch并从列表选择一个交换机。Reflect from并选择流量将被镜像的端口。Reflect to并选上面所选择的端口上的
阅读全文——共4905字
Apache服务器的设置文件位于/usr/local/apache/conf/目录下,传统上使用三个配置文件httpd.conf,access.conf和srm.conf,来配置Apache服务器的行为。
httpd.conf提供了最基本的服务器配置,是对守护程序httpd如何运行的技术描述;srm.conf是服务器的资源映 射文件,告诉服务器各种文件的MIME类型,以及如何支持这些文件;access.conf用于配置服务器的访问权限,控制不同用户和计算机的访问限制; 这三个配置文件控制着服务器的各个方面的特性,因此为了正常运行服务器便需要设置好这三个文件。
除了这三个设置文件之外,Apache还使用mime.types文件用于标识不同文件
阅读全文——共23634字
Red Hat Cluster Manager安装操作系统,选择组件advance server,安装LVS部分。两台主机,主机名为haha和hehe主机haha的本地ip地址为net0:192.168.2.11,net1:192.168.2.14主机hehe的本地ip地址为net0:192.168.2.12,net1:192.168.2.16(主机网络连线只能用直连线进行连接,不能用交叉线连接,否则双机不能进行监控)修改/etc/hosts文件,封掉localhost行的内容,写入本地主机、对方主机和虚拟主机相应的ip地址和主机名:(两台主机配置相同)192.168.2.11 haha192.168.2.12 hehe192.168.2.13 xixi进入/etc/sysconfig/rawdevices文件,增加两行内容:(两台主机设置相同)/dev/raw/raw1 /dev/sdb1/dev/raw/raw2 /dev/sdb2以上两行是LVS需要的两个裸设备作为系统监控使用,每个裸设备的空间不能小于10M。当然需要fdisk建立两个两个相应的设备。然后从起主机,进入/sbin下,./cluconfig进行cluster的配置:Red Hat Cluster Manager Configuration Utility (running on haha) –haha为本地主机名Enter cluster name [Red Hat Cluster Manager]:xixi –xixi为虚拟主机名Enter IP address for cluster alias [NONE]:192.168.2.13 –地址为虚拟地址——————————–Information for Cluster Member 0——————————–Enter name of cluster member [haha]: –本地成员,回车即可Enter number of heartbeat channels (minimum = 1) [1]: 2 –两块网卡心跳线(也可串口心跳)Channel type: net or serial [net]: –第一块网卡做心跳Enter hostname of the cluster member on heartbeat channel 0 [haha]: –心跳线成员名称Channel type: net or serial [net]: –第二块网卡做心跳线Enter hostname of the cluster member on heartbeat channel 1:hehe –另外一个成员名称Information about Quorum PartitionsEnter Primary Quorum Partition [/dev/raw/raw1]:Enter Shadow Quorum Partition [/dev/raw/raw2]:Information About the Power Switch That Power Cycles Member ‘haha’Choose one of the following power switches:o NONEo RPS10o BAYTECHo APCSERIALo APCMASTERo WTI_NPSo SW_WATCHDOGPower switch [NONE]:——————————–Information for Cluster Member 1——————————–Enter name of cluster member:hehe –对方成员名Enter hostname of the cluster member on heartbeat channel 0: heheEnter hostname of the cluster member on heartbeat channel 1: hahaInformation about Quorum PartitionsEnter Primary Quorum Partition [/dev/raw/raw1]:Enter Shadow Quorum Partition [/dev/raw/raw2]:Information About the Power Switch That Power Cycles Member ‘hehe’Choose one of the following power switches:o NONEo RPS10o BAYTECHo APCSERIALo APCMASTERo WTI_NPSo SW_WATCHDOGPower switch [NONE]:Save the cluster member information? yes/no [yes]: –对配置信息进行保存Save the cluster member information? yes/no [yes]:Writing to configuration file…doneConfiguration information has been saved to /etc/cluster.conf.—————————-Setting up Quorum Partitions—————————-Running cludiskutil -I to initialize the quorum partitions: doneSaving configuration information to quorum partitions: doneDo you wish to allow remote monitoring of the cluster? yes/no [yes]: –是否允许远程主机进行cluster监视访问Configuration on this member is complete.To configure the next member, invoke the following command on that system:# /sbin/cluconfig –init=/dev/raw/raw1Refer to the Red Hat Cluster Manager Installation and Administration Guidefor details.本地主机配置完成进入对方主机的/sbin目录,执行cluconfig –init=/dev/raw/raw1显示信息如下:Information about Channel 0/sbin/cluconfig: [: haha: unary operator expectedLooking for host haha (may take a few seconds)…Information about Channel 1/sbin/cluconfig: [: hehe: unary operator expectedLooking for host hehe (may take a few seconds)…Information about Quorum PartitionsInformation About the Power Switch That Power Cycles Member ‘haha’Note: Operating a cluster without a remote power switch does not prmaximum data integrity guarantees.——————————–Information for Cluster Member 1——————————–/sbin/cluconfig: [: hehe: unary operator expectedLooking for host hehe (may take a few seconds)…Information about Channel 0/sbin/cluconfig: [: hehe: unary operator expectedLooking for host hehe (may take a few seconds)…Information about Channel 1/sbin/cluconfig: [: haha: unary operator expectedLooking for host haha (may take a few seconds)…Hostname does not map to any interface. Keep your selection? [yes]:Information about Quorum PartitionsInformation About the Power Switch That Power Cycles Member ‘hehe’Note: Operating a cluster without a remote power switch does not providemaximum data integrity guarantees.Press <Return> to continue. –按回车继续Cluster name: xixiCluster alias IP address: 192.168.2.13——————–Member 0 Information——————–Name: hahaPrimary quorum partition: /dev/raw/raw1Shadow quorum partition: /dev/raw/raw2Heartbeat channels: 2Channel type: net, Name: hahaChannel type: net, Name: hehePower switch IP address or hostname: hahaIdentifier on power controller for member haha: un——————–Member 1 Information——————–Name: hehePrimary quorum partition: /dev/raw/raw1Shadow quorum partition: /dev/raw/raw2Heartbeat channels: 2Channel type: net, Name: heheChannel type: net, Name: hahaPower switch IP address or hostname: heheIdentifier on power controller for member hehe: un————————–Power Switch 0 Information————————–Power switch IP address or hostname: hahaType: NONELogin or port: unusedPassword: unused————————–Power Switch 1 Information————————–Power switch IP address or hostname: heheType: NONELogin or port: unusedPassword: unusedSave the cluster member information? yes/no [yes]: –是否进行保存Writing to configuration file…doneConfiguration information has been saved to /etc/cluster.conf.Saving configuration information to quorum partitions: doneDo you wish to allow remote monitoring of the cluster? yes/no [yes]:—————————————————————-Configuration on this member is complete.Execute “/sbin/service cluster start” to start the cluster software.这时,双机软件基本配置已经完成,在两台主机上分别运行service cluster start启动服务通过cluadmin进行管理,如下所示:cluadmin> cluster statusCluster Status Monitor (xixi) 11:16:11Cluster alias: xixi========================= M e m b e r S t a t u s ==========================Member Status Node Id Power Switch————– ———- ———- ————haha Up 0 Goodhehe Up 1 Good========================= H e a r t b e a t S t a t u s ====================Name Type Status—————————— ———- ————haha <–> hehe network ONLINE========================= S e r v i c e S t a t u s ========================Last Monitor RestartService Status Owner Transition Interval Count————– ——– ————– —————- ——– ——-cluadmin>通过状态可以看到双机状态正常,但未加入任何服务,通过help可以看到帮助:cluadmin> helpcluster service apropos clear help version exit quitcluadmin> service add –加入一个服务Service name: disk –服务名称Preferred member [None]:haha –首选成员User script (e.g., /usr/foo/script or None) [None]: –用户脚本Status check interval [0]: –状态检测间隔Do you want to add an IP address to the service (yes/no/?) [no]:Do you want to add a disk device to the service (yes/no/?) [no]: yes –加disk设备Disk Device InformationDevice special file (e.g., /dev/sdb4): /dev/sdb3 –设备名称Filesystem type (e.g., ext2, or ext3): ext2 –文件系统类型Mount point (e.g., /usr/mnt/service1) [None]: /mnt –mount点Mount options (e.g., rw,nosuid,sync):Forced unmount support (yes/no/?) [yes]: –是否强制unmountWould you like to allow NFS access to this filesystem (yes/no/?) [no]:Would you like to share to Windows clients (yes/no/?) [no]:Do you want to (a)dd, (m)odify, (d)elete or (s)how DEVICES, or are you (f)inished adding DEVICES [f]:Add disk service as shown? (yes/no/?) yes –是否加入服务0) haha1) hehec) cancelChoose member to start service on: 0 –在首选哪台主机启动Added disk. –加入服务成功