Jump to content

Changing Local Ports Not Effective


Coldburn

Recommended Posts

Coldburn

I have TrueNAS with a jail for Emby. Running 4.7.0.3-beta and also tried 4.6.3.0. The jail has a static ip and also have a local DNS box so I can have a nice hostname like emby.example.com. I dont need the 8096 port for http. I'd rather it be the default 80 so I dont (and my family) have to remember the non standard http port.

In network settings, I've changed the local ports to normal 80/443 in the web gui and saved the changes, but Emby isn't responding to the changes. I've restarted the service and the jail but I still have to use the 8096 port even though the network settings show 80.

Any ideas what could be wrong?

Link to comment
Share on other sites

Hi, most likely Emby Server is being denied access to use port 80 by your operating system.  Or perhaps another application is already using it. The server log might help reveal that, but anytime Emby Server is unable to gain access to the custom port that you want, it will just switch back to the default one.

Link to comment
Share on other sites

MRobi
3 hours ago, Coldburn said:

I have TrueNAS with a jail for Emby. Running 4.7.0.3-beta and also tried 4.6.3.0. The jail has a static ip and also have a local DNS box so I can have a nice hostname like emby.example.com. I dont need the 8096 port for http. I'd rather it be the default 80 so I dont (and my family) have to remember the non standard http port.

In network settings, I've changed the local ports to normal 80/443 in the web gui and saved the changes, but Emby isn't responding to the changes. I've restarted the service and the jail but I still have to use the 8096 port even though the network settings show 80.

Any ideas what could be wrong?

There's an easy way to do this without having to mess with any settings within emby

pkg install socat
sysrc "socat_enable=YES"
sysrc "socat_flags=TCP-LISTEN:80,fork TCP:127.0.0.1:8096"

Now anytime you hit the jail on port 80 it will forward the traffic to port 8096.

  • Like 1
Link to comment
Share on other sites

Duffyx

I use a reverse proxy (nginx) to fix that issue. This way I have my "emby.x.com" hostname pointing to localhost:8096, my "librenms.x.com' to localhost:xxxx and so on. This way you have one "webserver" which acts as a reverse proxy, listening on 80,443 and guiding you to the correct daemon that listens on different ports using hostnames.

If really want emby-server to listen on that port you have to run the emby-server daemon as root.
This is needed because port 80 and anything below 1023 are privileged port numbers and require root privileges to be opened.

Put this in rc.conf and restart the daemon.

emby_server_user="root"
emby_server_group="wheel" # not sure if this is needed, try with only the above line first

Although this is not a good practice or good advise. Best is to either use a reverse proxy or @MRobi's suggestion.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
Coldburn
7 hours ago, Luke said:

@Coldburn has this helped?

Hi, you we're right when you said emby was defaulting back to 8096 since it wasn't able to open 80. I havent figured out why yet. I didnt see anything in logs clue me in.

I'd rather not setup a reverse proxy, i'm afraid i'll have the same issue there. I like the socat idea better, but still rather get to the bottom of the root cause.

Link to comment
Share on other sites

I think duffyx is right and it is a port that requires special permissions in order for the server, or any software to use it.

Link to comment
Share on other sites

  • 1 month later...
Coldburn
On 8/19/2021 at 6:24 PM, Luke said:

I think duffyx is right and it is a port that requires special permissions in order for the server, or any software to use it.

Hey so get this, I decided to install Nextcloud and no issues running 80/443. It's using user www for nginx. Weird huh?

Link to comment
Share on other sites

Coldburn
On 6/30/2021 at 10:31 AM, Duffyx said:

I use a reverse proxy (nginx) to fix that issue. This way I have my "emby.x.com" hostname pointing to localhost:8096, my "librenms.x.com' to localhost:xxxx and so on. This way you have one "webserver" which acts as a reverse proxy, listening on 80,443 and guiding you to the correct daemon that listens on different ports using hostnames.

If really want emby-server to listen on that port you have to run the emby-server daemon as root.
This is needed because port 80 and anything below 1023 are privileged port numbers and require root privileges to be opened.

Put this in rc.conf and restart the daemon.


emby_server_user="root"
emby_server_group="wheel" # not sure if this is needed, try with only the above line first

Although this is not a good practice or good advise. Best is to either use a reverse proxy or @MRobi's suggestion.

I tried this anyways but no good. Also figured out installing Nextcloud doesn't have the issue and doesnt use root.

Link to comment
Share on other sites

Just now, Coldburn said:

Hey so get this, I decided to install Nextcloud and no issues running 80/443. It's using user www for nginx. Weird huh?

Emby Server doesn't run under user www. You can just install nginx and put that in front of emby server on port 80/443.

Link to comment
Share on other sites

Coldburn
Just now, Luke said:

Emby Server doesn't run under user www. You can just install nginx and put that in front of emby server on port 80/443.

Yeah i know, i was trying to make the point that Nextcloud isnt using root in order to use the lower ports.

Link to comment
Share on other sites

Its no point if you know that both Nginx or Apache (whatever you use for Nextcloud) use root to open the port and then drop privileges to www user. ;) 
So basically these fully fledged webservers you are using for Nextcloud have code to handle opening that port as root and run as a normal user after.

Edited by Duffyx
Link to comment
Share on other sites

  • 1 month later...
Coldburn

I ended up going the nginx proxy route. I tried changing the local http port to 80 on the latest .18 beta today but still no go.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...