Virtualhost for Couchpotato, Sickbeard, Transmission and SABnzbd
I wanted to be able to get to my applications without having to enter the port numbers e.g.
http://mydomain.com/couchpotato
instead of
http://mydomain.com:5000
First off is to add the information to enable the Apache Proxy Module. This information came from linode.com
sudo gedit /etc/apache2/mods-available/proxy.conf |
File excerpt: /etc/apache2/mods-available/proxy.conf
<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 deny,allow Allow from all </Proxy> # 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> |
Then you need to make sure that the modules are enabled
sudo a2enmod proxy sudo a2enmod proxy_http sudo /etc/init.d/apache2 restart |
Then you need to add the locations to the defaults sites
sudo gedit /etc/apache2/sites-available/default |
File excerpt: /etc/apache2/sites-available/default
<Location /couchpotato> ProxyPass http://localhost:5000 ProxyPassReverse http://localhost:5000 </Location> <Location /sabnzbd> ProxyPass http://localhost:8080/sabnzbd ProxyPassReverse http://localhost:8080/sabnzbd </Location> <Location /sickbeard> ProxyPass http://localhost:8081/sickbeard ProxyPassReverse http://localhost:8081/sickbeard </Location> <Location /transmission> ProxyPass http://localhost:9091/transmission ProxyPassReverse http://localhost:9091/transmission </Location> |
Restart apache by running
sudo /etc/init.d/apache2 restart |
You will have to edit the config.ini files for both Couchpotato, and SickBeard to use a webroot. Here’s are the lines in the config.ini files that had to change, and what they were changed to.
SickBeard config.ini
web_root = /sickbeard
Couchpotato config.ini
urlbase = couchpotato
Hi,
Thank your for this great tutorial.
However could you explain :
“You will have to edit the config.ini files for both Couchpotato, and SickBeard to use a webroot…”
i’ve tried to set the webroot to “/sickbeard” but all the links don’t work, and images are not displayed.
Thank you
Gpo
Here’s are the lines in my config.ini files that I had to change, and what I changed them to.
SickBeard config.ini
web_root = /sickbeard
Couchpotato config.ini
urlbase = couchpotato
I believe that Sickbeard can not be running when you edit the file, or it will overwrite it when it gets shutdown/restarted. I don’t remember if Couchpotato is the same or not.
Waouh ! it’s working !
you’re right. Sickbeard wasn’t seeing the new web_root option.
Thanks a lot !
See ya
I’ve been battling with this for days now.
Best I can get is basic text, no images.
My Apache2 doesn’t allow locations so instead I have:
ProxyPass /couchpotato/ http://localhost:5000
ProxyPassReverse /couchpotato/ http://localhost:5000
Can’t figure out why?
@Ryan
What error does it give you when you add the locations to /etc/apache2/sites-available/default? Did you make sure that you enabled the proxy and proxy_http modules and restart apache?
Another solution that doesn’t need to change the web root/url base:
In your apache vhost:
# Rewrite engine needed – a2enmod rewrite
RewriteEngine On
# XBMC Reverse Proxy (XBMC listening on localhost:8081)
# Redirect subrequests GET /foo/bar to GET /xbmc/foo/bar
RewriteCond %{HTTP_REFERER} ^https?://[^/]+/xbmc
RewriteCond %{REQUEST_URI} !^/xbmc
RewriteCond %{THE_REQUEST} ^GET
RewriteRule ^/(.*) /xbmc/$1 [QSA,R]
# Rewrite subrequests POST /foo/bar to POST /xbmc/foo/bar
RewriteCond %{HTTP_REFERER} ^https?://[^/]+/xbmc
RewriteCond %{REQUEST_URI} !^/xbmc
RewriteCond %{THE_REQUEST} ^POST
RewriteRule ^/(.*) /xbmc/$1 [QSA,PT]
ProxyPass /xbmc/ http://localhost:8081/
ProxyPassReverse /xbmc/ http://localhost:8081/
# now you can replace each “xbmc” string with “couchpotato” or “sickbeard” etc
# and modify the listening port accordingly