freeradius 把nas client信息写入db并且从db读取

[

修改sql.conf

找到这一行改成yes就好了,就会去读取nas表中的client的信息了

readclients = yes

感谢夏天

[

我可以8点10分出发8点46到公司,骑车嘿哟嘿哟,

然后衣服湿透头发打湿,(黄蓉的歌?哦不对,原版是直到我头发花白牙齿掉光)

感谢这个夏天给我出汗的机会,可我不想全家人都这样。大家一起湿漉漉的多不好

电磁炉使用的注意事项

[

二、使用时注意:
1、切勿放置在不平稳的平面上。
2、切勿阻塞吸气口或排气口、避免炉内超温。
3、切勿在儿童可触及电磁炉、或儿童能自行使用的地方使用电磁炉。
4、切勿对空锅加热或加热过度。
5、切勿将诸如刀、叉、勺子、锅盖与铝箔等金属物品放置在顶板上,因为它们会受热。
6、切勿在盛放锅具的状态下搬运电磁炉。
7、切勿在四周空间不足的地方使用电磁炉、应使电磁炉的前部与左右两侧保持干净。
8、切勿使用金属丝和异物进入吸气或排气口的缝隙内。
9、切勿使物品跌落在顶板上。如表面出现裂纹,应立即关掉电源,拔出插头并送往修理。

 

为什么不能空锅加热呢,也就是说,你不能扔一个平底锅子到电磁炉上面干烧,哪怕只有1-2秒,里面必须加上水或者油等能产生电磁效应的媒介

因为,那样相当于让金属内部产生电磁效应,效果不亚于高炉炼钢,

电磁炉功率一般最大功率2000w,这样的功率会在2秒之内让锅底温度迅速升高至数百度,如继续工作,会直接导致炉面损坏,锅由于底面高温,而壁面温度较低而产生扭曲

 

附:电磁炉原理(记得左右手效应么?)

电磁炉工作原理

电磁炉作为厨具市场的一种新型灶具。它打破了传统的明火烹调方式采用磁场感应电流(又称为涡流)的加热原理,电磁炉是通过电子线路板组成部分产生交变磁场、当用含铁质锅具底部放置炉面时,锅具即切割交变磁力线而在锅具底部金属部分产生交变的电流(即涡流),涡流使锅具铁分子高速无规则运动,分子互相碰撞、摩擦而产生热能(故:电磁炉煮食的热源来自于锅具底部而不是电磁炉本身发热传导给锅具,所以热效率要比所有炊具的效率均高出近1倍)使器具本身自行高速发热,用来加热和烹饪食物,从而达到煮食的目的。具有升温快、热效率高、无明火、无烟尘、无有害气体、对周围环境不产生热辐射、体积小巧、安全性好和外观美观等优点,能完成家庭的绝大多数烹饪任务。因此,在电磁炉较普及的一些国家里,人们誉之为”烹饪之神”和”绿色炉具”。

赚钱真的不容易

[

从3号回来一直到地震前几天,一直在努力的做事情,赚钱,每一笔都花上好大力气才得到的,

虽然不多,几十块几十块,到后来也凑了几百,唉,我就是蓄水池那个进水管,

无奈出水管太粗,某人请理解下

ps,看到某些事情之后还是说出来的好,就好像在大地挖了个坑把想说的对着坑吼一通,然后巴拉巴拉埋了它,说出来就舒服了。

openvpn的mtu的问题

[

openvpn下依然存在mtu的问题,默认是1500,

根据经验,mtu应当低于1472
tun-mtu 1472tun-mtu-extra 32mssfix 1400配置需要在server和client都有
Hi there,

I recently set up a OpenVPN connection between two windows servers - a web frontend located in a DMZ, accessing an SQL database over the VPN network. As far as I can tell (the project is far from complete), that works just fine (100mbps ethernet connection between the two boxen). I also used OpenVPN to setup a "maintenance network", so I could log in from home and administer the web server box via RDP, without having to open port 3389 to the world.

I experienced the some difficulty with the "maintenance network" VPN connection:

After I set things up both local and remote, OpenVPN connected, and I was able to ping mentioned web server from my home box, thru the VPN. However, only pings with -l arguments smaller than 1459. I.e., a <ping 10.0.0.1 -l 1458> worked (remote host replied), but a <ping 10.0.0.1 -l 1459> would just give timeout. So I read the manual and tried fixmss 1300.. no go, still would not work. I might add that Im using a tcp connection, and dev tap for this.
Anyways, the solution was: I had to set the MTU on the virtual tap network interface to 1300, and magically, it werkz! (I suspect I could raise that to 1458 for better performance, but have not yet tried, as for now im perfectly happy *that* it works, no matter how fast it works :) . I also suspect I could use tun-mtu option to do this from the config file, right? I'll find out shortly...

Other issues I had with OpenVPN:

- Restarting the OpenVPN service sometimes (not definately sure under what circumstances) gives an error message "cannot create a file that is already there", with the OpenVPN service failing to re-start. The fix for this is to simply start the service again. I wonder tho what might cause this? Does it have something to do with my two VPN tunnels using the same key file (Im gonna change that later)? Might be of interest for developers...

- OpenVPN would not work with an IP defined on the TAP adapter - neither on the client nor on the server. A bit weird is, even tho it would not connect, the TAP adapter (I have it to "application controled") came alive on the client, so I was a bit confused as to why the client would connect, but the server doesnt see it. After I retought, I conclude thats "behaviour by design" - maybe add something to the documentation for newbies (like me :p), so they are not mislead by the TAP icon (connected/not connected), but check logs instead... :)

Tought I'd let you know, so u can fix, cuz ur little VPN program rocks! :) )
 
 
连不上一些网站的处理方法 MTU 修改
    在网络媒体的最大传输单位中 ( Maximum Transmission Unit, MTU;针对一个封包的体积而言 ),其实是有受限制的!如果我们设定了最大传输单位超过网络媒体所能负荷的,那么除非您的操作系统本身就支持封包重新组合,否则可能会造成封包无法传递的问题。此外,因为如果封包的体积与最大传输单位无法配合,导致封包在传送的时候一再地进行重组,将会导致网络传输效能的低落喔。所以啰,我们的网络卡的 MTU 设定最好能够针对网络接口进行最佳化,这样才能让网络效能变的比较好。(注:也就是说,MTU 这个数值并不是越大越好,而是要针对您的网络接口来进行最佳化)   另外,如果您曾经使用 Windows 2000 作为联机分享的主机时,可能会发现在 client 端发生『总是有些网站无法顺利的连接上去!但是在主机端则没有问题!』,或者是『客户端无法浏览某些网站或是无法发送内含附件的电子邮件』,这真是伤脑筋呀!其实,发生这样的问题通常就是与 MTU 的数值不正确有关的。如何解决呢?呵呵!需要藉由修改『每一个 Client 端计算机的 MTU 来修正』才行呐。一般而言,MTU 在网络卡 (EtherNet) 的默认值为 1500 单位!至于其它的接口如下:  
    网络接口
    MTU
    EtherNet (一般的网络接口,这也是默认值) 1500
    PPPoE(ADSL用的) 1492
    Dial-up(modem)  576
      由上面的表格我们可以知道,预设的网络接口 MTU 是 1500 ,那 PPPOE 使用的是 1492,自然而然的 MTU 要求并不相同,所以啦!有一些网页、邮件数据等等的咚咚就可能会因为这样而无法进行正确的传送呐。那该如何解决呢?其实只要调整 Client 端网络卡的 MTU 值即可完全解决此一问题!而且藉由调整 MTU 值也可以增进网络效率呢。 那首要课题自然就是知道您的网络卡所可以负荷的 MTU 啦!因此我们第一步就是要找到适合的 MTU 。  
    找出 MTU 值:   由于 MTU 与 Router 具有较大的关系,因此,我们通常是在 Client 端的计算机上,对我们的 Router (就是 NAT 主机,这部主机可能是 Linux 也可能是 Windows 系统喔!) 进行 MTU 数值的侦测呐。底下我们分别针对 Windows 与 Linux 进行 MTU 数值的检测喔。(注:假设您的 Router 的 IP 为 192.168.1.2 ):  
    • Windows 系统上的检测:  
      1. 进入 MS DOS 命令提示字符当中;  
      2. 输入『ping -f -l <bytes> IP』如下所示:
        C:\WINDOWS> ping -f -l 1500 192.168.1.2 Pinging 192.168.1.2 with 1500 bytes of data: Packet needs to be fragmented but DF set. Packet needs to be fragmented but DF set. Packet needs to be fragmented but DF set. Packet needs to be fragmented but DF set. Ping statistics for 192.168.1.2:     Packets: Sent = 4, Received = 0, Lost = 4 (100% loss), Approximate round trip times in milli-seconds:     Minimum = 0ms, Maximum =  0ms, Average =  0ms
        那个 -l 是 L 的小写,至于 bytes 则是本机送出的封包体积, IP 则是 Gateway 的 IP 。在上面的测试当中,当封包大小设定为 1500 时,结果出现了 Packet needs to be fragmented but DF set. 这个东西,意思是说,这个封包的体积大过于 MTU 能够接受的大小,但是由于我们下达了 -f 这个参数,所以封包没有办法重新组合,因此就发生了错误了!也就是说,如果要最佳化的话,那么 MTU 数值的设定要更小才行!OK!那么当我们使用 1464 来测试时:
        C:\WINDOWS>ping -f -l 1464 192.168.1.2 Pinging 192.168.1.2 with 1464 bytes of data: Reply from 192.168.1.2: bytes=1464 time=10ms TTL=128 Reply from 192.168.1.2: bytes=1464 time<10ms TTL=128 Reply from 192.168.1.2: bytes=1464 time<10ms TTL=128 Reply from 192.168.1.2: bytes=1464 time<10ms TTL=128 Ping statistics for 192.168.1.2:     Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:      Minimum = 0ms, Maximum =  10ms, Average =  2ms
        结果出现了响应了!这表示这一个 MTU 值是可行的!不过,强烈建议找出可行的最大 MTU 值!这样一来,在设定的时候,才可以达到最佳的网络速率!  
      3. MTU 数值的计算: 上面我们找到的数据其实是封包的体积大小,但是每个封包还都具有标头,这个标头的部分占去了 28 bytes ,所以啦,最终的 MTU 数值其实是 1464+28=1492 才对喔!
      • Linux 系统的检测:  
        1. 在终端机输入『ping -c <number> -M do -s <bytes> IP』,其中 number 是次数、<bytes>则是封包的体积。结果如下所示:
          [root@test root]# ping -c 3 -M do -s 1472 192.168.1.2 PING 192.168.1.2 (192.168.1.2) from 192.168.1.13 : 1472(1500) bytes of data. 1480 bytes from 192.168.1.2: icmp_seq=0 ttl=255 time=2.408 msec 1480 bytes from 192.168.1.2: icmp_seq=1 ttl=255 time=2.392 msec 1480 bytes from 192.168.1.2: icmp_seq=2 ttl=255 time=2.440 msec   — 192.168.1.2 ping statistics — 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max/mdev = 2.392/2.413/2.440/0.044 ms   [root@test root]#ping -c 3 -M do -s 1473 192.168.1.2 PING 192.168.1.2 (192.168.1.2) from 192.168.1.13 : 1473(1501) bytes of data. ping: sendto: Message too long ping: sendto: Message too long ping: sendto: Message too long — 192.168.1.2 ping statistics — 3 packets transmitted, 0 packets received, 100% packet loss
          呵呵!结果就可以发现数值为 1472 啰!其它的就如同前面提到的,MTU = 1472 + 28 = 1500 啦!  
      所以要找出 MTU 值真的是不难喔!  
      修改 MTU 值:   OK!我们已经找出 MTU 值啦,那下一步自然就是修改啰!要如何修改呢?其实也是很简单,只要透过 Windows 本身预设的 registry 修改即可!至于 Linux 则以 ifconfig 来更改吧!  

        Windows 98:  
        1. 在 『开始』>『执行』中,键入<regedit>,会出现一个大框框;  
        2. 选择:『HKEY_Local_Machine』>『System』>『CurrentControlSet』>『Services』>『Class』>『NetTrans』>『000n』上面最后一个数据是 000n,那个 n 指的是数字,以我为例,在 NetTrans 底下有两个数字,分别为 0000 与 0002,若按下 0000 会显示我的 Gate Way 以及我的网络卡的 IP 项目,至于 0002 则没有我的网络卡的相关信息,所以 0000 那这一个就是我的网络卡接口啦!请依您的情况选择!  
        3. 选择您的网络卡接口后 ( 以我为例,按一下 0000 那一个机码 ) ,按下『编辑』>『新增』,然后选择增加『DWORD』值;
             
        4. 将新增的机码取名为『MaxMTU』,并且在新增加的那个机码上面按右键,选『修改』,会出现如下画面,选择『十进制』后,输入刚刚我们找到的那一个 MTU 值:
             
        5. 改完之后您应该会看到如下的画面喔!那就是成功了!
         
        Windows 2000:  
        1. 在 『开始』>『执行』中,键入<regedit>,会出现一个大框框 ( 注意,也有可能是 regedit32 这个执行档,请依您的机器来作业 );  
        2. 选择『HKEY_Local_Machine』>『SYSTEM』>『CurrentControlSet』>『Services』>『Tcpip』>『Parameters』>『interface』,有点像下面的图示:
             
        3. 在 interface 底下可能有很多的接口,您一个一个的去看,会有一个接口与您的网络卡的 IP 相同,那个就是您要挑选的接口啦!然后同样的在该接口上选择『编辑』>『新增』>『DWORD值』之后,建立一个名为『MTU』的机码,然后选右键『修改』,选择十进制,填入我们刚刚找出来的 MTU 值!大功告成!
         
        Linux:   在 Linux 上面的更新要简单的多了!使用 ifconfig 加上 mtu 这个参数即可!例如:  
        [root@test root]# ifconfig eth0 mtu 1500
          这样就成功的修订了!简单的很吧! ^_^
        基本上,这样应该已经可以解决 MTU 无法搭配的问题了!相关的网页您可以到底下两个网页去看看! http://www.microsoft.com/taiwan/msclub/member/TIPS/Spring_2001/tip1to3/tip1to3_2.htm   另外,网友有建议另一个测试 MTU 的网页,您也可以上去瞧一瞧,不过,要上这个网页之前,『请先将您的代理服务器设定 取消』否则测到的会是您的 Proxy 而不是您的 IP 喔! http://forums.speedguide.net:8117/
                以前用网关路由器拨号上网时使用微软的东西是没有问题的。现在换成用 Debian 拨号再使用 iptables SNAT 后,MSN 就不能登陆了,打开 www.msn.com.cn 非常慢且只能打开页面的头部,而 windowsupdate.microsoft.com 根本就打不开了。 google 后得知修改 PC 网卡的 MTU 值可以解决这个问题。在 Windows 2000/XP 下修改注册表:『HKEY_Local_Machine』->『SYSTEM』->『CurrentControlSet』->『Services』->『Tcpip』->『Parameters』->『interface』找到所使用的网卡,『编辑』->『新增』->『DWORD值』之后,建立一个名为『MTU』的机码,右键『修改』,选择十进制,填入 1480 。 但是,这个方法很蹩脚呢,内网中的机器那么多,一个一个去改是很不现实的。对网关进行修改才是正道。 在网关服务器上,# ip addr sh发现 ppp 设备的 mtu 值是 1492 。就在 /etc/ppp/peers/dsl-provider 文件中取消了“mtu 1492”这行的注释并改为了 1480 ,重新拨号却没有变化。在 /var/log/messages 中还看到这样的信息:Couldn’t increase MTU to 1500Couldn’t increase MRU to 1500没有设置 mtu 值的时候也会有这样的信息,这就意味着 pppoe 忽略了 mtu 这个参数。 没办法,继续 google ,有说 plugin rp-pppoe.so 有 bug ,就注释掉这行,改用pty “/usr/sbin/pppoe -I eth1 -T 80 -m 1480″结果根本不能拨号了。-_-!软的不行就来硬的,直接# ifconfig ppp0 mtu 1480这下 MSN 能登陆了,但是微软的网站还是打不开。 注:Redhat 可以修改 /etc/sysconfig/networking-script/ifcfg-ppp0 ,添加 CLAMPMSS=1480 。 最后的解决办法——用 iptables 改 MTU 值。# iptables -A FORWARD -o ppp0 -p tcp –tcp-flags SYN,RST SYN -m tcpmss –mss 1400:1536 -jTCPMSS –clamp-mss-to-pmtu把出站包大小改为 ppp0 的 MTU 尺寸,这下就一切正常了。MSS 既 Max Segment Size 。 参考资料:鸟哥的 Linux 私房菜——连不上一些网站的处理方法 MTU 修改  另记:由于 Microsoft Windows 系列操作系统传送的 TCP 包请求的 segment 太大,超出了 PPPoE 的 frame 所能够接受的范围,导致 PPPoE 传送“don’t fragment”的 ICMP 而不是“must fragment”,最终导致网站没有响应。这种情况称为“Black Hole Router”。—— 2006.05.13 00:30 又看了一下 /etc/ppp/ip-up.d 下的脚本,发现 0clampmss 里的内容是这样的:#!/bin/sh# Enable MSS clamping (autogenerated by pppoeconf)iptables -o “$PPP_IFACE” –insert FORWARD 1 -p tcp –tcp-flags SYN,RST SYN -m tcpmss –mss 1400:1536 -j TCPMSS –clamp-mss-to-pmtu看来 Debian 的 pppoe 也早有考虑。我在做 SNAT 前清空了 iptables 规则,造成 pppoe 添加的 iptables 规则失效了。—— 2006.06.01 13:48
                                iptables nat 的相关知识是入了广典之后,kiever 教我的了。基础理论就不阐述了,做一点零碎的笔记。 大多数情况下做好 SNAT 或者 MASQUERADE 之后就可以正常让内网用户上网了,但最近在家遇到一个现象: 访问淘宝等网站的时候,浏览器一直处于“等待网站返回数据”的状态。 在CU上询问之后,知道是 TCP-MSS 的问题。简单的说,就是MTU没有协商好,导致许多数据包被丢掉了。至于MTU应该是多少,各个ISP都不同。复杂的说,请看这里。 于是在 iptables 规则中加入这一句就可以解决了: -A POSTROUTING -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu –clamp-mss-to-pmtu 意为动态协商 MSS,当然你也可以指定,但要根据ISP的情况。事实上有些时候取决于你访问的网站和你机器之间。 但还有一个问题,只有 TCPMSS 写在第一句的时候,才生效。不然 iptables 读过 SNAT 之后就不读 TCPMSS 了,反之却都读。还不知道为何。 问题已经找到了~ 修改包特性的一些改变,应该放在 mangle 表里面操作。这样就不会冲突了。

                              freeradius2 的更新

                              [

                              从1.1.0开始弄freeradius,今天发现已经更新到2了,编译安装后发现找不到sql相关的东西了,

                              最后在etc/raddb/sites-enabled/inner-tunnel发现原来都移动到这里了

                              搜索sql,注释掉前面的#

                              同时要把有files的地方注释掉它,有三个地方的log需要取消注释

                              久其原因,是因为freeradius支持了虚拟server的概念

                              As of 2.0.0, FreeRADIUS supports virtual hosts using the
                              #       “server” section, and configuration directives.
                              #
                              #       Virtual hosts should be put into the “sites-available”
                              #       directory.  Soft links should be created in the “sites-enabled”
                              #       directory to these files.  This is done in a normal installation.
                              #

                               

                              实在没搞定,因为freeradius2开始加强了加密,目前完全找不到可以参考的配置文档,官方也没有,还是乖乖用1.16吧

                              openvpn配合radius的另一个插件

                              [

                              07年4月的时候被逼的用openvpn调用pam,再调用radius来实现了认证

                              more.asp?id=2485

                              现在有方便的openvpn直接配合radius的程序了

                              http://www.nongnu.org/radiusplugin/index.html

                              使用这个需要 libgcrypt的头文件,需要 libgcrypt-devel

                              所以需要yum install  libgcrypt-devel

                              否则,直接出现RadiusClass/RadiusAttribute.h:24:20: gcrypt.h: No such file or directory

                              [root@s5s18 radiusplugin_v2.0b]# make
                              OBJ:  RadiusClass/RadiusAttribute.o
                              OBJ:  RadiusClass/RadiusPacket.o
                              OBJ:  RadiusClass/RadiusConfig.o
                              OBJ:  RadiusClass/RadiusServer.o
                              OBJ:  RadiusClass/RadiusVendorSpecificAttribute.o
                              OBJ:  AccountingProcess.o
                              OBJ:  Exception.o
                              OBJ:  PluginContext.o
                              OBJ:  UserAuth.o
                              OBJ:  AcctScheduler.o
                              OBJ:  IpcSocket.o
                              OBJ:  radiusplugin.o
                              OBJ:  User.o
                              OBJ:  AuthenticationProcess.o
                              OBJ:  main.o
                              OBJ:  UserAcct.o
                              OBJ:  UserPlugin.o
                              OBJ:  Config.o
                              BIN:  radiusplugin.so

                              生成了so文件之后拷贝到openvpn的配置目录

                              cp radiusplugin.so /etc/openvpn/.

                              编辑插件的配置文件

                              vi /etc/openvpn/radiusplugin.cnf

                               

                              NAS-Identifier=OpenVpn
                              Service-Type=2
                              Framed-Protocol=1
                              NAS-Port-Type=5
                              NAS-IP-Address=192.168.13.1
                              OpenVPNConfig=/etc/openvpn/server.conf
                              #overwriteccfiles=true
                              #subnet=255.255.255.0
                              #p2p=10.10.0.1
                              server
                              {
                                      acctport=1813
                                      authport=1812
                                      name=192.168.12.1
                                      retry=1
                                      wait=1
                                      sharedsecret=passwd

                              }

                               

                              下面这个是官方的说明

                              — Beginning —
                              # The NAS identifier which is sent to the RADIUS server
                              NAS-Identifier=OpenVpn# The service type which is sent to the RADIUS server
                              Service-Type=5
                              # The framed protocol which is sent to the RADIUS server
                              Framed-Protocol=1
                              # The NAS port type which is sent to the RADIUS server
                              NAS-Port-Type=5
                              # The NAS IP address which is sent to the RADIUS server
                              NAS-IP-Address=127.0.0.1
                              # Path to the OpenVPN configfile. The plugin searches there for
                              # client-config-dir PATH   (searches for the path)
                              # status FILE                      (searches for the file, version must be 1)
                              # client-cert-not-required (if the option is used or not)
                              # username-as-common-name  (if the option is used or not)
                              OpenVPNConfig=/etc/openvpn/radiusvpn.conf
                              # Support for topology option in OpenVPN 2.1
                              # If you don’t specify anything, option “net30″ (default in OpenVPN) is used.
                              # You can only use one of the options at the same time.
                              # If you use topology option “subnet”, fill in the right netmask, e.g. from
                              # OpenVPN option “–server NETWORK NETMASK”
                              #subnet=255.255.255.0
                              # If you use topology option “p2p”, fill in the right network, e.g. from OpenVPN
                              # option “–server NETWORK NETMASK”
                              #p2p=10.10.0.1
                              ####################### Ich benutze die Default Option
                              # Allows the plugin to overwrite the client config in client config file directory,
                              # default is true
                              overwriteccfiles=true
                              # Path to a script for vendor specific attributes.
                              # Leave it out if you don’t use an own script.
                              # vsascript=/root/workspace/radiusplugin_v2.0.5_beta/vsascript.pl
                              # Path to the pipe for communication with the vsascript.
                              # Leave it out if you don’t use an own script.
                              # vsanamedpipe=/tmp/vsapipe
                              # A radius server definition, there could be more than one.
                              # The priority of the server depends on the order in this file. The first one
                              # has the highest priority.
                              server
                              {
                                  # The UDP port for radius accounting.
                                  acctport=1813
                                  # The UDP port for radius authentication.
                                  authport=1812
                                  # The name or ip address of the radius server.
                                  name=127.0.0.1
                                  # How many times should the plugin send the if there is no response?
                                  retry=1
                                  # How long should the plugin wait for a response?
                                  wait=1
                                  # The shared secret.
                                  sharedsecret=Hier das Secret aus der client.conf des Radius-Servers
                              }
                              — End of file —

                              apache 反盗链的两种方式

                              [


                              防盗链原理:

                              http标准协议中有专门的字段记录referer

                              一来可以追溯上一个入站地址是什么

                              二来对于资源文件,可以跟踪到包含显示他的网页地址是什么。

                              因此所有防盗链方法都是基于这个Referer字段

                              主要有两种方法实现


                              第一种:使用FilesMatch
                              <VirtualHost *:80>
                                  ServerAdmin laogui@gmail.com
                                  DocumentRoot D:/www/www.chinahtml.com
                                  ServerName www.aaa.com
                                  ServerName aaa.com
                                  盗用连接指定显示的页面。也可以不用此项,这样盗用连接也可无法使用。
                                  ErrorDocument 404 http://www.chinahtml.com/error.html
                                  允许www.aaa.com的网站使用
                                  SetEnvIfNoCase Referer "^http://www.aaa.com" local_ref=1
                                  允许 aaa.com  的网站使用
                                  SetEnvIfNoCase Referer "^http://aaa.com" local_ref=1
                                  定义防盗文件的扩展名
                                    <FilesMatch "\.(gif|jpg|png|css|js|swf)">
                                      Order Allow,Deny
                                      Allow from env=local_ref  允许上面指定域名
                                  </FilesMatch>

                              </VirtualHost>
                               
                               

                              防盗链设置样本:使用正则表达式

                              SetEnvIf Referer "^http://(.)+\.ilinux\.cn/" local_ref=1

                              SetEnvIf Referer "^http://(.)+\.isql\.cn/" local_ref=1
                              #SetEnvIf Referer "^http://(.)+\.other\.org\.cn/" local_ref=1

                              SetEnvIf Request_URI "/logo(.)+" local_ref=0
                              <FilesMatch "\.(mp3|wmv|png|gif|jpg|jpeg|avi|bmp|ram|rmvb|rm|rar|zip|mp3)">
                              Order Allow,Deny
                              Allow from env=local_ref
                              </FilesMatch>

                              解释:
                              1. 蓝色部分,表示设置允许访问的referer地址,第一行的意思为所有http协议访问,以.ilinux.cn结尾的域名地址,第二行类似,只是换成了.isql.cn,表问我前面的鬼符是什么,不懂得可以去翻正则表达式的研究文献,不想深究的可以照猫画虎设置自己的网站。
                              2. 绿色部分,表示不在上述引用域名范围内,但可以被放行的特例,本例中表示网站/目录,所有以logo开头的文件(用作允许其它网站的友情连接引用本站logo)。
                              3. 橙色部分是设置反盗链的关键部分,上面每一个设置都联系到了local_ref这个环境变量,只有这个变量为1,则允许被引用,否则显示一个X。
                              4. 紫色部分设置了哪些扩展名的文件加入反盗链的规则。

                              第二种方法:

                              使用rewirte方式:

                              RewriteEngine on
                              RewriteCond %{HTTP_REFERER} !^$
                              RewriteCond %{HTTP_REFERER} !^http://bbs.ilinux.cn/.*$    [NC]
                              RewriteCond %{HTTP_REFERER} !^http://bbs.ilinux.cn$      [NC]
                              RewriteCond %{HTTP_REFERER} !^http://www.ilinux.cn/.*$      [NC]
                              RewriteCond %{HTTP_REFERER} !^http://www.ilinux.cn$      [NC]
                              RewriteCond %{HTTP_REFERER} !^http://ilinux.cn/.*$      [NC]
                              RewriteCond %{HTTP_REFERER} !^http://ilinux.cn$      [NC]
                              RewriteRule .*\.(gif|jpg|jpeg|avi|bmp|ram|rmvb|rm|rar|zip)$ http://www.ilinux.cn [R,NC]
                              上面的,需要Rewrite模板.所有指定的文件,如果Referer不是上面的值,将被重定向到首页.

                              还有使用.htaccess 文件的方法,不过不推荐使用,影响apache性能。
                              写一个.htaccess
                              包括以下代码:

                              SetEnvIfNoCase Referer “^http://google\.com/” local_ref=1
                              <FilesMatch “\.(jpg)”>
                              Order Allow,Deny
                              Allow from env=local_ref
                              Allow from 127.0.0.1
                              Allow from 123.123.123.123
                              </FilesMatch>

                              如果你的网址是www.myst.cn就改为
                              SetEnvIfNoCase Referer “^
                              http://www\.myst\.com/” local_ref=1
                              <FilesMatch “\.(jpg)”>
                              这意思是说防止人家连结你的jpg档案.可以增修为
                              <FilesMatch “\.(jpg|zip|rar)”>
                              ps.最后一个不使用区各线
                              Allow from 127.0.0.1
                              这表示允许连结主机的IP。
                              你要是默认其他网站可以连结的话,就填入该主机IP,把上述的code储存为.htaccess然后放入你安装的目录下即可。

                               
                              *nix系统在apache配置文件里面打开使用.htaccess功能。
                              AllowOverride All

                              整个成都人民再次消失

                              [

                              19日晚21点开始,移动、联通、小灵通再次出现堵塞,

                              成都人民的电话再次无法打通,全国的人民都很着急,

                              但是有啥用?通讯厂商的冗余只能考虑几倍平时通话量,现在是所有用户一起在拨,

                              宕机吧,

                              5月17日sctv-4汶川地震专题与陈坚连线的主持人信息-蒋礼

                              [

                              籍贯:四川
                              生日:7月9日
                              星座:巨蟹座]
                              血型:A
                              爱好:旅游、听歌、看书、美食
                              人生格言:谋事在人,成事在天
                              曾主持过的节目:《新闻杂志》、《新闻现场》

                              从2000年进入电视传媒行业,一路走来,我很忙碌,也很幸福。虽然每天都在应对着不同新
                              闻的发生,重复再重复的日子,习惯并喜欢,愉快的心情让我的每一天都过得很充实!
                              有人说,四川的女孩活泼、热情;也有人说,四川的女孩细腻、温柔。A型血的我呢,却是
                              两者兼有!熟识的朋友们都说我是她们的开心果,虽然有时会有些大大咧咧、唠唠叨叨,但
                              这样的我,才是她们所喜欢的。
                              每当新的一天开始,拉开窗帘,灿烂的阳光就铺满了我的双眼,每天的生活对于我来说,都
                              是阳光般的美好。9个月的小宝贝,更是给我的生活带来了无尽的乐趣,让初为人母的我享
                              受了天伦之乐。
                              生活如此美好,在享受每一天的美好生活时,我愿意把这份心情通过我的微笑传递给所有我
                              认识和不认识的朋友们,愿你们永远幸福、快乐!

                              由于她人气不高,找不到近期的主持照片,

                              百度贴吧:http://tieba.baidu.com/f?kw=%BD%AF%C0%F1

                              生活照