Creating a sub-directory (Web Root) for Headphones

Status
Not open for further replies.

Krowvin

Explorer
Joined
Jul 24, 2014
Messages
60
This might be helpful when installing other plugins as well.

Someone might have the same troubles I was having so I thought I might create a post to help out. Who knows, maybe i'll stumble upon my own post later on when trying to set this up again!

If you want to access HeadPhones from yourdomain.com/headphones or localIP/headphones then you might find this useful.

Like sickrage, couchpotato, and sabnzbd there are a few different configuration settings you need to do in order to get it completely up and running.

HeadPhones doesn't seem to have a setting in the client to set the web root, which means you'll have to go to the config file to change it.

[TIME SAVER] Add your headphones jail to the sabnzbd jail, you can download the plugin here:
http://download.freenas.org/plugins/9/x64/

be sure to get the newest version of headphones

then, on the FreeNAS GUI you can click:
- Jails > (Jail name with other plugins) > upload plugin (looks like a brown box) ... Wait, BOXES ARE BROWN? Yeah, well XD
- Navigate to where you downloaded the plugin on your local system.

1) Turn off the headphones plugin:
inside the headphones jail (see appendix A. at bottom of post)
Code:
service headphones stop

Note: Don't stop the jail, just the plugin

2) Edit the headphones config file
(If you don't have nano you can install it, or use another text editor see appendix B.)
still inside the headphones jail type:
Code:
nano /var/db/headphones/config.ini

Search for the webroot line: Press CTRL + W and type http_root
The line should look like this:
Code:
http_root = /headphones

assuming you want /headphones as the webroot

press ctrl+x to save and exit

3) Edit the webserver proxy (Assuming NGINX)
I'm not sure on the config for Apache, but here it is for NGINX
inside the webserver jail, navigate to your nginx config and edit it. That might look like this:
Code:
nano /usr/local/etc/nginx/nginx.conf


Inside the server block add this:
Code:
location ^~ /headphones {
		proxy_pass http://127.0.0.1:8181;
	}

This assumes the headphones plugin is inside the webserver jail.

press ctrl+x to save and exit

restart NGINX:
Code:
 service nginx restart 


4) If you are using scripts to auto process headphones, we will need to edit the script file.
If you're using Joshua's guide for plugins (Sickrage, couchpotato, sab, transmission) you might find the scripts saved here:
(THANKS JOSHUA!)

If you don't make this change, you might see an error in your sabnzbd GUI similar to this one:
Exit(1) HeadPhones: Failed to post-process - Server returned status 404!

inside your SABNZBD jail (Where the scripts are handled)
Code:
nano /usr/local/share/nzbToMedia/autoProcessMedia.cfg


press ctrl+w and search for headphones, scroll down a bit and you should see web_root. Change this to:
Code:
web_root = /headphones 


5) Start the headphones plugin
inside the headphones jail
Code:
service headphones start


APPENDIX

A. HOW TO GET INSIDE A JAIL
1) login to the server via ssh or by clicking the command line on the freenas GUI
2)list the jails
Code:
jls

take note of the jail ID (JID)
3) enter the jail
Code:
jexec jailID csh


B. HOW TO INSTALL NANO
Enter the jail per Appendix A.
Code:
pkg install nano

accept conditions to install





Hopefully this helps someone!
 
Status
Not open for further replies.
Top