Help troubleshooting failed installation on VPS

Describe the problem you’re having:
I am trying to install tt rss on a VPS with clean Ubuntu 16 OS. Default Nginx server was up and running, but when I try to enable ttrss instead and restart Nginx, I can only access an empty web page.

I have used the following lines in /etc/nginx/sites-avaialble, and created symbolic link to sites-enabled:

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 [sever public IP]; ## of course ip address instead of brackets.

   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/php/php7.0-fpm.sock;
       fastcgi_index index.php;
       include /etc/nginx/fastcgi_params;
   }

}


tt-rss version (including git commit id):
commit 8569b95a28070e03b36c7f8e2f845f63d6c5a400

Platform (i.e. Linux distro, PHP, PostgreSQL, etc) versions:
Ubuntu 16.04.2 LTS. PHP 7.0. nginx/1.10.3. PostgreSQL 9.5.9.

Please provide any additional information below:

This is my first time working with servers, and I have no clue how to troubleshoot this. Thankful for any advice.

You’re going to need to search the internet for some tutorials for setting up Nginx and PHP-FPM because that Nginx conf is weird. Might work. Might not. Search something like “WordPress Nginx PHP-FPM Ubuntu tutorial” and adapt accordingly–there are countless examples out there.

Also, a blank screen usually means a PHP error of sorts so check those error logs.

Huh. Where did you manage to find that … mutilated … config?

Edit: ah, DigitalOcean. Yea… you’re not the first with that problem; others have it in the comments on that page. That config’s fucked; reinstall nginx and start over. All you really need to do is take the default config that ships with nginx, uncomment the location ~ \.php$ block, and add index.php to the index list. Dump your ttrss files into /var/www/html or change the root if you want.

Should website files stay in /var/www/hmtl or user/share/nginx? My default nginx installation put index.html in both these paths. Also, instead of rewriting the default config, can I create a new one called ttrss and create a symbolic link to that config in sites-enabled (as proposed on DigitalOcean)? I want to host multiple sites in the future (but that’s a later problem).

You should do whatever works for you best.
I propose putting your stuff in /var/www/html/ttrss and call it like example.com/ttrss that’s straight-forward and beginner friendly, I hope.
But first of all read some documentation about nginx, if you can’t figure this out by yourself, maybe you should not host your own stuff because your setup might be insecure.

In /var/ because var is for this kind of stuff. Really if you’re running a single site use /var/www/html/ if you’re running multiple sites then something like /var/www/domain.tld/ is a good practice (assuming you are the only one managing all the sites).

Yes, you should create new files then symlink them.


As a reminder: This forum is not a “help me get my web stack running”… for that visit a site like stack overflow.

Thanks for all the help! Will try to read up on these things and hopefully get it working. Will use appropriate forum for future questions.