Difference between revisions of "AMule"

From ArchWiki
Jump to navigation Jump to search
(amuled service)
(Rewrote the two scripts, and added more detailed instructions.)
Line 9: Line 9:
 
  # pacman -S amule
 
  # pacman -S amule
  
==amuled==
 
 
amuled is a full featured aMule daemon, running without any user interface (GUI). It is controlled by remote access through aMuleWeb, or aMuleGUI.
 
amuled is a full featured aMule daemon, running without any user interface (GUI). It is controlled by remote access through aMuleWeb, or aMuleGUI.
  
We will create a service for amuled and amuleweb.
+
amuleweb is a web interface that allows one to control amuled by using a web browser.
  
===Create a user that will run the services===
+
==Configuration==
We create a user and run amuled and amuleweb once to create the configuration files :
+
===amuled===
 +
====Create configuration files====
 +
First we need to create a user for executing amule daemon:
 
  # useradd -m /srv/amule -s /bin/bash amule
 
  # useradd -m /srv/amule -s /bin/bash amule
 +
 +
Then we run amuled once to create the configuration files:
 
  # su amule
 
  # su amule
 
  $ amuled --ec-config
 
  $ amuled --ec-config
  
Choose a password (amule for example) and then stop amuled using Ctrl-C.
+
Now amuled will ask you for a temporary password, enter something (amule for example, this doesn't matter), and use Ctrl-C to terminate amuled.
Start amuleweb too to create the configuration file :
+
 
  $ amuleweb --write-config --password=amule --admin-pass=amule
+
====Edit configuration files====
 +
Now we need to configure amuled properly.
 +
First, we need to set up a password for the external connection of amuled.
 +
  $ echo -n <your password here> | md5sum | cut -d ' ' -f 1
 +
 
 +
The output of the above command is the encrypted password. Now you can edit the config file:
 +
$ nano /srv/amule/.aMule/amule.conf
 +
 
 +
Under section [ExternalConnect], set:
 +
AcceptExternalConnections=1
 +
ECPassword=<encrypted password>
 +
 
 +
====Create daemon====
  
We can now set amule's shell to /bin/false as we don't want to give it shell access to the machine.
+
To make amuled run on system start, we need to create the daemon /etc/rc.d/amuled:
  
Edit /etc/password and replace /bin/bash by /bin/false
+
# touch /etc/rc.d/amuled
amule:x:1001:1001::/srv/amule:/bin/false
 
  
===amuled service===
+
Then copy the following to the file:
  
Create /etc/rc.d/amuled :
 
 
<pre>
 
<pre>
 
#!/bin/bash
 
#!/bin/bash
  
USER=amuled
+
USER=amule
  
 
. /etc/rc.conf
 
. /etc/rc.conf
Line 68: Line 81:
 
  # chmod 755 /etc/rc.d/amuled
 
  # chmod 755 /etc/rc.d/amuled
  
You can now use amuleGui to connect to amuled remotely.
+
Add it to your {{filename|/etc/rc.conf}}, so it will be autostarted.
 +
DAEMONS=( ... network '''amuled''' ... )
 +
 
 +
===amuleweb===
 +
====Create configuration files====
 +
Start amuleweb too using the user you just created to create the configuration file:
 +
$ amuleweb --write-config --password=<password here> --admin-pass=<web password here>
 +
 
 +
Note that here, the <password here> is the unencrypted password you used to configure amuled. <web password here> is the unencrypted for the log in on the web interface. This command will write configuration file as such.
 +
 
 +
====Create daemon====
 +
Create the daemon {{filename|/etc/rc.d/amuleweb}}:
 +
 
 +
# touch /etc/rc.d/amuleweb
 +
 
 +
Copy the following to the file.
 +
 
 +
<pre>
 +
#!/bin/bash
 +
 
 +
USER=amule
 +
 
 +
. /etc/rc.conf
 +
. /etc/rc.d/functions
  
== amuleweb ==
+
case "$1" in
amuleweb is a web interface that allows one to control amuled by using a web browser.
+
start)
 +
  stat_busy "Starting aMule Web Daemon"
 +
      su "$USER" -c "$(printf "%q --quiet &" "/usr/bin/amuleweb" )"
 +
  stat_done
 +
  ;;
 +
stop)
 +
  stat_busy "Stopping aMule Web Daemon"
 +
    killall --quiet --ignore-case "/usr/bin/amuleweb"
 +
  stat_done
 +
  ;;
 +
restart|force-reload)
 +
  $0 stop
 +
  sleep 1
 +
  $0 start
 +
  ;;
 +
*)
 +
  printf "Usage: %q {start|stop|restart|force-reload}\n" "$0" >&2
 +
  exit 1
 +
  ;;
 +
esac
 +
 
 +
exit 0
 +
</pre>
 +
 
 +
Make it executable:
 +
# chmod 755 /etc/rc.d/amuleweb
 +
 
 +
Also add it to your {{filename|/etc/rc.conf}}, so it will be autostarted.
 +
DAEMONS=( ... network amuled '''amuleweb''' ... )
 +
 
 +
{{Note|Don't forget to set amule's shell to '''/bin/false''' as we don't want to give it shell access to the machine. Edit {{filename|/etc/password}} and replace '''/bin/bash''' by '''/bin/false''' for user amule:}}
 +
amule:x:1001:1001::/srv/amule:/bin/false
 +
 
 +
==Usage==
 +
Now you can start the daemon by
 +
# /etc/rc.d/amuled start
 +
# /etc/rc.d/amuleweb start
 +
 
 +
Now you can connect to amuleweb using http://yourserver:4711/

Revision as of 01:35, 26 August 2011

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی


aMule is an eMule-like client for the eD2k and Kademlia networks, supporting multiple platforms.

Installation

aMule is available in the official [extra] repositories. To install, run:

# pacman -S amule

amuled is a full featured aMule daemon, running without any user interface (GUI). It is controlled by remote access through aMuleWeb, or aMuleGUI.

amuleweb is a web interface that allows one to control amuled by using a web browser.

Configuration

amuled

Create configuration files

First we need to create a user for executing amule daemon:

# useradd -m /srv/amule -s /bin/bash amule

Then we run amuled once to create the configuration files:

# su amule
$ amuled --ec-config

Now amuled will ask you for a temporary password, enter something (amule for example, this doesn't matter), and use Ctrl-C to terminate amuled.

Edit configuration files

Now we need to configure amuled properly. First, we need to set up a password for the external connection of amuled.

$ echo -n <your password here> | md5sum | cut -d ' ' -f 1

The output of the above command is the encrypted password. Now you can edit the config file:

$ nano /srv/amule/.aMule/amule.conf

Under section [ExternalConnect], set:

AcceptExternalConnections=1
ECPassword=<encrypted password>

Create daemon

To make amuled run on system start, we need to create the daemon /etc/rc.d/amuled:

# touch /etc/rc.d/amuled

Then copy the following to the file:

#!/bin/bash

USER=amule

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
 start)
   stat_busy "Starting aMule Daemon"
       su "$USER" -c "$(printf "%q -f>/dev/null" "/usr/bin/amuled" )"
   stat_done
   ;;
 stop)
   stat_busy "Stopping aMule Daemon"
     killall --quiet --ignore-case "/usr/bin/amuled"
   stat_done
   ;;
 restart|force-reload)
   $0 stop
   sleep 1
   $0 start
   ;;
 *)
   printf "Usage: %q {start|stop|restart|force-reload}\n" "$0" >&2
   exit 1
   ;;
esac

exit 0

Make it executable:

# chmod 755 /etc/rc.d/amuled

Add it to your Template:Filename, so it will be autostarted.

DAEMONS=( ... network amuled ... )

amuleweb

Create configuration files

Start amuleweb too using the user you just created to create the configuration file:

$ amuleweb --write-config --password=<password here> --admin-pass=<web password here>

Note that here, the <password here> is the unencrypted password you used to configure amuled. <web password here> is the unencrypted for the log in on the web interface. This command will write configuration file as such.

Create daemon

Create the daemon Template:Filename:

# touch /etc/rc.d/amuleweb

Copy the following to the file.

#!/bin/bash

USER=amule

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
 start)
   stat_busy "Starting aMule Web Daemon"
       su "$USER" -c "$(printf "%q --quiet &" "/usr/bin/amuleweb" )"
   stat_done
   ;;
 stop)
   stat_busy "Stopping aMule Web Daemon"
     killall --quiet --ignore-case "/usr/bin/amuleweb"
   stat_done
   ;;
 restart|force-reload)
   $0 stop
   sleep 1
   $0 start
   ;;
 *)
   printf "Usage: %q {start|stop|restart|force-reload}\n" "$0" >&2
   exit 1
   ;;
esac

exit 0

Make it executable:

# chmod 755 /etc/rc.d/amuleweb

Also add it to your Template:Filename, so it will be autostarted.

DAEMONS=( ... network amuled amuleweb ... )
Note: Don't forget to set amule's shell to /bin/false as we don't want to give it shell access to the machine. Edit Template:Filename and replace /bin/bash by /bin/false for user amule:
amule:x:1001:1001::/srv/amule:/bin/false

Usage

Now you can start the daemon by

# /etc/rc.d/amuled start
# /etc/rc.d/amuleweb start

Now you can connect to amuleweb using http://yourserver:4711/