Port Forwarding is not working quite right [SOLVED]

Need help? Post your questions here.

Moderator: moderators

Port Forwarding is not working quite right [SOLVED]

Postby dokjest » Tue Dec 04, 2012 2:08 pm

Hi all and TIA for any help:

I am running Subsonic 4.7, and have setup on an Ubuntu 12.10 system and am registered with the domain of louvre.subsonic.org - I'm forwarding to an internal port of 15143 - when I enter the url for louvre.subsonic.org, the page cannot be found, and I note that the IP address on the address bar returns the proper external IP for my network but has the port appended to the IP - xx.xx.xx.xx:15143.

The actual IP is ninety-six, forty, one-sixty-nine, one-twenty-two. (I hate crawlers)

IF I strip the port off of the IP address in the address bar of my browser I reach the login page and am able to proceed normally. I had previously set the router to forward external port 80 to internal port 15143. I tested disabling this and that caused complete failure to reach the Subsonic server (As I would expect). Additionally I tested by disabling the port forwarding in Subsonic and trying to let the router handle this, but that did not help. I generally test with Firefox, but I get the same results with IE and Chrome. I've tested with multiple machines outside of my network and get the same results.

Here is the Java info if this helps: jetty-6.1.x, java 1.6.0_24, Linux (61.7 MB / 134.3 MB)

Since Subsonic IS running properly aside from the port/url issue, I have not included logs from Subsonic, but if you need other info, please let me know.

Thanks All!

Dok Jest
Last edited by dokjest on Fri Dec 07, 2012 1:07 pm, edited 1 time in total.
dokjest
 
Posts: 5
Joined: Tue Dec 04, 2012 1:49 pm

Re: Port Forwarding is not working quite right

Postby artens » Wed Dec 05, 2012 10:09 am

Similar issues here with V4.6.
Depending on the type of setting created I get on <server>/subsonic either a 404:
Code: Select all
Not Found

The requested URL /login.view was not found on this server.


or a 503:
Code: Select all
Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Apache/2.2.22 (Ubuntu) Server at 192.168.1.100 Port 80


For complenetess sake my setup:

Problem Description: Port forwarding to server extension does not work correctly (i.e. http://<server>:<port> redirect to http://<server>/subsonic)
Troubleshooting Steps: Editing a variety of settings in /etc/default/subsonic and /etc/apache2/httpd.conf or /etc/apache2/sites-enabled/000-default
Playback Application and version: IE8 / IE9 / Firefox / Chrome / Android app
Subsonic Version: 4.6 (build 2585) – December 6, 2011 (4.7 failed upon upgrading, bigtime, breaking my working setup with correct port forwarding!)
Server Version: jetty-6.1.x, java 1.6.0_24, Linux (260.6 MB / 431.4 MB)
Hardware Platform: Ubuntu 12.04 LTS with latest updates applied
Java Memory Limit: 1000Mb
Problem Filename: -
Output from ffmpeg -i:
Code: Select all
ffmpeg version 0.8.4-4:0.8.4-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers  built on Nov  6 2012 16:51:33 with gcc 4.6.3

Last ten log file lines: Nothing fancy here, but it will not be wrong to supply :D
Code: Select all
[12/5/12 10:45:25 AM CET]    INFO   PodcastService   Starting scheduled Podcast refresh.
[12/5/12 10:45:25 AM CET]    INFO   PodcastService   Completed scheduled Podcast refresh.
[12/5/12 10:45:27 AM CET]    DEBUG   PodcastService   No enclosure found for episode PJL sessions.12.8 [uk jazz radio show]
[12/5/12 10:45:27 AM CET]    DEBUG   PodcastService   No enclosure found for episode PJL UK Jazz Radio Shows [EP 1 - 4]
[12/5/12 10:45:27 AM CET]    DEBUG   PodcastService   No enclosure found for episode playjazzloud sessions vol 102 [jazz/funk/y]
[12/5/12 10:45:27 AM CET]    DEBUG   PodcastService   No enclosure found for episode playjazzloud sessions vol 101 [worldwide sounds]
[12/5/12 10:45:27 AM CET]    DEBUG   PodcastService   No enclosure found for episode playjazzloud sessions vol 100
[12/5/12 10:45:27 AM CET]    DEBUG   PodcastService   No enclosure found for episode playjazzloud sessions vol 99 [jazz+things]
[12/5/12 10:46:15 AM CET]    INFO   PlaylistInputStream   jef listening to "cd/01 - Will And The People - Troubled Pro.mp3"
[12/5/12 10:49:36 AM CET]    INFO   PlaylistInputStream   jef listening to "cd/02 - Will And The People - No Shame.mp3"
[12/5/12 10:52:38 AM CET]    INFO   PlaylistInputStream   jef listening to "cd/03 - Will And The People - Misunderstood.mp3"
[12/5/12 10:56:13 AM CET]    INFO   PlaylistInputStream   jef listening to "cd/04 - Will And The People - Lion In The Morning Sun.mp3"


apache httpd.conf:
Code: Select all
<Location /subsonic>
order deny,allow
deny from all
allow from all
ProxyPass http://localhost:4040
ProxyPassReverse http://localhost:4040
</Location>
artens
 
Posts: 7
Joined: Wed Dec 05, 2012 9:52 am

Re: Port Forwarding is not working quite right

Postby libussa » Wed Dec 05, 2012 3:26 pm

for both of you :

I don't understand why you are using port 80 ? This is the port dedicated for http traffic, useful only if you host a web server.

For subsonic, the default port is 4040; if you want to use another one, you have to specify it in /etc/default/subsonic (Ubuntu/Debian) or /etc/sysconfig/subsonic (Fedora/RPM).

Then, you need to forward this port in your router configuration (so forward from external 4040 to internal 4040, with default config)

Finally, depending on your distro and personal configuration, you need to add an exception to your software firewall.
libussa
 
Posts: 6
Joined: Wed Dec 05, 2012 3:03 pm

Re: Port Forwarding is not working quite right

Postby dokjest » Wed Dec 05, 2012 6:05 pm

Thanks for the suggestion, I'll try tonight and let you know (Honestly, I would have to say I didn't think about not using port 80) So thanks and I'll post later.
dokjest
 
Posts: 5
Joined: Tue Dec 04, 2012 1:49 pm

Re: Port Forwarding is not working quite right

Postby artens » Thu Dec 06, 2012 7:43 pm

libussa wrote:for both of you :

I don't understand why you are using port 80 ? This is the port dedicated for http traffic, useful only if you host a web server.



Subsonic's frontend still is HTTP based. And I work in a corporate environment where only <10 ports are open for us to access to the outside, and some services (RDP / VNC / FTP) are already used on the machine running Subsonic. So that's why. Furthermore, some people use the service as well for demo videos of products that I really want to keep from the outside world to leak, so I want to provide an easy link instead of http://too.difficult:to/handle

For subsonic, the default port is 4040; if you want to use another one, you have to specify it in /etc/default/subsonic (Ubuntu/Debian) or /etc/sysconfig/subsonic (Fedora/RPM).

Done, default on machine is still 4040. I just want to reroute localhost:4040 to localhost/directory
Then, you need to forward this port in your router configuration (so forward from external 4040 to internal 4040, with default config)

Done, as intermediate solution (so currently another port is open but wrongly assigned so I can still use subsonic) the router is configured as <worldwide-ip>:<external-port> and connect that to <local-ip>:4040
Finally, depending on your distro and personal configuration, you need to add an exception to your software firewall.

As my router is my firewall, I've disabled ufw in ubuntu.

Don't get me wrong, your post is very helpful to check off all possible issues where it can go wrong. Thank you for that! However now I need someone like you who knows everything about apache2 and subsonic :D
artens
 
Posts: 7
Joined: Wed Dec 05, 2012 9:52 am

Re: Port Forwarding is not working quite right

Postby artens » Thu Dec 06, 2012 8:07 pm

*Solved* for me. Small iteration was to edit the configuration file for Subsonic in another way.

Solution in words:
Run and configure apache2
- Install apache2
- Install mod rewrite plugins for apache2
- Configure apache2 to reroute traffic from <ip>:<port> to <ip>/<directory>

Run and configure subsonic
- Install subsonic
- configure subsonic for working from another base directory

apache2 settings for /etc/apache2/httpd.conf
Code: Select all
<Location /subsonic>
order deny,allow
deny from all
allow from all
ProxyPass http://localhost:4040
ProxyPassReverse http://localhost:4040
</Location>


apache2 settings for /etc/apache2/sites-enabled/000-default
Code: Select all
<VirtualHost *:80>
   ServerAdmin webmaster@localhost

   DocumentRoot /var/www
   <Directory />
      Options FollowSymLinks
      AllowOverride None
   </Directory>
   <Directory /var/www/>
      Options Indexes FollowSymLinks MultiViews
      AllowOverride None
      Order allow,deny
      allow from all
   </Directory>

   ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
   <Directory "/usr/lib/cgi-bin">
      AllowOverride None
      Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
      Order allow,deny
      Allow from all
   </Directory>

   ErrorLog ${APACHE_LOG_DIR}/error.log

   # Possible values include: debug, info, notice, warn, error, crit,
   # alert, emerg.
   LogLevel warn

   CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
    Order allow,deny
    Allow from all
</Proxy>
</VirtualHost>

subsonic settings for /etc/default/subsonic
Code: Select all
#
# This is the configuration file for the Subsonic service
# (/etc/init.d/subsonic)
#
# To change the startup parameters of Subsonic, modify
# the SUBSONIC_ARGS variable below.
#
# Type "subsonic --help" on the command line to read an
# explanation of the different options.
#
# For example, to specify that Subsonic should use port 80 (for http)
# and 443 (for https), and use a Java memory heap size of 120 MB, use
# the following:
#
# SUBSONIC_ARGS="--port=80 --https-port=443 --max-memory=120"

# Reserve 1000 Mb for memory and define the context path for <ip>/subsonic to work
SUBSONIC_ARGS="--max-memory=1000 --context-path=/subsonic"

# The user which should run the Subsonic process. Default "root".
# Note that non-root users are by default not allowed to use ports
# below 1024. Also make sure to grant the user write permissions in
# the music directories, otherwise changing album art and tags will fail.

SUBSONIC_USER=root


Hope this helps! 8)
artens
 
Posts: 7
Joined: Wed Dec 05, 2012 9:52 am

Re: Port Forwarding is not working quite right

Postby dokjest » Fri Dec 07, 2012 11:58 am

Thanks everyone for your help - I am resolved. libussa, my problem was that I Was using a NAT and had the entry backwards (yeah - I know...DOH!)

Thanks again everyone!
dokjest
 
Posts: 5
Joined: Tue Dec 04, 2012 1:49 pm

Re: Port Forwarding is not working quite right

Postby artens » Fri Dec 07, 2012 12:50 pm

dokjest - could you please set the topic title to [Solved] Port Forwarding is not working quite right?
artens
 
Posts: 7
Joined: Wed Dec 05, 2012 9:52 am

Re: Port Forwarding is not working quite right [SOLVED]

Postby artens » Fri Dec 07, 2012 3:35 pm

Upgrade to 4.7 failed. Clean install to 4.7 was successful as are the settings defined this way.
4.7 clean install did not create a file in /etc/default named subsonic.

Creating a file named subsonic as /etc/default/subsonic with the content as above made everything work as desired.
Happy now! :mrgreen:
artens
 
Posts: 7
Joined: Wed Dec 05, 2012 9:52 am


Return to Help

Who is online

Users browsing this forum: No registered users and 16 guests