Install tt-rss

From Jay's Cafe' Wiki

Instructions from here

Adapted from [here](https://www.digitalocean.com/community/tutorials/how-to-install-ttrss-with-nginx-for-debian-7-on-a-vps) 

1) Install all packages

```bash
sudo apt-get update
sudo apt-get install php5 php5-pgsql php5-fpm php-apc php5-curl php5-cli postgresql nginx git
```

2) Configure PostgresSQL

```bash
sudo -u postgres psql
postgres=# CREATE USER "www-data" WITH PASSWORD 'yourpasshere';
postgres=# CREATE DATABASE ttrss WITH OWNER "www-data";
postgres=# \quit
```

3) Start nginx

```bash
sudo service nginx start
```

4) Install TT-RSS

```bash
cd /usr/share/nginx
git clone https://github.com/gothfox/Tiny-Tiny-RSS.git tt-rss
sudo mv tt-rss ttrss
sudo chown -R www-data:www-data ttrss
```

5) Setup TT-RSS

```bash
cd /etc/nginx/sites-available
sudo nano ttrss
```

Paste the following into the file. Modify line "server_name" to match your domain name or ip.

```
server {
    listen  80; ## listen for ipv4; this line is default and implied

    root /usr/share/nginx/ttrss;
    index index.html index.htm index.php;

    access_log /var/log/nginx/ttrss_access.log;
    error_log /var/log/nginx/ttrss_error.log info;

    server_name name.here;

    location / {
        index           index.php;
    }

    location ~ \.php$ {
        try_files $uri = 404; #Prevents autofixing of path which could be used for exploit
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include /etc/nginx/fastcgi_params;
    }

}
```


To enable this config file (and disable the default welcome page):
```
cd /etc/nginx/sites-enabled
sudo rm default
sudo ln -s ../sites-available/ttrss ttrss
```

Restart nginx:

```bash
sudo service nginx restart
```

5) Setup TT-RSS


Head to http://your.server.ip. You should see the Tiny Tiny RSS install page.

Fill fields as follows:

Database type: Select PostgreSQL

Username: www-data

Password: The password you used during Step 2

Database Name: ttrss

Hostname: leave blank

Port: 5432

Press "Test configuration" button, then "Initialize database" and then "Save configuration". Now your TTRSS is configured. Go to http://your.server.ip and login to default admin account (Username: "admin" Password: "password"). In the top-right go to Actions->Preferences. You can change TTRSS settings there. It is recommended to create a new user account and use it for RSS reading instead of admin account. Also, do not forget to change your admin password to a different one from default.

6) Add automatic update with cron

```bash
sudo nano /etc/crontab
```

Paste the following lines to the end of the file. This tells cron to call update.php every 30 minutes.
```
*/30 * * * * www-data /usr/bin/php /usr/share/nginx/ttrss/update.php --feeds --quiet
```