如何实现局域网架设BT服务器


如何实现局域网架设BT服务器
2011年05月08日
    国际海员    var diarydays="";    .calendarBigBorder { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; text-decoration: none; width: 170; background-color: #FFFFFF; font-size: 9pt;border:1px dotted #999; } .calendarTd { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; font-size: 9pt; color: #000000; background-color: #eeeeee; height: 18px; width: 11%; text-align: center;} .calendarMInput { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; font-size: 8pt; text-decoration: none; background-color: #FFFFFF; height: 16px; border: 1px solid #666666; width: 19px; color: #0099FF; margin: 0px 5px; text-align: center;} .calendarYInput { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; font-size: 8pt; color: #0099FF; text-decoration: none; background-color: #FFFFFF; height: 16px; width: 34px; border: 1px solid #666666; margin: 0px 5px; text-align: center;} .calendarMonthTitle { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; font-size: 9pt; font-weight: normal; height: 24px; text-align: center; color: #333333; text-decoration: none; background-color: #eeeeee; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-bottom-style: none; border-top-color: #999999; border-right-color: #999999; border-bottom-color: #999999; border-left-color: #999999;} .calendarNow { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; font-size: 9pt; font-weight: bold; color: #000000; background-color: #C0C9D3; height: 18px; text-align: center;} .calendarDaySat { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; font-size: 9pt; color: #333333; text-decoration: none; background-color: #eeeeee; text-align: center; height: 18px; width: 12%;} .calendarDaySun { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; font-size: 9pt; color: #333333; text-decoration: none; background-color: #eeeeee; text-align: center; height: 18px; width: 12%;} .calendarLink { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; font-size: 9pt; font-weight: normal; color: #333333; text-decoration: none; background-color: #E7E7F6; text-align: center; height: 18px;} .categoryTxt { font-family: "Arial", "Helvetica", "sans-serif", "宋体"; font-size: 9pt; line-height: 23px; color: #333333; text-decoration: none;} .categoryTable { border-right-width: 1px; border-bottom-width: 1px; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-right-color: #000000; border-bottom-color: #000000; border-top-width: 1px; border-top-style: solid; border-top-color: #71b99c;}   var months = new Array("一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"); var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); var days = new Array("日", "一", "二", "三", "四", "五", "六"); var classTemp; var calendarHover="calendarHover"; var today=new getToday(); var year=today.year; var month=today.month; var newCal; //得到某月天数 function getDays(month, year) { if (1 == month) return ((0 == year % 4) && (0 != (year % 100))) ||(0 == year % 400) ? 29 : 28; else return daysInMonth[month]; } //得到当天时间信息 function getToday() { this.now = new Date(); this.year = this.now.getFullYear(); this.month = this.now.getMonth(); this.day = this.now.getDate(); } //生成日历 function Calendar() { newCal = new Date(year,month,1); today = new getToday(); var day = -1; var startDay = newCal.getDay(); var endDay=getDays(newCal.getMonth(), newCal.getFullYear()); var daily = 0; if ((today.year == newCal.getFullYear()) &&(today.month == newCal.getMonth())) day = today.day; var caltable = document.all.caltable.tBodies.calendar; var intDaysInMonth =getDays(newCal.getMonth(), newCal.getFullYear()); for (var intWeek = 0; intWeek "; if(day==daily) cell.className="calendarNow"; else if(diarydays.indexOf(d)!=-1) cell.className="calendarLink"; else if(intDay==6) cell.className = "calendarDaySat"; else if (intDay==0) cell.className ="calendarDaySun"; else cell.className="calendarTd"; if ((daily > 0) && (daily 11) { month=0; year=year+1; } else { month=month+1; } Calendar(); } //得到响应事件 function getDiary() { var mon=(newCal.getMonth()+1)"; if ("TD" == event.srcElement.tagName) if (("" != event.srcElement.innerText)&&(diarydays.indexOf(d) !=-1)) { diary.location="/sun_jianhua/archive/"+newCal.getF ullYear()+"/"+mon+"/"+day+".aspx"; window.location.href = diary.location; } } function setDate() { if (document.all.month.value12) { alert("月的有效范围在 1-12 之间。"); return; } year=Math.ceil(document.all.year.value); month=Math.ceil(document.all.month.value-1); Calendar(); }      年月  >>     document.write("" + days[0] + ""); for (var intLoop = 1; intLoop " + days[intLoop] + ""); document.write("" + days[intLoop] + "");      for (var intWeeks = 0; intWeeks "); for (var intDays = 0; intDays "); document.write(""); }     Calendar();        快讯:               var strQ="http://www.google.com/search?lr=lang_zh-CN&q =";   中文搜索           var strMapGsuoQ = "http://www.gsuo.com/mstmap50007/g_detail.jsp?g_ma pid=21&g_label="; function show_map() { var addr = encodeURIComponent(encodeURIComponent(encodeURICom ponent(document.all.mapGsuoQ.value))); var strURL=strMapGsuoQ+addr +"&keyname="+addr; window.open(strURL); return true; }   上海地图查询         MSN:[email protected]        
  
  
  
  
  
  
  
  
  
  
  
  BT是一种互联网上新兴的的P2P传输协议,全名叫"BitTorrent",中文全称:"比特流" ,最初的创造者是Bram Cohen,现在则独立发展成一个有广大开发者群体的开放式传输协议。BT创始人为布拉姆.科恩,BT已经被很多个人和企业用来在互联网上发布各种资源,其好处是不需要资源发布者拥有高性能服务器就能迅速有效地把发布的资源传向其他的BT客户软件使用者,而且大多数的BT软件都是免费的,今天让小编来介绍一下如何配置BT服务器。
  一、软件下载
  在安装"BT服务器"前,我们需要准备以下几种软件:
  1.Python软件包(http://d.download.csdn.net/down/606527/pdsfly)
  Python是一种面向对象的解释性的计算机程序设计语言,也是一种功能强大而完善的通用型语言,同时也是用来编写BT服务器软件的编程语言,BT服务器程序的运行需要它的支持。
  软件名称:Python23
  软件语言:英文
  
  2.BitTorrent服务器程序(zou_seafarer)
  这是BT的服务器程序,服务器的所有功能都是由它提供的,它是使用Python语言编写的。
  软件名称:BitTorrent
  软件大小:960KB
  软件语言:英文
  
  3.Web服务器
  BT服务器需要Web服务器的支持才能在局域网中发布BT共享资源,如利用局域网论坛发布BT资源。我们以Windows 2003 Server平台为例,使用系统自带的IIS Web服务器就可以满足需要,点击"控制面板→添加或删除程序→添加/删除Windows组件"便可安装IIS组件,当然也可以通过"配置您的服务器向导"进行安装。
  4.发布制作工具completedir
  该工具用来制作".torrent"文件,BT服务器就是通过此文件来实现资源共享的。
  软件名称:completedir
  软件大小:2.90MB
  5.BT下载工具
  BT下载工具是一个多点下载的P2P软件,使用非常方便,很适合软件下载。其特点是:下载的人越多,速度越快。这个版本更新比较快,在这里就不提供下载链接(网上提供很多下载链接)。
  软件名称:bitcomet
  软件大小:2.74MB 
  二、配置BT服务器
  首先,将下载的Python软件包安装到服务器的目录(如"D:\python"),BitTorrent服务器源程序解压到"D:\bittorrent"目录下。
  然后,进入"D:\bittorrent",编写一个BT服务器运行程序"server.bat"文件,内容为"D:\python\python bttrack.py -port 6969 -dfile dstate",其中,"python"程序用于解释"bttrack.py"文件,"-port"和"-dfile"定义了服务器所使用的参数,"6969"为服务器使用的端口号。
  最后,双击"server.bat",便可启动BT服务器。 
  三、发布局域网BT资源
  虽然我们已经启动了BT服务器,但这时用户还是不能使用BT共享资源,必须发布这些资源。
  1.安装下载的completedir软件包,completedir会自动安装到系统中"Program Files"目录的"completedir"目录,如"D:\Program Files\completedir"。
  现在就可以用completedir制作".torrent"文件,把要发布的文件统一放到"E:\mp3"目录下,再运行"btcompletedirgui.exe"程序。
  2.在"build type"单选框中选择"standalone directory"选项。因为我们要发布"E:\mp3"目录下的所有文件,因此要在"target to build"栏中点击"Select"按钮(图1),选择将要发布的"E:\mp3"文件夹。在"announce url"栏中填入"http://192.168.0.1:6969/announce",其中"192.168.0.1"为BT服务器的IP地址,"6969"为使用的端口号。"piece size"采用默认值即可。
  
  图1
  以上项目都填好后,点击"Make"按钮,接着弹出创建"mp3.torrent"文件的进度窗口(图2),创建完成后,"completedir"程序就会在"E:\"根目录下生成一个名为"mp3.torrent"的文件。
  
  图2
  3.将此文件拷贝到IIS主目录"D:\Inetpub\wwwroot"下。局域网用户可以通过在IE浏览器中输入"http://192.168.0.1/mp3.torrent"下载到该文件,但这种方法用于发布大量的局域网共享资源是非常麻烦的,而且用户也很难记住发布文件的URL路径。建议将做好的发布文件上传到局域网论坛中,这样用户很容易找到自己所需要的共享资源。
  4.双击E盘根目录下的"mp3.torrent"文件,选择保存目录,一定要选择制作"mp3.torrent"的目录"E:\mp3"。这时BT会扫描该目录中已经存在的文件(图3),扫描完毕,BT认为这个文件是完整的,就可以开始提供上传服务,这样你成为第一颗种子,等待别人来下载。保持BT窗口不关闭,直到有人完全下载完毕,只要他也不关闭BT窗口,他就成为第二颗种子。
  

猜你喜欢

转载自nytak17v.iteye.com/blog/1363091