Reverse Proxy for CouchPotato, Sick Beard and SABnzbd
Overview
In the case that you are running CouchPotato, Sick Beard and SABnzbd on the same server, you are probably used to accessing those services by changing the port number in your url. e.g.:
SABnzbd: http://usenet01.gnulnx.home:8080
Sick Beard: http://usenet01.gnulnx.home:8081
CouchPotato: http://usenet01.gnulnx.home:5050
Annoying, right? Using CNAME entries and a reverse proxy, you can access these services at a much simpler URL. e.g.:
SABnzbd: nzb
Sick Beard: tv
CouchPotato: movies
Setup DNS
With your own DNS server
If you are running your own DNS server, create CNAME entries, pointing 'nzv', 'tv' and 'movies' to your actual server's hostname (in this case: 'usenet01'. I am running BIND on an OpenBSD server:
$ grep usenet01 gnulnx.home
movies CNAME usenet01
nzb CNAME usenet01
tv CNAME usenet01
usenet01 A 192.168.11.147
With your hosts file
If you are not running your own DNS server, that is fine too. Update your /etc/hosts file appropriately:
$ grep usenet01 /etc/hosts
192.168.11.147 usenet01 movies tv nzb
Setup your reverse proxy
I am running apache on usenet01 in order to proxy requests to 'movies', 'tv' and 'nzb' to their equivalents on localhost running on their respective ports.
root@usenet01:/etc/apache2/sites-enabled# cat usenet.conf</p>
<p>ServerName movies.gnulnx.home
ServerAlias movies
ProxyRequests Off
ProxyPass / http://usenet01.gnulnx.home:5050/
ProxyPassReverse / http://usenet01.gnulnx.net:5050/</p>
<p>ServerName tv.gnulnx.home
ServerAlias tv
ProxyRequests Off
ProxyPass / http://usenet01.gnulnx.home:8081/
ProxyPassReverse / http://usenet01.gnulnx.net:8081/</p>
<p>ServerName nzb.gnulnx.home
ServerAlias nzb
ProxyRequests Off
ProxyPass / http://usenet01.gnulnx.home:8080/
ProxyPassReverse / http://usenet01.gnulnx.net:8080/
Next, you'll need to enable the appropriate proxy modules:
root@usenet01:/etc/apache2/mods-available# ln -s ../mods-available/proxy.conf .
root@usenet01:/etc/apache2/mods-available# ln -s ../mods-available/proxy.load .
root@usenet01:/etc/apache2/mods-available# ln -s ../mods-available/proxy_http.load .
Finally, restart apache to load in the new config:
service apache2 restart
Make sure it works
You should now be able to enter 'movies', 'tv' or 'nzb' into your web browser and be directed to CouchPotato, Sick Beard or SABnzbd respectively.
A word of caution: Some browsers are tricky in regards to accessing non-fully qualified domain names. If 'movies' doesn't work, try 'movies/', or 'movies.gnulnx.home' (in my case as gnulnx.home is my local domain).