Getting Plugins to run on port 80

Status
Not open for further replies.

ndboost

Explorer
Joined
Mar 17, 2013
Messages
78
Now that my other thread is resolved..

How can i get each of my jail's web ui's to run on port 80.. If this is even possible?

for instance..

my hostname is defined for my bit_2 (transmission) jail as transmission, by default its port is 9091.

Right now i have to access http://transmission:9091 to get to the web ui.

How can i set the port to 80 and get it to work? Ive tried changing the port but it seems like it doesnt start up?
 

ndboost

Explorer
Joined
Mar 17, 2013
Messages
78
bit of an update after some initial troubleshooting... seems its a permissions issue, ports < 1024 require root level access to run on..

Given that i dont want to grant the transmission user root level access, i think the only option I have is to use NAT to forward 80 -> 9091.

I know how to do this using iptables, im not familiar with the BSD derivative though.. any help there?
 
D

dlavigne

Guest
You won't be able to start another service on port 80 as the FreeNAS GUI already listens on this port for all addresses.
 

Fubar

Cadet
Joined
Dec 10, 2013
Messages
2
I had the same problem and finally found the solution here.

In the *JAIL SHELL* (as root), run the following :

Code:
echo "net.inet.ip.portrange.reservedhigh=0" >> /etc/sysctl.conf


The jail shell can be spawned with `jexec N sh` from NAS root shell (where N is the 0-based jail number, check that you are in the correct one with `ifconfig`).

You can then tell Transmission to run on port 80 via FreeNAS WebGUI (plugin settings).
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
why don't you just run nginx to proxy to your other services?
 

Fubar

Cadet
Joined
Dec 10, 2013
Messages
2
why don't you just run nginx to proxy to your other services?
nginx running on which box/IP ?

Currently I have a couple hostnames (cloud.domain.com and torrent.domain.com) which I want to point to ownCloud and transmission web interfaces respectively.

Both point to the same IP on the public side of things (I only have 1 WAN IP), and a varnish server on my router (pfSense!) forwards requests to the correct LAN IP based on hostname. Inside the LAN, my DNS overrides these entries with the IP addresses of the respective jails.

This works for me using simple URLs (no specifying custom ports) both inside & outside the LAN. If you have a better solution I am all ears :)
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
nginx running on which box/IP ?

Currently I have a couple hostnames (cloud.domain.com and torrent.domain.com) which I want to point to ownCloud and transmission web interfaces respectively.

Both point to the same IP on the public side of things (I only have 1 WAN IP), and a varnish server on my router (pfSense!) forwards requests to the correct LAN IP based on hostname. Inside the LAN, my DNS overrides these entries with the IP addresses of the respective jails.

This works for me using simple URLs (no specifying custom ports) both inside & outside the LAN. If you have a better solution I am all ears :)

if you already have varnish running it can already proxy fine just as you are explaining. I'm confused what the issue is then.

EDIT
ahh.. your not the OP

good job on the pfsense+varnish. that's how I have my setup as well. though I also have nginx in my plugins jail so everything is on port 80 internally as well. though I use subdirectories instead of different subdomains
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
You won't be able to start another service on port 80 as the FreeNAS GUI already listens on this port for all addresses.
jails override the host for the IPs they are assigned. this is not a problem.
 

seanohue

Cadet
Joined
May 20, 2017
Messages
1
jails override the host for the IPs they are assigned. this is not a problem.

Is this still the case? I tried changing Gog's default from 3000 to 80 and it does not work. Gog's error log reports that it can't bind to port 80 due to a permissions.
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Is this still the case? I tried changing Gog's default from 3000 to 80 and it does not work. Gog's error log reports that it can't bind to port 80 due to a permissions.
Yes this is still the case.

I assume what you are experiencing is only root can bind to ports <1024 by default. If you want you can change your jails
net.inet.ip.portrange.reservedhigh in it's settings on the Jails tab in the FreeNAS WebUI.
 

Ochirasu

Cadet
Joined
Jan 15, 2018
Messages
4
A generic way that I have found which you can use is forwarding port 80 to whatever port the plugin is using. This is useful if you have no way to specify the port of the plugin. For example, Plex uses port 32400, but I want it to use port 80. In your jail, add the following to each specified file:

/etc/sysctl.conf
Code:
net.inet.ip.portrange.reservedhigh=79

/etc/rc.conf
Code:
firewall_enable="YES"

/etc/rc.firewall
Code:
ipfw add 100 fwd 127.0.0.1,32400 tcp from any to any 80 in
 

dakta

Cadet
Joined
Jan 23, 2017
Messages
6
Update: for recent versions of Plex (tested with 1.13.5.x) you will also need to perform the same firewall redirect with UDP data:

Code:
ipfw add 100 fwd 127.0.0.1,32400 udp from any to any 80 in
 
Status
Not open for further replies.
Top