Tuesday, 23 April 2013

Switching website hosting and domain name registrars

I'm moving my website hosting from Bluehost to Hostmonster. The software is already running on both hosts, but is waiting for the registration of disinterest.org to transfer from joker.com to namecheap. The switches both from Bluehost to Hostmonster, and from joker.com to namecheap, are both somewhat ridiculous.

Domain name transfer bullshit

Did you know that domain name registries have a 5 day period within which they have to transfer your domain, from the time you requested the transfer? So what do they do? They delay the transfer to take place at the end of the five days, giving you multiple ways to cancel the transfer but none to do away with this obstacle and nuisance. Here's the joker.com transfer process:

  1. You unlock the domain to allow transfers at joker.com
  2. You request the authorisation code to transfer the domain from joker.com.
  3. You give the authorisation code to namecheap.
  4. Namecheap tells you that it is waiting for the existing registrar (joker.com) to release the domain.
  5. joker.com sends the administrative contact (me) an email with a link to approve the transfer, which I click on.
  6. joker.com sends you a fuck you email with a date and time five days away saying it will only complete then, with multiple ways to cancel the process. All this in "English as a second language" English, which gives you the idea if you click on the link you'll probably cancel it, but the hope that if you click on it you'll be able to make the transfer complete. But you can't click on it, because you just know that if you do, you'll most likely have to go through all this bullshit again.
  7. Five days later, you're waiting for the process to complete, not knowing when it will happen because joker.com gave you the time in whatever their local timezone is.
The joker.com interface has not changed in the probably ten years I've been with them. The interface is confusing, to say the least. I've revoked access to the disinterest.org domain for an old email address using their interface, only to find out that I'd revoked access to my new email address. I thoroughly recommend you avoid joker.com as a domain name registrar. It was better than the alternatives whenever I started using it, but the internet has moved on even if joker.com hasn't. Oh, and to cap it all off, you can't modify anything to do with your domains while they're holding off transferring it for those five days. Another incentive to cancel the process, as a double fuck you with cream on top.

Namecheap is simply cheaper. It also has monthly coupons which reduce their prices for transferring over even further. It's a win-win to switch to them. Their interface is cleaner and much much much much easier to understand. They also have scads of glowing recommendations in various reddit topics which deal with domain name registrars. There's no way it can be worse, and should I need to transfer away from them, they can't delay the transfer more than the mandated limit of five days.

Hosting renewal bullshit

Bluehost and Hostmonster are the same. Their interface is the same. They used to have the same CEO at the same time. There's no discernable difference between them, besides the name and the logo. As far as I can tell, they are simply a market grab by having two presences on the market. It is something like 90$US a year to host disinterest.org with Bluehost, but by becoming a new Hostmonster customer and paying for 3 years, I can reduce the 3 year hosting cost from 270$US or whatever to around 150$US. I contacted Bluehost customer support and mentioned this, and they said "sounds like a good deal, you should move." But they wouldn't give me a better deal with Bluehost to prevent me from moving. It's a bit of a nuisance to move, but the savings are worthwhile. Maybe in three years, I'll switch back :-)

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.

Saturday, 16 March 2013

Installing Tiny Tiny RSS on Bluehost

This post is obsolete, go to the updated post.

Scroll down past the installation steps, to see screenshots.

Here's my initial list of steps to install Tiny Tiny RSS on Bluehost, following the installation notes:

  1. Download the source code.
    wget -c "https://github.com/gothfox/Tiny-Tiny-RSS/archive/1.7.4.tar.gz"
  2. Unpack it.  Note: GitHub appears to give a download filename of "1.7.4"
    tar xzf 1.7.4
    cd 1.7.4
  3. Open a web browser to the Bluehost cpanel.
  4. Create the database there, as per Bluehost's instructions.
  5. Import the tt-rss database schema.
    mysql -p -u [user] [database] < schema/ ttrss_schema_mysql.sql
  6. Rename, read and modify the config file.
    cp config.php-dist config.php
    nano -w config.php
  7. config.php changes: 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.  Also SELF_URL_PATH to incorporate your host name.
  8. config.php changes: You need to change 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.
  9. 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.
  10. Put the "1.7.4" directory in place.  In my case, I had set my SELF_URL_PATH to disinterest.org/tinytinyrssx, so I executed the following:
    mv 1.7.4 public_html/tinytinyrssx
  11. You'll probably want to look into this if you're migrating from Google Reader.  It mentions a script that will import more of your Reader data than just the OPML subscriptions.
  12. Open your SELF_URL_PATH in your web browser.
At this point I saw the following:


Bluehost does not allow background processes, and in kills long running ones.  So I opted out of the background daemon feed updating approach, and went with a CRON job.  The given link suggests executing the script twice an hour, and gives the basic command line to use.
cd /home/disinter/public_html/tinytinyrssx && /usr/php/53/usr/bin/php /home/disinter/public_html/tinytinyrssx/update.php -feeds >/dev/null 2>&1
Filling in the form, like so:


Now, I was wondering what the login name and password was, or how to set them.  The installation notes are clear that you should log in with "admin" and "password" respectively.  You can change them once logged in through the Preferences menu, which is the first menu item in the Actions menu in the top right hand corner.

Having logged in:


The Feeds tab in the Preferences menu:


The OPML tab (the button is in the lower portion of the previous screenshot):


Having pressed "Import my OPML":


And back to the article view:


Nothing to see yet, I guess no updating has happened.  Looking at the CRON job, it was discarding output. I deleted the CRON job and executed the script by hand to find out it was erroring.

The reason for the error is that Tiny Tiny RSS does not support shared hosts, or so they say on their homepage.  What this appears to mean, is that sites like Bluehost which sell people like me accounts, sell accounts that run on shared hosts.  So the tt-rss update.php script when run from the command line does not have support for command line arguments.  I manually modified update.php and hard-coded a command line argument of -feeds.  This gave the following output, after an initial delay:
Content-Language: auto
Content-Type: text/html; charset=
[01:13:02/11932] Scheduled 100 feeds to update...
[01:13:03/11932] Expiring cache/simplepie
[01:13:03/11932] Removed 0 files.
[01:13:03/11932] Expiring cache/images
[01:13:03/11932] Removed 0 files.
[01:13:03/11932] Expiring cache/export
[01:13:03/11932] Removed 0 files.
[01:13:03/11932] Removing old lock files...
[01:13:03/11932] Removed 0 files.
[01:13:03/11932] Feed: http://community.livejournal.com/tads3/data/rss, 0000-00-00 00:00:00
...
[01:18:36/11932] Sending digests, batch of max 15 users, headline limit = 1000
[01:18:36/11932] All done.
[01:18:37/11932] Feedbrowser updated, 340 feeds processed.
[01:18:37/11932] Purged 0 orphaned posts.
[01:18:37/11932] Cleaned 0 cached tags.
And returning to my Tiny Tiny RSS website, updates have been pushed to my web browser:


However, there are obviously over 1000 articles unread.  Why are only four displayed?  This is because of the "Special" category shown in the left hand pane.  Within this, I can see that I am seeing "Fresh articles", which obviously are those unread and recent.  By selecting the "All articles" Special entry in the left hand pane, then ensuring "Unread" is selected in the first drop down in the right hand pane (see last screenshot, where it is already there for the "Fresh" articles).  Then I actually get all unread articles.

All the unread articles (which I've previously read on Google Reader) can be marked as read in the Actions menu.  However, the UI does not appear to update, and a manual refresh of the web page is needed. Otherwise, that's it.  The CRON job takes care of further updates. 

Edit: Changes to update.php..
...
        init_connection($link);

        // INSERT A HARD-CODED $argv VALUE
        $argv = array('-feeds'); 
        $op = $argv;

        // CHANGE THIS IF STATEMENT TO BE THIS
        if (count($argv) == 0){ // && !(defined('STDIN') || (substr(PHP_SAPI, ...
                ?> <html>
                <head>
                <title>Tiny Tiny RSS data update script.</title>
...
        }

        // CHANGE THE || TO && TO GET THIS TO WORK
        if (count($argv) == 1 && in_array("-help", $op) ) {