Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

Need Help Installing Aria2 in FreeNAS Jail

hus

Newbie
Joined
Feb 20, 2017
Messages
17
Thanks
1
#1
Hi,

I will be grateful if any Freenas expert can create a how to guide to install ARIA2 in freenas jail. This is a http/ftp/torrent download manager and is quite powerful with all the features it has. It is published under freshports. Links to the details are below:

https://www.freshports.org/www/aria2/
https://aria2.github.io/
WEB UI to Control ARIA2
https://github.com/ziahamza/webui-aria2

I am a complete noob in this thus I only manage to get the aria2 compiled from freshports and did not make any progress after that. I couldn't find any config file to edit and I just hit a roadblock there.
I will be very glad to the experts if they can guide for:
1) Installing Aria2
2) Setup the config
3) Create autostart script
4) Install and configure the web gui

Thank you.
 

dlavigne

Storage Engineering
Administrator
Moderator
iXsystems
Joined
May 24, 2011
Messages
11,340
Thanks
977
#2
In FreeBSD, aria2 is just the CLI client and the aria2fe pkg is the graphical front-end. Any particular reason you want a GUI? The CLI is quite easy to use.
 

hus

Newbie
Joined
Feb 20, 2017
Messages
17
Thanks
1
#3
In FreeBSD, aria2 is just the CLI client and the aria2fe pkg is the graphical front-end. Any particular reason you want a GUI? The CLI is quite easy to use.
I want the GUI as I don't have command line access on all devices. I download heavily on http and ftp for my personal work, and to be able to do it from my Android device while being mobile is a crucial requirement. Anyway, if u can just guide me with aria2 pkg install and the config with autostart script will suffice. For the gui I can configure later.
 

dlavigne

Storage Engineering
Administrator
Moderator
iXsystems
Joined
May 24, 2011
Messages
11,340
Thanks
977
#4
You will need to instead install aria2fe. I have no idea how to configure it, though the links at freshports may be of some assistance.
 

hus

Newbie
Joined
Feb 20, 2017
Messages
17
Thanks
1
#5
You will need to instead install aria2fe. I have no idea how to configure it, though the links at freshports may be of some assistance.
But aria2fe looks like a full desktop gui version. Since im installing in freenas nail, how would I have access to this. I understand freenas is only operable via its web gui.
 
Joined
Dec 19, 2017
Messages
1
Thanks
2
#6
hello
aria2 and aria2 webui it easy to install in freenas jails

1) create new jails "aria2" (or what you want) from freenas webgui with standard option
2) create new sharing folder in jails es: /mnt/yourvolumename/yoursharename/yourdownloadsfolder --> /downloads
3) join to aria2 jails from console and type the following command

pkg update && pkg upgrade -y
pkg install aria2 lighttpd ca_root_nss git
sysrc lighttpd_enable=YES
sysrc aria2_enable=YES
sysrc aria2_user=media
sysrc aria2_group=media


4) create aria2.conf in /usr/local/etc with the following command

vi /usr/local/etc/aria2.conf

and append this text

NB: if you don't know VIM please use your favorite text editor :)

Code:
continue
daemon=true
dir=/downloads # >>> CHANGE WITH YOUR DOWNLOADS FOLDER
file-allocation=falloc
log-level=warn
disable-ipv6=true
log-level=warn
max-connection-per-server=4 # >>> CHANGE IF YOU WANT
max-concurrent-downloads=3 # >>> CHANGE IF YOU WANT
max-overall-download-limit=0 # >>> CHANGE IF YOU WANT
min-split-size=5M
rpc-listen-all=true
enable-rpc=true
rpc-secret=YOUR_SECRET_TOKEN # >>> CHANGE WITH YOUR SECRET TOKEN (es:$123456)
ca-certificate=/etc/ssl/cert.pem


now save and exit

":w" to save
":q" to exit from vim

5) downloads aria2 webui from github in /usr/local/www/data and edit your pref in configuration.js

cd /usr/local/www
git clone https://github.com/ziahamza/webui-aria2.git data


6) now you can start lighttpd and aria2 daemon

service lighttpd start
service aria2 start


7) test your new aria2 web server

from any browser in your local pc type the following address

http://YOUR_ARIA2_JAIL_IP/index.html

And now have a nice day with your new downloads manager :)
 
Last edited:
Joined
Aug 17, 2017
Messages
1
Thanks
0
#10
hello
aria2 and aria2 webui it easy to install in freenas jails

1) create new jails "aria2" (or what you want) from freenas webgui with standard option
2) create new sharing folder in jails es: /mnt/yourvolumename/yoursharename/yourdownloadsfolder --> /downloads
3) join to aria2 jails from console and type the following command

pkg update && pkg upgrade -y
pkg install aria2 lighttpd ca_root_nss git
sysrc lighttpd_enable=YES
sysrc aria2_enable=YES
sysrc aria2_user=media
sysrc aria2_group=media


4) create aria2.conf in /usr/local/etc with the following command

vi /usr/local/etc/aria2.conf

and append this text

NB: if you don't know VIM please use your favorite text editor :)

Code:
continue
daemon=true
dir=/downloads # >>> CHANGE WITH YOUR DOWNLOADS FOLDER
file-allocation=falloc
log-level=warn
disable-ipv6=true
log-level=warn
max-connection-per-server=4 # >>> CHANGE IF YOU WANT
max-concurrent-downloads=3 # >>> CHANGE IF YOU WANT
max-overall-download-limit=0 # >>> CHANGE IF YOU WANT
min-split-size=5M
rpc-listen-all=true
enable-rpc=true
rpc-secret=YOUR_SECRET_TOKEN # >>> CHANGE WITH YOUR SECRET TOKEN (es:$123456)
ca-certificate=/etc/ssl/cert.pem


now save and exit

":w" to save
":q" to exit from vim

5) downloads aria2 webui from github in /usr/local/www/data and edit your pref in configuration.js

cd /usr/local/www
git clone https://github.com/ziahamza/webui-aria2.git data


6) now you can start lighttpd and aria2 daemon

service lighttpd start
service aria2 start


7) test your new aria2 web server

from any browser in your local pc type the following address

http://YOUR_ARIA2_JAIL_IP/index.html

And now have a nice day with your new downloads manager :)
i follow this guide but when go to step 6 service aria2 start it show error

root@aria2:/usr/local/www # service aria2 start
Starting aria2.
Parse error in /usr/local/etc/aria2.conf
Exception: [AbstractOptionHandler.cc:69] errorCode=28 We encountered a problem while processing the option '--max-connection-per-server'.
-> [OptionHandlerImpl.cc:159] errorCode=1 Bad number 1 # >>> CHANGE IF YOU WANT
Usage:
-x, --max-connection-per-server=NUM The maximum number of connections to one
server for each download.
/usr/local/etc/rc.d/aria2: WARNING: failed to start aria2

anyone know the solution? thanks
 
Joined
Oct 2, 2018
Messages
3
Thanks
0
#11
PL: Simply remove the "# >>> CHANGE IF YOU WANT"

Another Problem: I cannot get aria2 to write on the mounted share.
I added the media user (that also exists with the same UID 8675309 outside of the Jail) to the owner group of the share (Windows Permissions), but no success.

Any Idea?
 
Joined
Feb 21, 2017
Messages
16
Thanks
0
#12
I had to reinstall the aria2 jail because I messed up with the jail's storage permissions (never do that lol). As I have aria2 and transmission (in a different jail) both installed, my idea was/is to have a shared download storage. At first I did something odd mounting the transmission storage into aria2. Now, from scratch what I did was to create an independent dataset (shared publicly via SMB) and used "Add Storage" in each of both jails to have that dataset mounted in both jails, so both aria2 and transmission write there. I also added in aria2's lighttpd a browsable folder pointing to the /downloads storage, so I can browse it and download from there. A success!
 
Joined
Oct 2, 2018
Messages
3
Thanks
0
#13
Before experimenting and creating new Data Sets, I'd like to get my current ones running.

So I have the following User in the Jail running aria2:
media:*:8675309:8675309:User &:/home/media:/bin/sh

The same (standard) User is available in the Freenas main environment and if I switch to that user, I can write to the Data Set
However, when I switch to the media user from inside the Jail, I can browse the dataset but not write.

It's a Windows Dataset, if that matters....
 
Joined
Feb 13, 2019
Messages
2
Thanks
0
#15
hello
aria2 and aria2 webui it easy to install in freenas jails

1) create new jails "aria2" (or what you want) from freenas webgui with standard option
2) create new sharing folder in jails es: /mnt/yourvolumename/yoursharename/yourdownloadsfolder --> /downloads
3) join to aria2 jails from console and type the following command

pkg update && pkg upgrade -y
pkg install aria2 lighttpd ca_root_nss git
sysrc lighttpd_enable=YES
sysrc aria2_enable=YES
sysrc aria2_user=media
sysrc aria2_group=media


4) create aria2.conf in /usr/local/etc with the following command

vi /usr/local/etc/aria2.conf

and append this text

NB: if you don't know VIM please use your favorite text editor :)

Code:
continue
daemon=true
dir=/downloads # >>> CHANGE WITH YOUR DOWNLOADS FOLDER
file-allocation=falloc
log-level=warn
disable-ipv6=true
log-level=warn
max-connection-per-server=4 # >>> CHANGE IF YOU WANT
max-concurrent-downloads=3 # >>> CHANGE IF YOU WANT
max-overall-download-limit=0 # >>> CHANGE IF YOU WANT
min-split-size=5M
rpc-listen-all=true
enable-rpc=true
rpc-secret=YOUR_SECRET_TOKEN # >>> CHANGE WITH YOUR SECRET TOKEN (es:$123456)
ca-certificate=/etc/ssl/cert.pem


now save and exit

":w" to save
":q" to exit from vim

5) downloads aria2 webui from github in /usr/local/www/data and edit your pref in configuration.js

cd /usr/local/www
git clone https://github.com/ziahamza/webui-aria2.git data


6) now you can start lighttpd and aria2 daemon

service lighttpd start
service aria2 start


7) test your new aria2 web server

from any browser in your local pc type the following address

http://YOUR_ARIA2_JAIL_IP/index.html

And now have a nice day with your new downloads manager :)

I can't connect to aria2 webgui even after this tutorial...
I'm getting a "403 forbidden" error when I try to connect to http://ariaIP/index.html

Furthermore, when I set the aria user/group to media, the server wouldn't start.

Anyone to help?
 
Joined
Mar 30, 2016
Messages
15
Thanks
1
#16
I can't connect to aria2 webgui even after this tutorial...
I'm getting a "403 forbidden" error when I try to connect to http://ariaIP/index.html

Furthermore, when I set the aria user/group to media, the server wouldn't start.

Anyone to help?
Are you able to sort out the "403 forbidden" error?

I've followed the guide from posting #6 & "disable" the IPv6 as guided from https://redmine.lighttpd.net/projects/lighttpd/wiki/IPv6-Config without problem but no luck to load the webUI.
 
Top