This is a tutorial on how to install mldonkey on ClarkConnect 3.0 and share the incoming files directory via samba so that it can be accessed by other LAN clients on your network.
This tutorial assumes that you have 2 hard disks in the CC box, so that you can easily re-install/dump ClarkConnect and still retain the downloaded stuff, but in case you use only one, just skip the first part and start off from the mldonkey installation.
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 -lWe 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!
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
[root@cc root]# fdisk /dev/hdcLet's take a look at the partition table on the mldonkey disk now! Yes! The partition was created! It's called /dev/hdc1.
p print the partition table
n add a new partition
->p primary type
->1 partition number (1-4)
-><Enter> First Cylinder (use the whole harddisk for 1 partition)
-><Enter> Last Cylinder (use the whole harddisk for 1 partition)
w write table to disk and exit
[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/hdc1Create directory /mldonkey and give it read/write/execution permissions to everybody (-m 777).
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.
[root@cc root]# mkdir -v -m 777 /mldonkey && ls -ld /mldonkeyLet CC mount the mldonkey filesystem automatically at startup: edit /etc/fstab (filesystem table)
mkdir: created directory `/mldonkey'
drwxrwxrwx 2 root root 4096 Feb 8 16:26 /mldonkey
[root@cc root]# vi /etc/fstabManually mount the mldonkey filesystem (/dev/hdc1) on the mldonkey directory (/mldonkey).
Add the following line to the end of the file:
/dev/hdc1 /mldonkey ext3 defaults,auto 0 0
[root@cc root]# mount -v /mldonkey/ && ll -d /mldonkeyNow let's display all the mounted filesystems: looks right!
/dev/hdc1 on /mldonkey type ext3 (rw)
drwxr-xr-x 3 root root 4096 Feb 8 18:29 /mldonkey
[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
[root@cc root]# wget -q \
http://dl.atrpms.net/fc3-i386/atrpms/stable/mldonkey-backend-2.6.0-46.rhfc3.at.i386.rpm \
http://dl.atrpms.net/fc3-i386/atrpms/stable/compartment-1.2-9.rhfc3.at.i386.rpm \
http://download.fedora.redhat.com/pub/fedora/linux/core/3/i386/os/Fedora/RPMS/nc-1.10-22.i386.rpm
Install the 3 packages with command rpm
[root@cc root]# rpm -hiv compartment-1.2-9.rhfc3.at.i386.rpm \Oh yeah, they're installed juust fine!
nc-1.10-22.i386.rpm \
mldonkey-backend-2.6.0-46.rhfc3.at.i386.rpm
Preparing... ########################################### [100%]
1:nc ########################################### [ 33%]
2:compartment ########################################### [ 67%]
3:mldonkey-backend ########################################### [100%]
[root@cc root]# rpm -qa --last | head -n 3
mldonkey-backend-2.6.0-46.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-9.rhfc3.at Tue 08 Feb 2005 04:56:26 PM CET
[root@cc root]# vi +4 /etc/sysconfig/mldonkeyStart and stop mldonkey to let it create its config files
Substitute
: ${ML_HOME=/usr/share/mldonkey}
with
: ${ML_HOME=/mldonkey}
[root@cc root]# service mldonkey start && service mldonkey stopEdit one of the files that mldonkey has just generated: downloads.ini, its main config file.
Starting mldonkey: [ OK ]
Stopping mldonkey: [ OK ]
[root@cc root]# vi +27 /mldonkey/downloads.iniSet mldonkey to automatically start at system startup.
Add
"10.0.0.255";
or whatever your LAN broadcast IP address is, above the
"127.0.0.1";]
line.
[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.confAdd 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.
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 to
[root@cc root]# smbpasswd -a mldonkeyCheck whether the samba server gets started at which runlevels
New SMB password: WeakPassword
Retype new SMB password: WeakPassword
startsmbfilepwent_internal: file /etc/samba/smbpasswd did not exist.
File successfully created.
Added user mldonkey.
[root@cc root]# chkconfig --list smbIt's off at all runlevels.
smb 0:off 1:off 2:off 3:on 4:on 5:on 6:off
[root@cc root]# chkconfig --level 345 smb on
See? 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
[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:
This page is best viewed at 1024x768 pixel screen resolution.