ºìÁªLinuxÃÅ»§
Linux°ïÖú

ÔÚLinuxÏ°²×°BT·þÎñÆ÷

·¢²¼Ê±¼ä:2005-12-19 10:33:31À´Ô´:ºìÁª×÷Õß:cha
תÌù

Ç°¼¸ÌìÓ¦¹«Ë¾ÐèÒª£¬ÔÚͬʵİïÖúÏÂ(֮ǰ±¾ÈË´ÓûÓÐÓùýBT£¬¸ü±ð˵¼Ü·þÎñÆ÷ÁË)£¬ÔÚlinuxÉϼÜÁËÒ»¸öBT·þÎñÆ÷£¬ÔËÐÐÎȶ¨£¬ÏÖÏò´ó¼Ò½éÉÜһϣ¬Ï׳óÁË :oops: ¡£
1¡¢ BT¼ò½é
BitTorrentÊÇÒ»ÖÖÐÂÐ͹²ÏíÈí¼þ·½Ê½£¬ÓÅÊÆÔÚÓÚ²»ÏÞÖÆÏÂÔØ´ø¿íºÍÁª½ÓÏß³ÌÈÔÄÜÌṩ¸ßËÙÏÂÔØ·þÎñ£¬ÏÂÔصÄÈËÔ½¶à£¬ÏÂÔØËٶȲ»Ï½µ·´¶ø¸üÎȶ¨£¬Ïà±ÈÖ®ÏÂFTP½öÄÜÌṩһ¶¨ÊýÄ¿ÄÚµÄÁª½ÓºÍÓÐÏ޵Ĵø¿í(ÏÂÔصÄÈËÔ½¶à£¬ËÙ¶ÈÔ½Âý) BitTorrent¸üÊʺϴóÎļþµÄÏÂÔØ¡£
2¡¢ ÏÂÔØ°²×°python
BitTorrent-3.4.2ÒªÇópythonµÄ°æ±¾ÔÚ2.xÒÔÉÏ£¬Èç¹ûÄ㻹ÓõÄÊÇpython-2.xÒÔϵİ汾Çëµ½ http://www.python.org/ftp/python/2.3.4/Python-2.3.4.tgz ÏÂÔØpythonµÄ×îа汾£¬È»ºó£º
1) tar -zxvf python-2.3.4.tgz
2)cd python-2.3.4
3)configure -prefix=/usr/local/python-2.3.4
4)make && make install
5)mv /usr/bin/python /usr/bin/python-1.5
6)ln -s /usr/local/python-2.3.4/bin/python /usr/bin/python
OK, ºÍÒ»°ãlinuxϱ༭°²×°Èí¼þÒ»Ñù£¬Python °²×°Íê³ÉÁË¡£
4¡¢ÏÂÔØ°²×°BitTorrent
Äã¿ÉÒÔµ½ http://bitconjurer.org/BitTorrent/download.html È¥ÏÂÔØ×îеÄ*nuxÏÂÓõÄtar »òzip °ü£¬È»ºó½øÐа²×°£º
1£© tar -zxvf BitTorrent-3.4.2.tar.gz
2£© cd BitTorrent-3.4.2 (BitTorrent²»ÓÃÔÙÈ¥±à¼­£¬Ö±½Ó¾Í¿ÉÒÔÓÃÁË¡£)
5¡¢Æô¶¯BitTorrentµÄtrack·þÎñ£¬Õâ¸ö·þÎñÓÃÀ´¸ú×Ù¡¢·Ö·¢ËùÓÐÏÂÔØÇé¿ö
./bttrack.py --port 6969 --dfile dstate >> /home/log/bttrack.log &
½¨ÒåÓÃÆÕͨÓû§À´Æô¶¯Õâ¸ö·þÎñ£¬ÕâÑù¶Ô°²È«Óкô¦¡£Õâ¸öÃüÁî»áÔÚµ±Ç°Ä¿Â¼Éú³ÉÒ»¸ödstateµÄÎļþ£¬²¢´ò¿ª6969¶Ë¿Ú £¬Äã¿ÉÒÔÔÚIEÄÚ´òÈ룺http://ip:6969/È¥¿´·þÎñµÄÏà¹ØÐÅÏ¢¡£(µ±È»£¬ÏÖÔÚ»¹Ã»ÓÐÄÚÈÝ£¬Éú³É*.torrent·¢²¼Îļþ¼°ÖÖ×Óºó¾Í»áÓÐ)¡£Õâ¸öÃüÁîͬʱ»áÔÚ/home/logĿ¼ÏÂÉú³ÉÒ»¸öbttrack.log µÄapacheÈÕÖ¾¸ñʽµÄÈÕÖ¾Îļþ£¬ÓÃÓÚ½ñºó×öÈÕÖ¾·ÖÎö¡¢Í³¼Æ¡£Ã»ÓÐÕâ¸öĿ¼µÄ»°Ç뽨һ¸ö°É£¬×¢ÒâÒªÊÇÕâ¸öÆÕͨÓû§¿ÉдµÄ£º£©
6¡¢ÖÆ×÷BTµÄ·¢²¼Îļþ
ΪÁËÄÜÈÃËûÈËÏÂÔØÄãµÄ¶«Î÷ £¬ÄãÏȵÃ×öÒ»¸öÒÔ.torrent½áβµÄBT·¢²¼Îļþ£º

./btmakemetafile.py /home/bj3ftp/ftp/Patch/SWDOL/°²×°ÅÌ/ http://IP:6969/announce

¡°/home/bj3ftp/ftp/Patch/SWDOL/°²×°ÅÌ/¡± ÊÇÄãÒª¸øËûÈËÏÂÔصÄĿ¼»òÎļþ
¡°http://IP:6969/announce¡± ÊÇÄã¸Õ×öµÄtrack·þÎñÆ÷µÄIP¼°¶Ë¿Ú

Õâ¸öÃüÁîÍê³Éºó£¬»áÔÚ/home/bj3ftp/ftp/Patch/SWDOL/ÏÂÉú³ÉÒ»¸ö¡±°²×°ÅÌ.torrent¡±µÄ·¢²¼Îļþ¡£°ÑËü·Åµ½WEB ¡¢ÂÛ̳ »ò FTPµÈÈËÃÇ´ÓÍøÉÏÄÜÏÂÔص½µÄµØ·½£¬ÕâÑùÈËÃǾͿÉÒÔͨ¹ýÕâ¸öÎļþÈ¥ÕÒtrack·þÎñÆ÷¼°ÖÖ×ÓÏÂÔØÀïʵ¼ÊÄÚÈÝÁË¡£
7¡¢ Éú³ÉµÚÒ»¸öÖÖ×Ó£¨seed£©
¡°ÖÖ×Ó¡°Õâ¸ö¸ÅÄîÔø¾­Ê¹ÎÒÓôÃƹýÒ»¶Îʱ¼ä£¬BT·þÎñÆ÷µÄtrack·þÎñ²¢²»ÌṩÏÂÔØ·þÎñ£¬ÌṩÏÂÔصÄÊÇËûµÄÖÖ×Ó£¨seed£©£¬Ò²¾ÍÊÇÒ»¸öÒѾ­ÏÂÔØÍê³É»òÕýÔÚÏÂÔصĿͻ§¶Ë¡£ÒòΪһ¿ªÊ¼Ã»ÓÐÕâÑùµÄÖÖ×Ó£¬ËùÒÔÄãµÃÏÈ×Ô¼ºÉú³ÉÒ»¸ö£º
./btdownloadheadless.py --max_allow_in 20 --max_upload_rate 500 --minport 6888 --maxport 6888 /home/bj3ftp/ftp/Patch/SWDOL/°²×°ÅÌBTÏÂÔØ.torrent --saveas /home/bj3ftp/ftp/Patch/SWDOL/°²×°ÅÌ

--max_allow 20 Ö¸Õâ¸öÖÖ×Ó×î¶à¿ÉÒÔ½ÓÊÜ20¸öÁ¬½Ó
--max_upload_rate 500 Ö¸Õâ¸öÖÖ×Ó×î´óµÄ¿ÉÒÔ½ÓÊÜÏÂÔصĴø¿í 500 KB(byte)/s£¬ÕâÑù¿ÉÒÔ¿ØÖÆÏÂÔØ´ø¿í¡£
--minport 6888 --maxport 6888 ×î´ó×îС¼àÌý¶Ë¿Ú£¬ÕâÑùд¾ÍÊÇ˵ÖÖ×ÓÖ»¼àÌý6888¶Ë¿Ú£¬ÕâÑù·½±ãÔÚ·À»ðǽÉÏ¿ª¶Ë¿Ú¡£
/home/bj3ftp/ftp/Patch/SWDOL/°²×°ÅÌBTÏÂÔØ.torrent ·¢²¼ÎļþµÄλÖÃ
--saveas /home/bj3ftp/ftp/Patch/SWDOL/°²×°ÅÌ Êµ¼ÊÎļþµÄλÖÃ

Õâ¸öÃüÁî»áÔÚBT·þÎñÆ÷±¾µØÉú³ÉµÚÒ»¸öÖÖ×Ó£¬¹©ËûÈËÏÂÔØ¡£

8¡¢ ×îºóÊÇÒ»¸öÔÚlinuxÉÏÆô¶¯¡¢¹Ø±Õ¡¢ÏÔʾBT·þÎñµÄ½Å±¾£º
#!/bin/bash
case $1 in

start)
/home/joybaby/BitTorrent-3.4.2/bttrack.py --port 6969 --dfile dstate >> /home/log/bttrack.log &
sleep 1
/home/joybaby/BitTorrent-3.4.2/btdownloadheadless.py --max_allow_in 20 --max_upload_rate 500 --minport 6888 --maxport 6888 /home/bj3ftp/ftp/Patch/SWDOL/°²×°ÅÌBTÏÂÔØ.torrent --saveas /home/bj3ftp/ftp/Patch/SWDOL/°²×°ÅÌ >&/dev/null &
echo "BT started"
;;

stop)
ps -efw | grep 'bttrack.py' | grep -v grep | awk '{print $2}' | xargs kill && killall python ||
echo "BT not stoped,Please kill it by hand"
;;

show)
ps -efw | grep python | grep -v grep
;;

*)
echo "Usage:./btseed.sh start|stop|show"
;;
Esac

OK,µ½´Ë£¬linuxÏ°²×°BT·þÎñÆ÷Íê³ÉÁË'
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 3 ÌõÆÀÂÛ

  1. Сº¢Ò»¸ö ÓÚ 2017-09-08 21:20:09·¢±í:

    ѧϰһÏ£¬BT serverµÄ»°¶ÔÓ²ÅÌÊǸö¿¼Ñé

  2. zhoumi ÓÚ 2009-03-02 03:16:48·¢±í:

    ding

  3. li659258510 ÓÚ 2009-03-01 23:22:09·¢±í:

    ţX