Gentoo Wiki


Please format this article according to the guidelines and Wikification suggestions, then remove this notice {{Wikify}} from the article



Azureus implements the BitTorrent protocol using the Java Programming Language.


First we need to check which version of Java you are currently using. Even though you may have installed the newer version of Java Enviroment, your computer may still be using an old Pre-1.6 Enviroment. First of all, lets check to see which version you are using.

java-config --list-available-vms

The entry with the * next to indicates which Enviroment you are using. Make sure (as of August 10th 2007) that you are using the option Sun JDK [sun-jdk-1.6]

If there is an older entry that is selected then to select the new Enviroment you will need to use:

java-config --set-system-vm #   (Replace # with the number next to the option you want.)

Install Azureus

Tip: To get the latest version of Azureus unmask the unstable Version with:
echo "net-p2p/azureus ~x86" >> /etc/portage/package.keywords
Note: If you have an amd64-arch PC you have to change "~x86" to "~amd64"

Now you are ready to emerge Azureus and compile it:

emerge -av net-p2p/azureus

Now you should be able to run Azureus without problems.


Post Installation Configuration

The following Configuration is for the command line interface. Please someone input more information, if needed, for the X Version of Azureus.

After running Azureus, it will create the directory .azureus/ in your home directory. Inside are many .config files needed for the use, plus directories that might be an interest for you later. Inside the .azureus directory, there is a file named gentoo.config . If you will be using azureus in the command line, there is an option you will need to change inside gentoo.config . The line you need to change is the line:




Now you will be able to run azureus under the console.

Installing Azureus as a service (Experimental)

TODO: Clean Up Sources:

Create the user environment for azureus

Make a user and group for azureus to run as

   sudo useradd --home /var/azureus azureus
   sudo groupadd azureus

Make the home directory Note: Perhaps /var/azureus is not the best place

   sudo mkdir /var/azureus 

Clean things up a little bit by making a symbolic link

   sudo ln -s /var/azureus /var/azureus/.azureus

Configure azureus to run without a GUI

   echo -e "UI=\"console\"\nJAVA_OPTIONS=\"\\$(echo \$\$ > /var/run/\"" > /var/azureus/gentoo.config

Set appropriate permissions

   sudo chown azureus:azureus -Rv /var/azureus/

Create pidfile

   sudo touch /var/run/
   sudo chown azureus:azureus /var/run/


It may be necessary to gain interactive access to the Azureus console. This can be done by substituting the user for the Azureus user and running the Azureus start script. Console configuration commands can be entered here. When finished use the quit command to exit Azureus cleanly and ensure that the configuration was saved.

   sudo su azureus -c azureus

Creating an init script

   sudo nano -w /etc/init.d/azureus

And make it executeable:

   chmod +x /etc/init.d/azureus
File: /etc/init.d/azureus

depend() {
  need net
  need localmount
  after bootmisc
#  after netmount

start() {
  ebegin "Starting Azureus"
  start-stop-daemon --start \
    --startas /usr/bin/azureus --user azureus \
    --chuid azureus:azureus --env HOME=/var/azureus \
    &> /var/log/azureus.log &
  eend $?

stop() {
  AZ_PID=$(cat /var/run/
  ebegin "Stopping Azureus"
  start-stop-daemon --oknodo --stop \
    --pidfile /var/run/
  eend $?

Installing Azureus as a service, the Screen way

Azureus will run into a virtual console (named azureus_screen). You can attach to this console while the "service" is running with this command

screen -r azureus_screen  # -r for Reattach

When you tell the init script to stop, the command "quit" will be sent into the virtual console

su - azureus
File: /home/azureus/.azureus/gentoo.config
File: /etc/init.d/azureus_screen

depend() {
        need net
        after *

DESC="Azureus screen daemon"

start() {
        su - azureus -c "screen -wipe"
        if [[ $(su - azureus -c "screen -ls |grep $NAME") ]]
                eerror "Azureus is already running!"
                ebegin "Starting $DESC: $NAME"
                su - azureus -c "screen -dmS $NAME /usr/bin/azureus"

        eend $?

stop() {
        su - azureus -c "screen -wipe"
        if [[ $(su - azureus -c "screen -ls |grep $NAME") ]]
                ebegin "Stopping $DESC: $NAME"
                su - azureus -c "screen -p $NAME -X quit"
                eerror "Coulnd't find a running $DESC"

        eend $?
/etc/init.d/azureus_screen start



AzHTMLWebUI is a remote interface for Azureus with the ability to upload and control your torrents over an HTML interface.




To install AzHTMLWebUI is fairly easy. First you need to download the .jar file from here: AzHTMLWebUI Download

Make a new directory within the .azureus/plugins directory named [ azhtmlwebui ]

  mkdir /var/azureus/.azureus/plugins/azhtmlwebui

Move the azhtmlwebui_###.jar file you download to the .azureus/plugins/azhtmlwebui directory.

  mv azhtmlwebui*.jar /var/azureus/.azureus/plugins/azhtmlwebui/

Azureus should now load and automatically use the plugin. To test to see if AzHTMLWebUI is still working, go to a different machine (or your current one) with a GUI and access AzHTMLWebUI by going to http://ip-address:6886 in your internet browser. You should now have a interface where you can see your downloads and everything.


There are a few things your might want to look at when you first start up your server. When you start it up, you wont have a prompt telling you you can log in, it will look like it froze. This is where you can type in commands.

? - This will give you a list of every command you can use with Azureus.

set - Allows you to set parimeters to a list of numerous options. We will be using this for the next few commands.

All the following commands will be run under the Azureus interface on the server.

Getting upload to work

First of all, to enable Uploading from AzHTMLWebUI's interface, you will need to set this option:

set "Use default data dir" 1

This will allow you to upload torrents to the server from the AzHTMLWebUI interface.

To change where Azureus saves your currently downloading and finished downloads, type:

set "General_sDefaultSave_Directory" "location where you want to save your downloading files"

Setting Username and Password

Setting the Username

   set Plugin.azhtmlwebui.User admin
   > Parameter 'Plugin.azhtmlwebui.User' set to 'admin'. [string]

Setting the Password

   set Plugin.azhtmlwebui.Password mypassword password
   > Parameter 'Plugin.azhtmlwebui.Password' set to 'mypassword'. [password]

Getting it all to work

   set "Plugin.azhtmlwebui.Password Enable" 1
   > Parameter 'Plugin.azhtmlwebui.Password Enable' set to '1'. [int]

Connection Settings

To change the port

   set Plugin.azhtmlwebui.Port 6886

To use SSL you need to create a certificate. This can be done with keytool

   sudo  keytool -genkey -keystore /var/azureus/.keystore -keypass changeit -storepass changeit -keyalg rsa -alias azureus

You also need to set the protocol option

   set Plugin.azhtmlwebui.Protocol HTTPS

Then you must restart Azureus for the changes to take effect

Retrieved from ""

Last modified: Thu, 04 Sep 2008 01:16:00 +0000 Hits: 9,423