由于资源服务器是win2003 32位的操作系统,安装了星外科技的linkgate。而web服务器则是64位的2008,因此在配置上有了些新的变化,记录如下:
资源服务器上启用linkgate的一代防盗链功能,并增加了线程和速度限制。
2008web服务器上需要做的一些事情:
到
1、复制2003系统中linkgate安装目录下的 xcom64.dll 到 2008web服务器的 c:\windows\system32 目录下,并运行 regsvr32 xcom64.dll 进行注册;
2、复制2003系统中linkgate安装目录下的 xcom.dll 到 2008web服务器的 c:\windows 目录下,并运行 %systemroot%\syswow64\regsvr32 c:\windows\xcom.dll /s 进行注册;
3、修改程序文件,获得验证
帝国6.6直接使用5.1的文件则可。
DX2.0需要修改的文件则是 source\module\forum\forum_viewthread.php ,查找 return $post; 在上面增加:
//--------------------------------linkgate---------------------------------------------------------------
$Inconlinkgate=$post['message']; //原始的内容
$superkey="123456"; //超级防盗链功能I代的共享码,必须是数字(8个字节以内),要和配置文件一样
$CIP=$_SERVER['REMOTE_ADDR'];
$superprotecttype=".rm|.rmvb|.wmv|.wma|.mp3|.wav|.mpg|.mpeg|.avi|.swf|.pdf|.asf|.exe|.zip|.rar|.msi|"; //超级防盗链功能所保护的文件类型
$LinkGate=new COM("LinkGate") or die("无法加载防盗链组件");
$LinkGate->changedir=false;//false代表采用?连接字符串的方式加密网址,true代表采用采用改变目录名的方式来加密网址。
//第一个要加密的域名
$ausite="http://down.abc.com";//要保护的网址一
$strSTART='"';//查找的开始字符串
$strEnd='"';//查找的结束字符串
$Inconlinkgate=$LinkGate->XMUBB($Inconlinkgate,$ausite,$strSTART,$strEnd,$superkey, $CIP, $superprotecttype);
$strSTART=">";//查找的开始字符串
$strEnd="<";//查找的结束字符串
$Inconlinkgate=$LinkGate->XMUBB($Inconlinkgate,$ausite,$strSTART,$strEnd,$superkey, $CIP, $superprotecttype);
//第二个要加密的域名
$ausite="http://soft.123.com";//要保护的网址二
$strSTART='"';//查找的开始字符串
$strEnd='"';//查找的结束字符串
$Inconlinkgate=$LinkGate->XMUBB($Inconlinkgate,$ausite,$strSTART,$strEnd,$superkey, $CIP, $superprotecttype);
$strSTART=">";//查找的开始字符串
$strEnd="<";//查找的结束字符串
$Inconlinkgate=$LinkGate->XMUBB($Inconlinkgate,$ausite,$strSTART,$strEnd,$superkey, $CIP, $superprotecttype);
$post['message'] =$Inconlinkgate; //输出处理后的内容
//-----------------------------------------linkgate end-------------------------------------------------------