找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 5485|回复: 2

[clarkconnect] 在CLARKCONNECT 3.0 家庭版中安装MLDONKEY

[复制链接]
发表于 2005-7-27 11:31:43 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
Let's take a look at the partition table on our disks!
For example, I have 2 disks:
1) one (hda, i.e. primary master) hosts the operating system (ClarkConnect 3.0), is bootable, its size is 10.2 GB and contains 3 partitions: hda1 (/boot), hda2 (/) and hda3 (swap).
2) the other one (hdc, i.e. secondary master) is going to host the files downloaded and shared with mldonkey. Its size is 4.2 GB and it's currently empty.

[root@cc root]# fdisk -l
Disk /dev/hda: 10.2 GB, 10273920512 bytes
255 heads, 63 sectors/track, 1249 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          10       80293+  83  Linux
/dev/hda2              11        1216     9687195   83  Linux
/dev/hda3            1217        1249      265072+  82  Linux swap

Disk /dev/hdc: 4303 MB, 4303272960 bytes
15 heads, 63 sectors/track, 8894 cylinders
Units = cylinders of 945 * 512 = 483840 bytes

   Device Boot      Start         End      Blocks   Id  System
We need to create a partition on the 4.2 GB disk (/dev/hdc in my case) to host the mldonkey files: let's create it with command fdisk!

[root@cc root]# fdisk /dev/hdc
p        print the partition table
n        add a new partition
->p        primary type
->1        partition number (1-4)
->        First Cylinder (use the whole harddisk for 1 partition)
->        Last Cylinder (use the whole harddisk for 1 partition)
w        write table to disk and exit
Let's take a look at the partition table on the mldonkey disk now! Yes! The partition was created! It's called /dev/hdc1.

[root@cc root]# fdisk -l /dev/hdc

Disk /dev/hdc: 4303 MB, 4303272960 bytes
15 heads, 63 sectors/track, 8894 cylinders
Units = cylinders of 945 * 512 = 483840 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdc1               1        8894     4202383+  83  Linux
To make the partition we just created (/dev/hdc1) usable, we need to build a filesystem on it. We'll build an ext3 filesystem on it. A quick look at the options I've chosen:
-v means "Produce verbose output, including all file system-specific commands that are executed"
-j means "Create the filesystem with an ext3 journal", so that it's less likely to have corrupted data.
-L mldonkey is used to set a label for the filesystem: let's call it, guess what? mldonkey!
-m 2 to reserve 2% instead of the default 5% of the filesystem blocks for the super-user. Root (you) won't mind if you use up this disk as much as possible!


[root@cc root]# mkfs -v -j -L mldonkey -m 2 /dev/hdc1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=mldonkey
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
525888 inodes, 1050595 blocks
21011 blocks (2.00%) reserved for the super user
First data block=0
33 block groups
32768 blocks per group, 32768 fragments per group
15936 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.Create directory /mldonkey and give it read/write/execution permissions to everybody (-m 777).

[root@cc root]# mkdir -v -m 777 /mldonkey && ls -ld /mldonkey
mkdir: created directory `/mldonkey'
drwxrwxrwx  2 root root 4096 Feb  8 16:26 /mldonkeyLet CC mount the mldonkey filesystem automatically at startup: edit /etc/fstab (filesystem table)

[root@cc root]# vi /etc/fstab
Add the following line to the end of the file:
/dev/hdc1               /mldonkey               ext3    defaults,auto       0 0Manually mount the mldonkey filesystem (/dev/hdc1) on the mldonkey directory (/mldonkey).
Perfect. Mounted and having read/write permissions.

[root@cc root]# mount -v /mldonkey/ && ll -d /mldonkey
/dev/hdc1 on /mldonkey type ext3 (rw)
drwxr-xr-x  3 root root 4096 Feb  8 18:29 /mldonkeyNow let's display all the mounted filesystems: looks right!

[root@cc root]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda2             9.1G  543M  8.1G   7% /
/dev/hda1              76M  6.6M   66M  10% /boot
none                  157M     0  157M   0% /dev/shm
/dev/hdc1             4.0G   33M  3.9G   1% /mldonkey
--------------------------------------------------------------------------------
Now, download the mldonkey package + its dependencies: nc (netcat) and compartment (to "jail" mldonkey so that if ever a hacker exploits an mldonkey weakness to break into our CC box, he's confined to the mldonkey directories).

[root@cc root]# wget -q \
http://dl.atrpms.net/fc3-i386/atrpms/stabl...fc3.at.i386.rpm \
http://dl.atrpms.net/fc3-i386/atrpms/stabl...fc3.at.i386.rpm \
http://download.fedora.redhat.com/pub/fedo...i386.rpmInstall the 3 packages with command rpm

[root@cc root]# rpm -hiv compartment-1.2-8.rhfc3.at.i386.rpm \
nc-1.10-22.i386.rpm \
mldonkey-backend-2.5.30.15-44.rhfc3.at.i386.rpm

Preparing...                ########################################### [100%]
   1:nc                     ########################################### [ 33%]
   2:compartment            ########################################### [ 67%]
   3:mldonkey-backend       ########################################### [100%]Oh yeah, they're installed juust fine!

[root@cc root]# rpm -qa --last | head -n 3
mldonkey-backend-2.5.30.15-44.rhfc3.at        Tue 08 Feb 2005 04:56:27 PM CET
nc-1.10-22                                    Tue 08 Feb 2005 04:56:26 PM CET
compartment-1.2-8.rhfc3.at                    Tue 08 Feb 2005 04:56:26 PM CET
--------------------------------------------------------------------------------
Set the mldonkey home directory to /mldonkey instead of the default dir.

[root@cc root]# vi +4 /etc/sysconfig/mldonkey
Substitute
: ${ML_HOME=/usr/share/mldonkey}
with
: ${ML_HOME=/mldonkey}Start and stop mldonkey to let it create its config files

[root@cc root]# service mldonkey start && service mldonkey stop
Starting mldonkey:                                         [  OK  ]
Stopping mldonkey:                                         [  OK  ]
Edit one of the files that mldonkey has just generated: downloads.ini, its main config file.
Add the broadcast IP address of your LAN to the list of IP addresses allowed to access the mldonkey web interface.

[root@cc root]# vi +27 /mldonkey/downloads.ini
Add
"10.0.0.255";
or whatever your LAN broadcast IP address is, above the
"127.0.0.1";]
line.
Set mldonkey to automatically start at system startup.

[root@cc root]# chkconfig --list mldonkey
mldonkey        0:off   1:off   2:off   3:off   4:off   5:off   6:off
[root@cc root]# chkconfig --level 345 mldonkey on
[root@cc root]# chkconfig --list mldonkey
mldonkey        0:off   1:off   2:off   3:on    4:on    5:on    6:off
--------------------------------------------------------------------------------

Open Firewall ports to let mldonkey get the High ID from the servers it connects to.
Look here to know which ports to open.
To do so, use the ClarkConnect web interface that is found at https://10.0.0.102:81 or whatever CC's IP address is.


--------------------------------------------------------------------------------

Edit your samba server configuration file to share the /mldonkey/incoming directory to your LAN.

[root@cc root]# vi /etc/samba/smb.conf
Add the following to the end of the file:
[mldonkey]
directory mask = 0777
create mask = 0755
public = yes
writable = yes
path = /mldonkey/incoming
comment = This is the directory where the files will be downloaded toAdd user mldonkey to your samba server. The password you choose here will be asked to you when you attempt to access the /mldonkey/incoming directory from another computer on your LAN.

[root@cc root]# smbpasswd -a mldonkey
New SMB password: WeakPassword
Retype new SMB password: WeakPassword
startsmbfilepwent_internal: file /etc/samba/smbpasswd did not exist.
File successfully created.
Added user mldonkey.Check whether the samba server gets started at which runlevels

[root@cc root]# chkconfig --list smb
smb             0:off   1:off   2:off   3:on    4:on    5:on    6:offIt's off at all runlevels.
I want it to be launched as the machine reaches runlevel 3 (full multi-user mode without X).
Let's set it accordingly.

[root@cc root]# chkconfig --level 345 smb onSee? Now samba gets started as the machiner reaches runlevel 3 (normal operating mode).

[root@cc root]# chkconfig --list smb
smb             0:off   1:off   2:off   3:on    4:on     5:on    6:off
--------------------------------------------------------------------------------
Now, let's start mldonkey and samba.

[root@cc root]# service mldonkey start
Starting mldonkey:                                         [  OK  ]
[root@cc root]# service smb start
Starting SMB services:                                     [  OK  ]
Starting NMB services:                                     [  OK  ]
--------------------------------------------------------------------------------


From one of your LAN clients open your favorite web browser and type in the ClarkConnect box's IP address followed by :4080 (mldonkey's web interface port), e.g.:
http://10.0.0.102:4080
Use it!

If you're using a Microsoft Windows operating system, launch Windows Explorer and type \\cc\mldonkey in the address bar, where cc is the netbios name that ClarkConnect gets from /etc/samba/smb.conf file.
If asked for username/password enter mldonkey/mldonkey
You have full read/write access to the files you'll download with mldonkey, which means you can rename, modify and delete them.
Put some files in, to share with the world.
Restart mldonkey (root # service mldonkey restart).

If you want, you can download the latest statically compiled mldonkey binaries from here: http://ftp.berlios.de/pub/mldonkey/spiralvoice/
Just replace the mlnet binary to upgrade.

Useful links:

ClarkConnect Home Edition.
ClarkConnect Newbie portal.
Samba.
Mldonkey official community and news page.
Mldonkey wiki. Best documentation around.
routeros
发表于 2005-7-27 12:06:26 | 显示全部楼层
不错。。。。不过为什么不翻译下再发上来啊?需要翻译的地方也不多。。
routeros
回复

使用道具 举报

发表于 2005-7-27 17:22:51 | 显示全部楼层
在路由器上后台BT、emule。。。要小心用啊

服务器性能和安全性肯定是受影响的
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-5-8 11:55 , Processed in 0.052937 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表