打造linux下bt、电驴、ftp一体服务器

打造个人专用bt、电驴、ftp一体服务器

操作系统选择了Debian 4.0(etch),当服务器当然要用linux了,稳定嘛~
下载地址:
[url=http://debian.cn99.com/debian-cd/etch/debian-40r1-i386-netinst.iso]http://debian.cn99.com/debian-cd/etch/debian-40r1-i386-netinst.iso[/url]
安装后先更改apt源,
deb [url=http://debian.cn99.com/debian]http://debian.cn99.com/debian[/url] etch main non-free contrib
deb-src [url=http://debian.cn99.com/debian]http://debian.cn99.com/debian[/url] etch main non-free contrib
# deb [url=http://debian.cn99.com/debian-non-US]http://debian.cn99.com/debian-non-US[/url] etch/non-US main contrib non-free
# deb-src [url=http://debian.cn99.com/debian-non-US]http://debian.cn99.com/debian-non-US[/url] etch/non-US main contrib non-free
deb [url=http://debian.cn99.com/debian]http://debian.cn99.com/debian[/url] proposed-updates main contrib non-free
deb-src [url=http://debian.cn99.com/debian]http://debian.cn99.com/debian[/url] proposed-updates main contrib non-free
# deb [url=http://debian.cn99.com/debian-non-US]http://debian.cn99.com/debian-non-US[/url] proposed-updates/non-US main contrib non-free
# deb-src [url=http://debian.cn99.com/debian-non-US]http://debian.cn99.com/debian-non-US[/url] proposed-updates/non-US main contrib non-free
deb [url=http://debian.cn99.com/debian-security]http://debian.cn99.com/debian-security[/url] etch/updates main contrib non-free
首先安装编译环境,之后安装软件会用到
apt-get install build-essential
apt-get install autoconf automake
一:安装花生壳
下载花生壳,可以在官网上下载
[url=http://www.oray.cn/PeanutHull/PeanutHull_Download_ForLinux.htm]http://www.oray.cn/PeanutHull/PeanutHull_Download_ForLinux.htm[/url]
也可以从本站下载phlinux-10-installredhattar.gz
安装花生壳:
1.              # tar -zvxf phlinux-1.0-install.redhat.9.0.tar.gz
2.              安装包文件将解压缩至phlinux_install目录中
# cd phlinux_install
3.              执行安装脚本
# ./install.sh
4.              执行安装脚本后,将自动以互动配置模式的phlinux程序输入web服务的地址,直接回车
Runing phlinux for first configuration…
Peanuthull Linux-core 1.0 by oray.net, copyright 2005
No user configuration found, entering interactive mode automatically!
Peanuthull Linux-core Interactive startup.
Please input service address(press ENTER use phservice.oray.net):
输入花生壳服务器地址,直接回车
Please input server address(press ENTER use PH031.Oray.Net):

此处提示输入您的花生护照登陆名
Please input username(press ENTER use ):

此处提供输入花生护照登陆密码
Please input password:

系统提示是否保存配置文件,在这里输入yes回车.
Save to configuration file (/etc/phlinux.conf)?(yes/no):

* 本人在ubuntu ,debian安装花生壳执行./install.sh时会提示
error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
执行apt-get install libstdc++5,安装编译器
再./install.sh就可以安装花生壳了。

以上操作完成,系统将自动登录花生壳服务器,用户可以通过web方式查看当前花生壳客户端的运行状态.
[img]http://www.erikchang.com/wp-content/uploads/2008/02/phlinux.JPG[/img]
花生壳客户端使用 6160端口提供web检测服务,例如 [url=http://192.168.0.1:6160/]http://192.168.0.1:6160/[/url]
此监测页面将完全的反应当前花生壳的运行状态.
二:安装mldonkey

执行apt-get install mldonkey
安装之后会提示是否开机启动mldonkey,点yes。
先停止此服务
/etc/init.d/mldonkey-server stop
然后修改一下配置文件
nano /var/lib/mldonkey/downloads.ini
找到allowed_ips = [
“127.0.0.1″; ]
allowed_ips 意思 允许访问的IP,需要把你另外机器的IP添加上!~具体看本行上面的注释
如果要添加一个网段的ip添加  “192.168.1.1-192.168.1.255”; 就可以了。
然后启动服务 /etc/init.d/mldonkey-server start
因为要配合Sancho来使用,而安装ML的主机没有GUI所以,在另外的机器安装Sancho(Linux,windows均支持)去[url=http://sancho-gui.sourceforge.net/]http://sancho-gui.sourceforge.net/[/url]下载适合你的版本!
现在就可以使用远端的sancho来登录mldonkey的那个主机了!当你安装完sancho之后运行会出现
这样一个配置框,你的可能是英文的,主机地方填写你ml机器的IP,默认用户amdin不变,密码是空然后点击”完成”就连接到你的ML服务器了!
点击Tools –> Preferences –> sancho:Main 下的 General 里找到 (*) Use locale file: 在后面的下拉框中找到 zh_CN 然后保存一下,重新启动就是中文界面了! *
*现在在Sancho上所做的修改,都会反应到ml主机的相应配置文件中!只不过是远程图形界面更容易修改,当然你也可以直接修改配置文件!
工具–>首选项–>Main(Mail下的)在client_name 输入一个服务器名字 格式最好为 [CHN][VeryCD]yourname ,因为这个连接到eMule几率大些(本人没有证实)..
Networks下Donkey ED2K-force_client_hight_id,ED2K-force_high_id,ED2k-keep_best_server打勾,修改max_connected_servers 为 30,ED2K-port 填入你开放的TCP端口.
添加我们常用的服务器,当然这不是在Preferences中设置的,而是在Sancho的主界面中上方第二行点击Server,然后点击绿色+号旁边的 带+的地球图标的按钮来添加一个server.met,比如电驴用的[url=http://www.emule.org.cn/server.met]http://www.emule.org.cn/server.met[/url]
带宽设置 Bandwidth 相应自己修改.
设置amdin密码:
在sancho面板点击控制台下方输入:
useradds admin **** (****为你要设置的密码)
在首选项的Networks 下把 enable_kademlia ,enable_overnet 打钩.
如果要用web控制,比如[url=http://192.168.1.2:4080]http://192.168.1.2:4080[/url]  就可以了。
三:安装torrentflux用户bt服务

因为torrentflux需要apache,php,mysql的支持,所以我们需要先安装apache,php,mysql
apt-get install apache libapache-mod-php4      安装apache web server并增加php支持
apt-get install python2.4        安装python
apt-get install mysql   安装mysql

创建MySQL torrentflux数据库
mysqladmin create torrentflux

用winscp上传刚才下载torrentflux2.3的文件夹到 /var/www/里再解压
利用系统所提供的torrentflux.sql示例脚本,来建立所有所需要的数据库条目,即把torrentflux.sql中的内容全部导入到我们刚才所创建的那个数据库中。如下:
    mysql torrentflux < torrentflux.sql

  接下来,我们需要来创建一个mysql用户,因此,进入到mysql的命令行并输入如下的命令:
    mysql
  然后再连接到刚才你所创建的那个数据库上:
   connect torrentflux
  现在来创建一个新的用户,并对该用户设置相应的密码。使用如下的命令:
 grant CREATE,INSERT,DELETE,UPDATE,SELECT on torrentflux.* to tf@localhost;
  set password for tf = password(’MyPassword’);
  现在使用“exit”命令退出MySQL。
  然后再把那两个bottorent python文件拷贝到/usr/local目录下,并执行它们,使用如下的命令:
    cp TF_BitTornado/ /usr/local/
  chmod +x /usr/local/TF_BitTornado/btphptornado.py
  chmod +x /usr/local/TF_BitTornado/btshowmetainfo.py
下来,要编辑一下config.php文件了:

         $cfg[”db_type”] = ”mysql”;
  $cfg[”db_host”] = ”localhost”;
  $cfg[”db_name”] = ”torrentflux”;
  $cfg[”db_user”] = ”tf”;
  $cfg[”db_pass”] = ”MyPassword”;
  $cfg[”path”] = ”/samba_share/downloads/”;
  $cfg[”btphpbin”] = ”/usr/local/TF_BitTornado/btphptornado.py”;
  $cfg[”btshowmetainfo”] = ”/usr/local/TF_BitTornado/btshowmetainfo.py”;
        保存文件后,就可以打开[url=http://192.168.1.2/torrentflux]http://192.168.1.2/torrentflux[/url]
下来我们可以使用torrentflux拉~本人用1M电信速度还不错。
四:vsftpd
安装apt-get install vsftpd
之后我们要修改下vsftpd配置文件,在/etc/vsftpd.conf
anonymous_enable=no
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_world_readable_only=YES
anon_mkdir_write_enable=YES
anon_mkdir_write_enable=YES
保存文件,执行 /etc/init.d/vsftpd restart重新启动vsftpd服务
服务建好了,该建立ftp用户了,如果自己用ftp的话可以建立一个本地用户,如果为了安全起见就建立一个虚拟用户(不能登陆shell)
建立本地用户:   useradd ftpuser -d /home/ftp  
chown -R ftpuser /home/ftp
如果不能登陆ftp的话就把/home的权限改为777  chmod 777 /home
建立虚拟用户: useradd ftp -d /home/FF -s /bin/false
chown -R ftp /home/FF
ftp搞定。
现在所有的服务都建好了,我们可以通过花生壳在外网控制主机的下载了。当然也可以给自己的朋友同学做免费的ftp服务。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值