Home » Home Server » CouchPotato Apache reverse proxy

CouchPotato Apache reverse proxy

CouchPotato is a wonderful set and forget python script to automatically download and pass movie torrent files to torrent downloaders (eg. Transmission) or NZB files to NZB downloaders (eg. SABNzbd+). In this post I will explain how to setup CouchPotato Apache reverse proxy. How It works through a feature-full CouchPotato web interface. You will need to have CouchPotato installed (as described here for Ubuntu and here for Windows) before following this guide. Browse through movies on sites like imdb or rottentomatoes and add them to your download queue with just couple clicks. Your movie will be downloaded (with subtitles if you want), renamed, and moved to your library. You will need news group access for best performance and CouchPotato works best with Usenet services such as Astraweb with SABnzbd or Unzbin newsgrabbers. CouchPotato typically works on port 5000 (can be changed).

Support content creators and signup for Amazon Prime and get instant streaming of Movies and TV Shows. Alternatively, you may purchase or rent digital copies of Movies and TV Shows.

CouchPotato Apache Reverse Proxy

CouchPotato Apache Reverse ProxyI usually like to not have anything work on its default port for security reasons. But anyway, to access the CouchPotato web interface using port number (eg. http://myserver.com:PortNumber) is cumbersome. I like to create CouchPotato Apache reverse proxy for easier access (eg. http://myserver.com/couchpotato). Below is a description of how to achieve this on Ubuntu Server.

First enable the proxy modules in Apache:

sudo a2enmod proxy
sudo a2enmod proxy_http
sudo service apache2 restart

Then you will have to edit /etc/apache2/mods-available/proxy.conf file. But before that backup your proxy.conf file:

cd /etc/apache2/mods-available
sudo mv proxy.conf proxy.conf.default

Now create a new file called proxy.conf using your favorite text editor and add the following lines to it:

<ifmodule mod_proxy.c>
  #turning ProxyRequests on and allowing proxying from all may allow
  #spammers to use your proxy to send email.

  ProxyRequests Off
  <proxy *>
    AddDefaultCharset off
    Order Allow,Deny
    Allow from all
  </proxy>

  ProxyPass /couchpotato/ http://localhost:5000/
  ProxyPassReverse /couchpotato/ http://localhost:5000/
  # Line below is optional
  Redirect permanent /couchpotato https://myserver.com/couchpotato/

  # Enable/disable the handling of HTTP/1.1 "Via:" headers.
  # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
  # Set to one of: Off | On | Full | Block

  ProxyVia On
</ifmodule>

The ProxyPass and ReverseProxyPass lines create an Apache proxy to CouchPotato. The redirect statement (optional) permanently redirects http connections to https connections for security. Then save the file, close it, and restart Apache:

sudo service apache2 restart

Then, you will have to stop CouchPotato and edit its configuration file to modify the “urlbase”. You can do this in 2 ways:

1) The configuration file (config.ini) is normally located in the home folder under “.couchpotato”.

sudo /etc/init.d/couchpotato stop
cd ~/.couchpotato
nano config.ini

Find the [global] section and edit “urlbase” as shown below. You could name it whatever you want (eg. potato instead couchpotato) but make sure that the same word is used in proxy.conf.

[global]
...
...
urlbase = couchpotato

2) If you have CouchPotato V2 running, then you can edit the urlbase through the web interface under General->Advanced settings as shown in the picture below:

CouchPotato V2 Advanced Settings
CouchPotato V2 Advanced Settings

Then start CouchPotato for the changes to take effect:

sudo /etc/init.d/couchpotato start

Web Access through CouchPotato Apache Reverse Proxy

CouchPotato Apache reverse proxy is now active and you should be able to access CouchPotato web interface using http://myserver.com/couchpotato.

3 Best Standalone Bittorrent Downloaders:

Don’t want to mess with servers? Check these out:

  1. Synology DiskStation 2-Bay (Diskless) DS212 (Black) with Bittorrent Downloader
  2. Synology DiskStation 2-Bay (Diskless) DS212j (White) with Bittorrent Downloader
  3. Buffalo Technology LinkStation Pro 2 TB High Performance (Black)
CouchPotato Web Interface
CouchPotato Web Interface

There is one final step after activating CouchPotato Apache reverse proxy. If you have DHCP server (eg. router), you may have forwarded the port (5000, 5050, or whichever port your CouchPotato is listening at) to the computer on which CouchPotato is running. You may now disable this cutting access to the CouchPotato using the port. However, there is a disadvantage to doing this. You will not be able to use CouchPotato remote clients (eg. Mobile Potato or userscripts on other computers or phones to connect and control your CouchPotato. So the decision to forward the port is up to you.

Recommended For You:

There you have it. Setup CouchPotato Apache reverse proxy and enjoy the easier access to the CouchPotato web interface.

We Are Hiring: Familiar with Media Streaming, HTPC, Home Server, Smart Home, and Home Automation topics? Write about it and earn money. No writing experience needed. APPLY HERE.

Get 20% OFF with IPVanish VPN:

♦   Hide your browsing and streaming activity: No logs and no tracking
♦   Access geo-restricted content from anywhere
♦   Encrypt and anonymize: Kodi, Plex, Downloads, Personal Info
♦   Windows, Mac, Linux, Android, iOS, Router, and more.
♦   Money back guarantee - Sign Up Now

About the author

Anand

Anand is a self-learned computer enthusiast, a part-time blogger, and a Food Scientist by career. He has been blogging since 2010 on Linux, Ubuntu, Home/Media/File Servers, Smart Home Automation, and related HOW-TOs on htpcbeginner.com and smarthomebeginner.com.

Archives

Join the other 110,000 followers