Sunday 7 April 2013

Installing Tiny Tiny RSS on Bluehost/Hostmonster (v1.7.8)

People report that works for other shared hosts, like Hostmonster. And see the comments on the previous post, for potential help with any problems you may encounter.

Installation steps

To actually get to the point you have a working installation of Tiny Tiny RSS on Bluehost, the following steps are adapted from the basic installation notes:

  1. Download and extract the source code for Tiny Tiny RSS for version 1.7.8. Later versions may change in ways where the following instructions no longer work.
    cd public_html
    wget -c "https://github.com/gothfox/Tiny-Tiny-RSS/archive/1.7.8.tar.gz"
    tar xzf 1.7.8
    mv Tiny-Tiny-RSS-1.7.8 tt-rss
    cd tt-rss
    .
    Note that GitHub serves a file named "1.7.8", so the tar command needs to specify that file name and not the one given to wget. Note that "tt-rss" is used in the SELF_URL_PATH configuration variable mentioned below, and maps to this sub-directory you've created in your "public_html" directory. If you plan to use a unique and secret directory name, you'll need to change both these locations.
  2. Open a web browser to the Bluehost cpanel.
  3. Create the database and database user there, as per Bluehost's instructions.
  4. Import the tt-rss database schema, replacing [user] and [database] respectively with the values you used in cpanel.
    mysql -p -u [user] [database] < schema/ ttrss_schema_mysql.sql
  5. Make the configuration file that Tiny Tiny RSS expects, and prepare to start editing it.
    cp config.php-dist config.php
    nano -w config.php
  6. Edit the following variables within the configuration file:
    • DB_TYPE to "mysql".
    • DB_USER to your user name.
    • DB_NAME to your database name and DB_PASS is of course your database user password.
    • SELF_URL_PATH to incorporate your host name (this must map to the directory name it was extracted to).
    • PHP_EXECUTABLE to /usr/php/53/usr/bin/php.  The tt-rss website states that PHP 5.3 or newer is required, however by default PHP_EXECUTABLE points to version 5.2 of PHP on Bluehost.  Go to the PHP Config button in the Bluehost cpanel and select PHP 5.3 there, this will set your php.ini in your public_html directory and other things.
    • Maybe ENABLE_GZIP_OUTPUT to true. If you do not know that your PHP installation supports GZIP, then go to the extra section below related to checking PHP suitability.
At this point, you should open your browser and view the address in SELF_URL_PATH. It should show you the next screenshot. If you do not see the Tiny Tiny RSS login screen, you have done something wrong.

Securing your installation

At this point you will see the following web page. Log in using the default login name which is "admin" and the default password, which is "password". We will proceed to chance these.


Select the preferences item in the menu on the top right hand side of the feeds view.


Select the rightmost pane, which is the "Users" pane where we will change your password.


Check the "admin" user, and click the "Edit" button in the row above it.



Importing Google Reader data

Tiny Tiny RSS supports importing two things, feed subscriptions, and starred items. Go to Google Takeout and get your Google Reader data. If you do not know how to do this, google how to do it. You should get a zip file with "subscriptions.xml" and "starred.json" files within it (among others). Extract these two files somewhere convenient.

Enable importing from Google Reader. Go to the Plugins sub-pane on the main Preferences pane.


Within the Feeds pane, select the OPML sub-pane and import your "subscriptions.xml" file. If you return to the main view, exiting the preferences screen, then you should see these subscriptions populating the left-hand side of the page.


Within the Feeds pane, select the 'Select starred or shared items from Google Reader' sub-pane. Import your "starred.json" file. This will eventually popup a dialog telling you how many items were imported.


Time to populate the feeds, and then to have them populated automatically from then on.

Automatically updating your feeds

Your feeds have been entered in Tiny Tiny RSS, but it still needs to update your feeds and fetch the new items for you.

This will not fetch all the items you have in Google Reader. This is because feeds offer a set number of recent items, and not all items ever posted to them in the past. Tiny Tiny RSS is not intended to keep older items indefinitely, and from what I can tell users are expected to have it discard them after holding them for a limited period of time.

Do an initial fetch with the following command line:
cd ~public_html/tt-rss
/usr/php/53/usr/bin/php-cli update.php --feeds
If you are successful, this will output the following:
...
[22:11:04/12302] Base feed: http://simple-green-frugal-co-op.blogspot.com/feeds/posts/default
[22:11:04/12302]  => 0000-00-00 00:00:00, 100
...
[22:11:09/12302] Sending digests, batch of max 15 users, headline limit = 1000
[22:11:09/12302] All done.
[22:11:09/12302] Feedbrowser updated, 340 feeds processed.
[22:11:10/12302] Purged 0 orphaned posts.
[22:11:10/12302] Cleaned 0 cached tags.
This may not fetch all your feeds. If it hasn't fetched a feed this is okay, it will eventually fetch it, and is likely limiting the server load per attempt.

Now that you know updating is working, add this as a cron job so that it happens every 30 minutes. Return to your Bluehost control panel and find the 'Cron jobs' link. On the cron jobs page, add a new one that happens twice an hour, with the following command line:
cd /home/disinter/public_html/tt-rss2 && /usr/php/53/usr/bin/php-cli /home/disinter/public_html/tt-rss2/update.php --feeds >/dev/null 2>&1
You will of course need to replace "disinter" with your own Bluehost account name.



Extra: The missing manual

Between the bugs and the lack of documentation, I have several things I wouldn't want to have to work out again due to the extra confusion they caused and the time they wasted:
  • Selecting "Use less traffic" when logging in will cause images to be displayed as links.
  • It is not possible to cache images locally (when feeds are updated) as a global default setting, each feed should be manually set to have this option in Preferences. The best time to do this is just after the feeds are imported (or manually added), and before they are updated for the first time.

Extra: Checking PHP suitability

If you are using a web host that is not Bluehost, you might wish to verify that the version of PHP available to you, is suitable.

The main tt-rss page lists required PHP modules, which are mbstring and json.  These are present on Bluehost, and can be seen by reading the following generated file:
echo "" | php > phpinfo.html
pcntl is also installed, which is said to allow forked updating of subscriptions I guess.  php_basedir has no value, which should mean unlimited open files, but Bluehost may have some other resource limiting in place.  allow_url_fopen is on.  So it all looks good.

Extra: Hostmonster confirmation

Hostmonster is exactly the same as Bluehost with a different logo and a different name. I've switched my hosting to Hostmonster, and setting up tt-rss there is exactly the same as for Bluehost.

3 comments:

  1. I was able to change the default for caching images globally by direftly modifying the database table definition. Using MySql the "feeds" table a column called "cache_image" which I changed the default from 0 to 1 on using the "phpMyAdmin" control Panel. I also did a quick "UPDATE _feeds SET cache_image = 1" statement to enable caching on all rows which updated the already loaded feeds. the process should be pretty easy to figure out. If you aren't used to sql syntax the actual statement in quotes will work, modified with your actual table name of course. I imagine PostGre will be basically the same. I can't imagine the table strucutre is all that different.

    ReplyDelete
  2. Right, I've now taken the other approach and had the PHP feed insertion code do it.

    ReplyDelete
  3. Thanks for the instructions. I used the GUI version of your instructions and then stumbled into the built-in install for tt-rss by accident. Here are my modified instructions:

    1. I went to the Tiny Tiny RSS site,http://tt-rss.org/redmine/projects/tt-rss/wiki, and downloaded the tarball, v1.7.9 (May 13, 2013)
    2. I logged into the Controlpanel application on Bluehost and created a subdomain(Domains-Subdomains) with its own folder. I called the subdomain, reader, as a memorial to Google Reader.
    3. I used the File Manager(Files-File Manager) to upload the tarball to public_html, expanded the tarball, and then moved the source code to the reader folder.
    4. I created a new data base(Databases-MySQL Databases) called myusername_tt-rss, a data base user called myusername_ttrss, assigned the user to the tt-rss database, and assigned all privileges to the user.
    5. Although I used PhpMyAdmin to import the schema and edited the config.php file via the File Manager, I found that this was not necessary. When I opened the browser and went to http://reader.wehuberconsultingllc.com, I accidentally ended up at the install screen. I followed its instructions to import the schema and edit the config.php. When I went to the home screen, everything worked. If I ever have to do this again I would open a browser and go directly to http://reader.wehuberconsultingllc.com/install/ instead.
    6. I followed your instructions for securing the admin password and importing my subscriptions and starred items.
    7. I followed your instructions for updating the feeds manually but I changed the cron job command line to: cd ~/public_html/reader && /usr/php/53/usr/bin/php-cli ~/public_html/reader/update.php --feeds --quiet >/dev/null 2>&1

    ReplyDelete