View Single Post
  #1  
Old 27.05.2014, 17:40
Enqueue90 Enqueue90 is offline
JD Alpha
 
Join Date: Apr 2014
Location: Austria
Posts: 21
Post HowTo: JDownloader2 on Server/NAS Systems

GhostAWT is no longer needed in order to run headless, Please read this post http://board.jdownloader.org/showthr...156#post307156 for more information. -raztoki

Introduction
The last few weeks I did some development to make JDownloader run on server and NAS systems which do not have any XServer installed. This HowTo will explain how you can get JDownloader running without Graphical User Interface.

Short Version (for pro users)
  1. Copy an existing JDownloader2 installation from a desktop system to your server system or NAS. Be sure to setup My.JDownloader before copying the files.
  2. Add GhostAWT to your JDownloader installation using the following commands (check "**External links are only visible to Support Staff** for the latest release)
    Code:
    cd /tmp
    wget https://github.com/Danielku15/GhostAWT/archive/0.0.1.tar.gz
    tar xzfv 0.0.1.tar.gz
    mkdir /path/to/jdownloader2/libs/ghostawt
    cp -r GhostAWT-0.0.1/dist/* /path/to/jdownloader2/libs/ghostawt
  3. Start JDownloader using this command (adjust linux32 to match your platform).
    Code:
    java -Dghostawt.library.path=libs/ghostawt/linux32 -cp "./*:libs/*:libs/ghostawt/*" ghostawt.GhostRunner org.jdownloader.startup.Main
  4. Log into My.JDownloader and adjust the download folder there.
  5. Start Downloading.

Long Version (for average users)

1. Create JDownloader Package

1.1 Get Package
As a first step we need to build a JDownloader2 package for our system. Currently JDownloader2 is only available as special offline installer packages. The problem: This installer might not run on server systems without a UI and it’s only available for x86/x64 systems.
http://jdownloader.org/download/offline
For me the offline installer worked on an Ubuntu 32bit Server installation, but it didn’t work on my Synology NAS. To keep this HowTo simple, I will describe another solution:

Simply install JDownloader on your normal desktop PC by grabbing the JDownloader2 installer from the link above.

1.2 Configure Package
Start JDownloader on your desktop and let it update to the latest version. Since we won’t have a UI on our server system we should configure our JDownloader on our desktop. Open the settings and configure it the way you like. Here are some recommended settings for server systems:
  • User Interface
    • Enable Silent Mode
  • Bubble Notify
    • Show Bubbles if Never
  • Tray Icon
    • Uncheck Enabled

The most important thing is to setup your My.JDownloader settings. It will be the only way to control JDownloader.

1.3 Copy Package
Once your JDownloader is ready go into your JDownloader installation directory and copy all files to your server system. Do not copy the JRE directory, we won’t use the Java Runtime installed with JDownloader.

2. Run JDownloader using GhostAWT

Now we need to get JDownloader running on our environment. The problem is: If we start JDownloader normally, it will just crash because there’s no GUI. This is where GhostAWT comes in place. It’s a platform implementation of AWT and Java2D which makes Java believe there’s a UI available. If Java tries to create a window or do any graphical operations, GhostAWT will simply do nothing instead of crying no XServer is installed.

Let’s download GhostAWT and copy it into JDownloader. Head to "**External links are only visible to Support Staff** and copy the link of the latest Source code tar.gz. On our server system we download the file, extract it, and copy the files of the dist directory to our JDownloader installation:

Code:
cd /tmp
wget https://github.com/Danielku15/GhostAWT/archive/0.0.1.tar.gz
tar xzfv 0.0.1.tar.gz
mkdir /path/to/jdownloader2/libs/ghostawt
cp -r GhostAWT-0.0.1/dist/* /path/to/jdownloader2/libs/ghostawt
The command to start JDownloader using GhostAWT is:

Code:
java -Dghostawt.library.path=libs/ghostawt/synology-marvell-armada-370 -cp "./*:libs/*:libs/ghostawt/*" ghostawt.GhostRunner org.jdownloader.startup.Main
Replace synology-marvell-armada-370 with the correct platform of your system. I recommend to create a new shell script with this startup command.
In the first release of GhostAWT x86 linux systems (linux32) and Synology Marvell Armada 370 ARM (synology-marvell-armada-370) are available. If GhostAWT does not support your platform you should try compiling it for your platform on your own or create a new issue on "**External links are only visible to Support Staff**

3. My.JDownloader Settings
After starting JDownloader you should able to log in into My.JDownloader and see the connected device there. Before downloading any files you should go to the settings tab and open the „Advanced Config“.

There enter „Default Download Folder“ into the search box and set adjust the path to match your desired download location. I copied my Windows installation to my Synology Diskstation, that’s why a Windows File System Path was set. Make it fit your needs.

Enter „Browser Command Line“ into into the search box and click reset there. I also had some Windows specific stuff there.

4. Fin
Everything is done and ready for downloading. Enjoy your server/NAS JDownloader. If you encounter any problems feel free to ask here.

Last edited by raztoki; 18.09.2014 at 12:50. Reason: bypassed url obstruction
Reply With Quote