Contents
Couch Potato Server.
“Download movies automatically, easily and in the best quality as soon as they are available”
Important!
Tested:
- Debian 8.xx
- Apache 2.4.X
1. Install some needed dependencies..
sudo apt-get install python-dev git-core python-virtualenv php5-sqlite python
2. Create User and Group for Couch Potato Server – couchpotato.
Create user couchpotato:
- home – /opt/couchpotato,
- no password,
- no login.
sudo useradd -d /opt/couchpotato -m couchpotato sudo adduser www-data couchpotato
3. Download and install Couch Potato Server from GIT.
Download and install newer version of Couch Potato Server to /opt folder.
sudo git clone https://github.com/CouchPotato/CouchPotatoServer.git /opt/couchpotato sudo mkdir /opt/couchpotato/logs sudo chown couchpotato:couchpotato /opt/couchpotato -R
Notice
After installation you can run Couch Potato Server by command:
sudo python /opt/couchpotato/CouchPotato.py
4. Autostart init script.
sudo cp /opt/couchpotato/init/ubuntu /etc/init.d/couchpotato sudo cp /opt/couchpotato/init/ubuntu.default /etc/default/couchpotato sudo chmod +x /etc/init.d/couchpotato sudo update-rc.d couchpotato defaults
5. Edit startup config file.
sudo nano /etc/default/couchpotato
Add credentials:
CP_USER=couchpotato CP_HOME=/opt/couchpotato CP_DATA=/opt/couchpotato CP_PIDFILE=/var/run//couchpotato.pid PYTHON_BIN=/usr/bin/python
Usage: /etc/init.d/couchpotato {start|stop|restart|force-reload|status}
6. Configure Apache2 server as Proxy with SSL.
Install Apache2 server using this tutorial:
http://pl.terminal28.com/instalacja-i-konfiguracja-apache-php5-ruby-python-webdav
Create 2 virtualhosts:
Configure virtualhost to listen on port 80 and redirect to port 443 (SSL).
Create config file /etc/apache2/sites-available/couchpotato and add the following records ect.
sudo nano /etc/apache2/sites-available/couchpotato
# couchpotato.yourhost.com - PORT 80 #===========================================================================
<VirtualHost *:80>
ServerName couchpotato.yourhost.com ServerAlias *.couchpotato.yourhost.com ErrorLog /var/log/apache2/error.log CustomLog /var/log/apache2/access.log combined
RewriteCond %{SERVER_PORT} !^443$ RedirectMatch ^/$ https://couchpotato.yourhost.com
</VirtualHost>
#===========================================================================
# couchpotato.yourhost.com - PORT 443 #===========================================================================
<VirtualHost *:443>
ServerName couchpotato.yourhost.com ServerAlias *.couchpotato.yourhost.com ErrorLog /var/log/apache2/error.log CustomLog /var/log/apache2/access.log common
SSLEngine On SSLCertificateKeyFile ssl/apache.pem SSLCertificateFile ssl/apache.pem
<Proxy *> Order deny,allow Allow from all </Proxy>
ProxyRequests Off ProxyPass / http://localhost:5050/ ProxyPassReverse / http://couchpotato/
</VirtualHost>
#===========================================================================
sudo ln -s /etc/apache2/sites-available/couchpotato /etc/apache2/sites-enabled/couchpotato
sudo a2enmod proxy sudo a2enmod proxy_http sudo /etc/init.d/apache2 restart
7. Acces to Couch Potato Server (SSL).
http://couchpotato.yourhost.com
Notice
Support my work by donation. Thank You.