A better way to share eBooks, or my OPDS library version 2.0

Some time ago, I wrote a guide on how to create an online eBook library, accessible from a browser or Android/iPhone device. The benefits are many. You always have access to all your books, anywhere. You can directly share them with your friends. You don’t have to manage local libraries on your devices.

Since I wrote my first post, a number of better tools have come along which make this easier. Here is the new way to do it.

You will need:

  • A personal web server capable of running PHP applications. You can use a real server or a virtual machine as long as it has a public IP address you can access. Or you could use your desktop PC, accessible only within your private LAN when you’re at home. Dropbox is no longer an option, as only serves static content (not PHP apps). I use the latest Ubuntu LTS release with Apache and PHP 5.3, on my own server with a public IP address.
  • Calibre, to manage your eBook library. Calibre is awesome. It converts between virtually all eBook formats, can strip DRM, and stores and manages your books in a way you can easily access with a file browser.
  • ownCloud, to synchronise your Calibre data to your server automatically. Alternatively, you can use any file synchronisation tool.
  • COPS, a PHP application which can read Calibre’s metadata and generate OPDS and HTML catalogs. OPDS is an interchangeable format for describing and sharing eBooks – such as in a personal library.
  • An eBook reader with OPDS support, such as FBReader or MegaReader.

How to do it:

Install Calibre

Installing Calibre is easy. On Ubuntu, just run:

apt-get install calibre

Run it for the first time, add some eBooks to your library, and close the application. For this example, I assume that you will save your eBooks to ~/Library.

Calibre can also serve its own books directly as an OPDS library. However, Calibre is a GUI application, so I run it only on my desktop.

Install ownCloud on your server

Install ownCloud according to the instructions. For this example, I assume you will configure owncloud at www.example.com/owncloud, and that you will create a user called “tyler”.

Install owncloud-client on your desktop

Like Calibre, you can install the ownCloud desktop client easily:

apt-get install owncloud-client

Start it and add ~/Library as a new share. It will be uploaded to a directory on the server such as:

~/public_html/owncloud/data/tyler/files/ownCloud/Library/

Install COPS

Download and install COPS according to the instructions. For this example, I assume you will install COPS in ~/public_html/cops, and will create a symbolic link to point to your Library folder in ownCloud folder for ease of use. I have configured this as so:

cd ~/public_html/cops
ln -s ../owncloud/data/tyler/files/ownCloud/Library

This symbolic link works around ownCloud’s htaccess restrictions to make the eBook files readable.

Now edit config_local.php with your preferred settings. Be sure to configure $config['calibre_directory'] to point to your Calibre folder:

$config['calibre_directory'] = 'Library/';

COPS’s author, Sébastien, is a nice guy who would appreciate any patches, translations, or beer you have for him.

You should now be able to browse to your library. For example:

http://www.example.com/cops

COPS HTML Library Catalog

COPS HTML Library Catalog

Safety tip: click the “gear” icon for a very useful search dialog.

Install an eBook reader with OPDS support

I prefer to read with FBReader on Android devices. On Apple iOS, consider MegaReader. Kindle users can’t use OPDS, but can download eBooks via the web interface or “side-load” them via USB from a PC. Here are the instructions for FBReader; other software is similar.

  1. Install FBReader from Google Play and open it.
  2. Press “Network library” button
  3. Press “Add catalog”
  4. Select “Enter URL manually”
  5. Enter the URL to your library, appended with “/feed.php”. For example, “http://www.example.com/cops/feed.php”.
  6. Press OK twice. Your catalog will now appear in the list.

You can now browse your catalog within FBReader, select any book, and download it, and read it without navigating out again.

Updating the library

Once you have all this set up, updating your library is easy. Just add the book in Calibre and quit. ownCloud will synchronise the new files to your server in the background. The new books will be available in COPS as soon as it completes.

Tags: , , ,

  1. Rishi Saran’s avatar

    Tyler as discussed in the emails, I am posting all the emails that we exchanged shere so that others can learn from my experience and benefit from your guidance further.

    Email String Timeline (Ascending):

    Email 1 (Reply to my Comment by Tyler): tolaris.com
    Jun 11 (7 days ago)

    to me
    There is a new comment on the post “My OPDS library”.
    http://www.tolaris.com/2012/02/13/my-opds-library/

    Author: Tyler Wagner
    Comment:
    Sorry, Rishi, I can’t help you. I’m no longer using Calibre2OPDS, and I’ve never used GDrive or Dropbox for sync. Nor have I used Calibre Cloud Pro. In fact, I now use Calibre+ownCloud+COPS:

    http://www.tolaris.com/2014/04/25/a-better-way-to-share-ebooks-or-my-opds-library-version-2-0/

    My first suggestion is to test against another eBook reader with OPDS support like FBReader. Every reader has odd quirks of what it can support and what it cannot. If you find a solution, please let me know.

    See all comments on this post here:
    http://www.tolaris.com/2012/02/13/my-opds-library/#comments

    To manage your subscriptions or to block all notifications from this site, click the link below:
    http://www.tolaris.com/?wp-subscription-manager=1&email=rishsaran%40gmail.com&key=63e0d66aa8346c682982557a0d27e7c9

    Email 2 (My Response): Rishi Saran
    Jun 11 (7 days ago)

    to tolaris.com
    Thank you.

    This is a bit technical for me. Is Google Drive static too, so I presume it will not help with php files. Is Owncloud free or does it cost money? Wish Dropbox had worked as per your previous write up. Unfortunately, the option for having a Public folder is only available to Pro or Business users. And the current e-book readers are a pain when it comes to library management.

    Thanks.

    Kind regards,

    Rishi Saran.

    Email 3 (Tyler’s Response):
    Tyler J. Wagner
    Jun 12 (6 days ago)

    to me
    Yes, all the free-service cloud filesharing services allow only static
    content. If you want to use PHP, you need to run your own website. What
    I’ve set up is very technical.

    I suggest starting over. Use just Calibre, Calibre Cloud Pro, and any
    sharing service. You won’t need OPDS if you use Calibre Cloud Pro; it reads
    Calibre’s files directly.

    Regards,
    Tyler

    Email 4 (My Response): Rishi Saran
    Jun 17 (1 day ago)

    to Tyler
    Hi Tyler,

    Thank you for your guidance. I have finally gone ahead with the technical route. I have made my Caliber libraries, Fiction and Non Fiction on my Laptop. I have set up a domain and registered with a web hosting service. I have successfully downloaded and installed owncloud webphp and desktop apps. What I am now struggling with is getting COPS php to work.

    Please would you be able to email a step by step guide to install COPS only as Sebastien’s instructions on his blog are not very clear from my layman perspective. Also attached is an error log that was generated by owncloud when uploading my ebooks to my web hosting domain. Some books were not uploaded. Not sure why. I have highlighted some of these errors in bold. Please if you can guide me on this one too. Many thanks.

    Kind regards,

    Rishi Saran.

    Email 5 (My Further Response): I forgot to mention in my previous email, the 2 libraries, fiction and non-fiction, created by Calibre, have been uploaded by owncloud on the hosting site within ‘/public_html/owncloud/data/saransorb/files’. The two folders Fiction (‘/public_html/owncloud/data/saransorb/files/f7n5/’) and Non Fiction (‘/public_html/owncloud/data/saransorb/files/nf795/’) are the folders within which the two types of books have been uploaded.

    Does this then mean that in the config_local.php.example file, the command should read:

    $config[‘files_directory’] = array (“Fiction” => “/public_html/owncloud/data/saransorb/files/F7N5/”, “Non Fiction” => “/public_html/owncloud/data/saransorb/files/NF7N5/”);

    before I rename the example file to config_local.php?

    Sorry I should have mentioned this before.

    Kind regards,

    Rishi Saran.

    Email 6 (Tyler’s response): Tyler J. Wagner
    Jun 17 (1 day ago)

    to me
    Rishi,

    One problem is that ownCloud isn’t syncing all files. This is the clue:

    Request Entity Too Large

    Check the sizes on all objects saying this. I’ll bet they are above a PHP
    upload threshold. I have these php.ini customisations:

    upload_max_filesize = 50M
    post_max_size = 50M
    expose_php = Off
    memory_limit = 256M

    Solve that first. Then for COPS, I’ve attached an example config_local.php.

    In my case, I just made a symlink to the owncloud folder:

    $ cd cops
    $ ln -s ../owncloud/data/tyler/files/ownCloud/Books/Library
    $ ls -l
    …. Library -> ../owncloud/data/tyler/files/ownCloud/Books/Library

    This bypasses the ownCloud permissions (.htaccess file), so COPS can serve
    these files.

    I’m happy to help, but please post your experiences somewhere. You are
    welcome to write a long comment to my blog post. I’d like to help not just
    you, but the next person who is looking for answers.

    Regards,
    Tyler

    Email 7 (My Response):
    Rishi Saran
    1:59 PM (23 hours ago)

    to Tyler
    Thank you so very much.

    I will start shooting my future issues on your blog and I will copy paste these emails there as well for all to see.

    Much appreciated.

    Kind regards,

    Rishi Saran.

    Email 8 (Tyler’s response): Try the symlink technique I used, also mentioned in the blog. I found that
    telling COPS to use ownCloud data didn’t work because of the htaccess
    restrictions employed by ownCloud.

    One way to test is to upload one of your libraries outside of ownCloud,
    like in cops/Library, and make COPS work with that. If it works, then you
    just need to get the COPS/ownCloud part working. Having two unknown parts
    at the same time is no fun.

    Regards,
    Tyler

    Reply

  2. Rishi Saran’s avatar

    Tyler,

    I don’t know how to create a symbolic link. So I went ahead with your 2nd suggestion. This is what I have done:

    I created a small library of 6 or 7 books just to try it out. I then uploaded this library/directory outside of owncloud and within COPS folder as per this “/public_html/cops-1.0.0RC1/calibre/COPS”

    I then renamed config_local.php.example to config_local.php and edited the following changes within this renamed file:

    <?php
    if (!isset($config))
    $config = array();

    /*
    * The directory containing calibre's metadata.db file, with sub-directories
    * containing all the formats.
    * BEWARE : it has to end with a /
    */
    $config['calibre_directory'] = '/public_html/cops-1.0.0RC1/calibre/COPS/';

    /*
    * Catalog's title
    */
    $config['cops_title_default'] = "COPS";

    /*
    * use URL rewriting for downloading of ebook in HTML catalog
    * See README for more information
    * 1 : enable
    * 0 : disable
    */
    $config['cops_use_url_rewriting'] = "0";

    After editing the path directory and saving it, I then ran config.php first. I got a blank browser screen. The details are as below:

    <?php
    /**
    * COPS (Calibre OPDS PHP Server) class file
    *
    * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
    * @author Sébastien Lucas
    */

    require_once ‘config_default.php’;
    if (file_exists(dirname(__FILE__). ‘/config_local.php’) && (php_sapi_name() !== ‘cli’))
    require_once ‘config_local.php’;

    I then ran checkconfig.php and got the following details in my browser window (link: http://saransorb.url.ph/cops-1.0.0RC1/checkconfig.php):

    COPS Configuration Check

    Check if GD is properly installed and loaded
    OK

    Check if Sqlite is properly installed and loaded
    OK

    Check if libxml is properly installed and loaded
    OK

    Check if the rendering will be done on client side or server side
    Client side rendering

    Check if Calibre database path is not an URL
    OK

    Check if Calibre database file exists and is readable
    File /public_html/cops-1.0.0RC1/calibre/COPS/metadata.db not found, Please check Value of $config[‘calibre_directory’] in config_local.php

    Value of open_basedir in your php.ini The access rights of the Calibre Database Synology users please read this

    I get exactly the same error message when I change the Calibre directory path to Owncloud. Now this metadata.db file is on the server. I am using web hosting by hostinger.co.uk. So firstly, I am not sure why is it not being found when it is already there. Secondly, how and where do I locate this php.ini file and do I have to? Lastly, the symlink commands that you shared in your email:

    $ cd cops
    $ ln -s ../owncloud/data/tyler/files/ownCloud/Books/Library
    $ ls -l
    …. Library -> ../owncloud/data/tyler/files/ownCloud/Books/Library

    Do I use them exactly as above with the following changes:

    $ cd cops
    $ ln -s ../owncloud/data/saransorb/files/ownCloud/’My Folder Name’/’My Calibre Library’
    $ ls -l
    …. Library -> ../owncloud/data/saransorb/files/ownCloud/’My Folder Name’/’My Calibre Library’

    If yes, where in config_local.php do I add these commands? Do I add them before this line or after:

    $config[‘calibre_directory’] = ‘/public_html/cops-1.0.0RC1/calibre/COPS/’;

    Please advise. I look forward to your response. Many thanks.

    PS: On the web hosting service that I am using, PHP version was set to PHP 5.3. I have today changed it to PHP 5.5.

    Kind regards,

    Rishi Saran.

    Reply

    1. Tyler Wagner’s avatar

      Rishi,

      This line:

       $config['calibre_directory'] = '/public_html/cops-1.0.0RC1/calibre/COPS/';

      Is a file path, not a URL path. It should be absolute or relative to COPS’s index.php. One of these:

       $config['calibre_directory'] = 'calibre/COPS/';
       $config['calibre_directory'] = '/home/rishi/public_html/cops-1.0.0RC1/calibre/COPS/';

      Reply

    2. Rishi Saran’s avatar

      This is the script of config_local.php file at my end…is this correct?

       ../owncloud/data/saransorb/files/F7N5;    
          $config['calibre_directory'] = 'F7N5/';
          
          
          /*
           * Catalog's title
           */
          $config['cops_title_default'] = "COPS";
          
          /*
           * use URL rewriting for downloading of ebook in HTML catalog
           * See README for more information
           *  1 : enable
           *  0 : disable
           */
          $config['cops_use_url_rewriting'] = "0";
      

      Reply

    3. Rishi Saran’s avatar

      Sorry, this one…please ignore the previous one…

       ../owncloud/data/saransorb/files/F7N5;    
          $config['calibre_directory'] = 'F7N5/';
          
          
          /*
           * Catalog's title
           */
          $config['cops_title_default'] = "COPS";
          
          /*
           * use URL rewriting for downloading of ebook in HTML catalog
           * See README for more information
           *  1 : enable
           *  0 : disable
           */
          $config['cops_use_url_rewriting'] = "0";
      

      Reply

    4. Rishi Saran’s avatar

      Don’t know what’s going wrong, the left bit is getting deleted when posting these comments to you,

      ../owncloud/data/saransorb/files/F7N5;    
          $config['calibre_directory'] = 'F7N5/';
          
          
          /*
           * Catalog's title
           */
          $config['cops_title_default'] = "COPS";
          
          /*
           * use URL rewriting for downloading of ebook in HTML catalog
           * See README for more information
           *  1 : enable
           *  0 : disable
           */
          $config['cops_use_url_rewriting'] = "0";
      

      Reply

      1. Tyler Wagner’s avatar

        Try wrapping code in <code> or <pre> tags. I’ve edited your comments to add them.

        Reply

        1. Rishi Saran’s avatar

          F7N5 is the folder containing all the books in my Fiction Library

          (” ‘/home/files/owncloud/data/saransorb/files/F7N5;
          $config[‘calibre_directory’] = ‘F7N5/’;

          /*
          * Catalog’s title
          */
          $config[‘cops_title_default’] = “COPS”;

          /*
          * use URL rewriting for downloading of ebook in HTML catalog
          * See README for more information
          * 1 : enable
          * 0 : disable
          */
          $config[‘cops_use_url_rewriting’] = “0”;”)

          Reply

        2. Rishi Saran’s avatar

          Email 9 (From me to Tyler): Rishi Saran
          4:23 PM (1 hour ago)

          to Tyler
          Sorry,

          I was unnecessarily clogging up your comments and blog due to my own incompetency.

          This is the scrip of congif_local.php file at my end after making changes to it as per your suggestions. I hope that I have got it right this time…

          Will it be better if I give you access to my Web Hosting account so you can overview what I am doing wrong? I am quiet an amateur to all o this…Sorry for the trouble. I will now post this email to your blog after I have sent it to you.

          /home/files/owncloud/data/saransorb/files/F7N5;
          $config[‘calibre_directory’] = ‘F7N5/’;

          /*
          * Catalog’s title
          */
          $config[‘cops_title_default’] = “COPS”;

          /*
          * use URL rewriting for downloading of ebook in HTML catalog
          * See README for more information
          * 1 : enable
          * 0 : disable
          */
          $config[‘cops_use_url_rewriting’] = “0”;

          Kind regards,

          Rishi Saran

          Email 10 (from Tyler): Tyler J. Wagner
          4:24 PM (1 hour ago)

          to me
          Honestly, it might be faster if I take a look directly. Change your
          passwords when I’m done, of course. I don’t mind looking if you promise you
          have backups and don’t get angry if I “rm -rf *” something. :)

          Regards,
          Tyler

          EMail 11 (From me to Tyler): Rishi Saran
          4:37 PM (59 minutes ago)

          to Tyler
          That will be brilliant. Thank you. I don’t have an issue at all. You will have to log in with my gmail id as I have taken a free web hosting for now. if this works, I will go for a proper web hosting subscription as I anyway have to ger a website developed for my business.

          Many thanks.

          I will forward a separate email to you that I has all my log in details.

          My gmail un is ********. pwd is ********. Many thanks.

          Kind regards,

          Rishi Saran.

          Email 12 (from Tyler):
          Tyler J. Wagner
          5:08 PM (30 minutes ago)

          to me
          OK, there were two issues:

          1. You had some Linux commands in your config_local.php file. I’ve
          commented them out.

          2. The path to your F7N5 database must be either absolute
          (/home/saransorb.url.ph/public_html/owncloud/data/saransorb/files/F7N5)
          or relative to the cops folder
          (../owncloud/data/saransorb/files/F7N5/)

          I chose relative, since I cannot access the Linux shell via SSH, so I’m not
          sure what the real path is. FTP hides that.

          Since you have two DBs, I set up COPS to use both. You can select your
          behaviour by setting one of these three:

          $config[‘calibre_directory’] = ‘../owncloud/data/saransorb/files/F7N5/’;

          $config[‘calibre_directory’] = ‘../owncloud/data/saransorb/files/NF7N5/’;

          $config[‘calibre_directory’] = array (
          “Fiction” => “../owncloud/data/saransorb/files/F7N5/”,
          “Non-fiction” => “../owncloud/data/saransorb/files/NF7N5/”
          );

          Regards,
          Tyler

          Email 13 (From me): Rishi Saran
          5:28 PM (11 minutes ago)

          to Tyler
          Hi Tyler,

          Thank you so very much. I have managed to get the full path from the customer service just now. The main command line for both the libraries now is this:

          $config[‘calibre_directory’] = array (“Fiction” => “/home/u240972965/public_html/owncloud/data/saransorb/files/F7N5/”, “Non-fiction” => “/home/u240972965/public_html/owncloud/data/saransorb/files/NF7N5/”);

          I hope that this works now.

          Kind regards,

          Rishi Saran.

          Email 14 (From Me): Rishi Saran
          5:32 PM (7 minutes ago)

          to Tyler
          You are a GEM!

          It worked. http://saransorb.url.ph/cops/checkconfig.php

          Now how do I run the cops database. Which PHP file do I use?
          Kind regards,

          Rishi Saran

          Email 15 (From Tyler): Tyler J. Wagner
          5:33 PM (7 minutes ago)

          to me
          Hi Rishi,

          Great! You don’t need the full path, though. Relative is just fine.

          Regards,
          Tyler

          Email 16 (From Tyler): Just load this:

          http://saransorb.url.ph/cops/

          Regards,
          Tyler

          Email 17 (From Tyler): Tyler J. Wagner
          5:38 PM (3 minutes ago)

          to me
          Oh yes, one tip: disable lightbox, and see if you like that better. I find
          it works better, and it’s easier to provide links to the url for people.

          Tyler

          Reply

        3. Rishi Saran’s avatar

          Tyler,

          I have finally figured out what Lightbox is. Would you know how to change the background colour of the COPS catalogue that opens when using this link [redacted]. Say change the full page color to black. Also is it possible to restrict access to this page via Username and Password. Would you know what needs to be done or will it be too much for an amateur like me to set up?

          Kind regards,

          Rishi Saran

          Reply

          1. Tyler Wagner’s avatar

            Using a password means setting up an .htaccess file like:

            Order allow,deny
            AuthType Basic
            AuthName "Library"
            AuthUserFile /home/rishi/etc/htpasswd
            Require valid-user

            You’ll also need to create the AuthUserFile with the htpasswd command on Linux, or you can find generators online.

            Reply

          2. Tyler Wagner’s avatar

            As for customising the appearance, see all of the css files in the cops/styles folder.

            Reply

            1. Tyler Wagner’s avatar

              It works. Are you sure you want it to be globally readable? I’m all for sharing. I just don’t want the copyright bastards to come looking for you.

              Reply

            2. Rishi Saran’s avatar

              Yeah true.  That’s why I wanted to protect access to it.  I was just trying to see how it works. Will get this website developed into a full company website by the next year and hide this info. Copyright has become such a pain. Those were such good days when growing up when you could buy a paper book read and share it with close family members. People still do but when it comes to going digital,  all these barriers shoot up.  Unfair application of the law.

              By the way I live in Leicester.  No I gave up on beer some years ago after witnessing my Dad’s illness. But will be more than happy to catch up over beer on me when I am in London next.

              Reply

            3. Rishi Saran’s avatar

              Hi Tyler,

              .https basic security added. thank you.

              Use these links for further guidance:
              http://www.javascriptkit.com/howto/htaccess3.shtml
              http://viralpatel.net/blogs/password-protect-your-webpages-using-htaccess/
              http://www.tools.dynamicdrive.com/password/

              Now how do I fix this last outstanding issue of some e-book files not being uploaded. In one of your earlier emails, you had suggested this:

              “Check the sizes on all objects saying this. I’ll bet they are above a PHP
              upload threshold. I have these php.ini customisations:

              upload_max_filesize = 50M
              post_max_size = 50M
              expose_php = Off
              memory_limit = 256M”

              Please can you guide me to the location where I need to make these changes.

              Kind regards,

              Rishi Saran.

              Reply

              1. Tyler Wagner’s avatar

                Hi Rishi,

                The changes to php.ini need to be made with your hosting provider. They are normally handled in your hosting control panel. I suggesting contacting customer support if you cannot find the options yourself.

                Reply

              2. Rishi Saran’s avatar

                Hi Tyler,

                I hope that you are well.

                Just an update. I am now hosting my own server. Went ahead and bought myself a new machine specifically for this purpose. There were far too many limitations with the web hosting options out there. So I thought, cut the crap and do it myself. I have got a Win 8 Machine running IIS. My question today is limited to COPS.

                Scenario 1:

                When I copy and paste all my books from the above location to C:/inetpub/wwwroot/phpbooks, COPS is able to locate the metadata file when I use this command:

                “$config[‘calibre_directory’] = array (“Fiction” => “/inetpub/wwwroot/phpbooks/F7N5/”, “Non-fiction” => “/inetpub/wwwroot/phpbooks/NF7N5/”);”

                in config_local.php file of the php app that I am using.

                It is working fine, but the problem is that both the server and Google drive folder are sitting on the same hard drive. Which means that I am duplicating the data. I want to maintain a static back up of my books on a static cloud server like Google Drive or Dropbox as well.

                This is what I am hoping to achieve:

                Scenario 2:**

                Create a virtual drive of the main google drive folder within IIS wwwroot folder. Change this command in config_local.php:

                “$config[‘calibre_directory’] = array (“Fiction” => “/inetpub/wwwroot/phpbooks/F7N5/”, “Non-fiction” => “/inetpub/wwwroot/phpbooks/NF7N5/”);”

                to a command which can correctly help this php program find its way to the google drive through the OS. Google Drive is on a C Drive and inetpub IIS server’s root folder.

                However, since I am not a php champion I don’t know what syntax or command or script or code to use that will help point this program to the exact location on C Drive where the books are originally without the need to duplicate data on a server folder.

                I hope I have been able to explain my issue clearly and comprehensively to you. I hope that there is a way to achieve this. Your help will be highly appreciated.

                Kind regards,

                Rishi Saran.

                Reply

              3. Rishi Saran’s avatar

                Hi Tyler,

                Sorry to trouble you. I have fixed it. Using the syntax that you taught me, I just went backwards till the physical folder location and it worked. Hope you have a nice weekend.

                Kind regards,

                Rishi Saran.

                Reply

                1. Tyler Wagner’s avatar

                  I’m glad I could help. Good working getting it working.

                  Reply

                2. Rishi Saran’s avatar

                  Hi Tyler,

                  Just noticed something funny with Owncloud.

                  In it’s config.php file, when say for example:

                  “‘trusted_domains’ => array(‘example.com’, ‘bar.example.com’),”

                  I am unable to access my owncloud say if I type “http://example.com/owncloud/” in the browser.

                  But if I change the domain to say for example IP 00.0.000.000:

                  “‘trusted_domains’ => array (
                  0 => ‘00.0.000.000’
                  ),”

                  and then if I type “http://00.0.000.000/owncloud/” in the browser then I am greeted by Owncloud’s log in screen.

                  Would you know why is this happening? I would like to hide the IP address or for it not to be shown. I would rather like the domain name to be shown instead.

                  Please advise.

                  Kind regards,

                  Rishi Saran.

                  Reply

                3. Rishi Saran’s avatar

                  All sorted now. Thanks. I’ve got my music and books library all on my site which runs through a dedicated iis server. Good learning experience for me. The best part is that I control it. Thank you for pointing me in the right direction.

                  Another question, I am looking for a epub reader that can sync my last read stage across my laptop and android note 3. I currently use Mantano but they don’t have a desktop app. Would you know if FB reader has Kindle like similar functionality for syncing ebooks or last read book or page across various OS?

                  Reply

                  1. Tyler Wagner’s avatar

                    No, sorry. I don’t have a way to sync read state either.

                    Reply

                  2. Jamie Holcroft’s avatar

                    Over COPS I would recommend BicBucStriim, it can be found on github, I have used it myself recently and found it to be excellent.

                    Reply

                    1. Tyler Wagner’s avatar

                      What makes BicBucStriim better than COPS?

                      Reply

                      1. Jamie Holcroft’s avatar

                        I feel the UI is much cleaner for browsers aswell as mobile, it has support for emailing direct to a kindle email address and my main reason was the addition of users to protect a your ebook library.

                        Reply

                        1. Tyler Wagner’s avatar

                          Internal user support is nice – I did it with Apache HTTPAuth. I appreciate the Kindle feature, but I don’t use Kindles for the reason that is necessary – they are designed to shackle you to Amazon. With a format nobody else uses (mobi), and no ability to read books from OPDS sources. I prefer just to read on my phone with FBReader, which is excellent for that.

                          All that said, I’ll give BicBucStriim a go, thanks.

                          Reply

                        2. Rishi Saran’s avatar

                          Thanks Taylor. I think only Kindle offers that kind of support to Android users for now and it’s not very helpful. Guess I’ll have to wait and see if someone comes up with a solution in future. Wish I knew computing well I would have done it myself lol.

                          Reply

                        3. Rishi Saran’s avatar

                          Tyler * Sorry for the typo earlier

                          Reply

                        4. Yetanfou’s avatar

                          What follows is a short plug for an Owncloud app I submitted a few days ago…

                          I happened upon this page when looking for a way to create an OPDS catalog for a large-ish collection of documents without going full-monty with memory-hungry Calibre et al. While I did not find this, I did notice you also thought of using Owncloud to serve books.

                          Since this is one of my motivations I made an Owncloud app to read epub books on whatever device you happen to use to access it. The main reason for doing so was to allow those using encumbered devices on which they can not install software, but can use a web browser (students using school-provided tablets).

                          You can find this app, prosaically named ‘Reader’ for lack of inspiration, in the Owncloud app store: Reader (ebook reader) 0.4.1. It is based on futurepress’ epub.js library and as such only works for books formatted according to the epub standard (and that should be taken literally as epub.js is not tolerant of formatting errors…).

                          Used full-screen on a tablet or phone it provides a near-native interface, including the (in my not so humble opinion) important night mode and personal font/size options. It does currently not work on Internet Explorer and its siblings so if you’re using one of those you’re SOL – use something based on the Gecko (Firefox, Seamonkey, etc) or Webkit/Blink engine (Chromium, Chrome, anything Apple (even though Safari truly is IE6 born again with its many bugs and vendor-specific needs…)) instead…

                          Now back to the search for that elusive OPDS catalog generator…

                          Reply

                        5. Nikki’s avatar

                          Hello,

                          I just found your tutorial this weekend and I am trying to get it to work. My end goal is to be able to download books from this cloud on my kindle paperweight and iPhone remotely. Eventually I will add a password to protect the files. I’m hoping that you can help me. I tried following all the steps above and the comments below the article, but can’t seem to figure it out. I am hosting though GoDaddy. I have the domain set up as well as OwnCloud.

                          First off – I can’t seem to get COPS to work. I can’t get though the configuration check screen. I have uploaded a test library of about 8 books to make sure I get the basic coding working. Then I would like my set up to match your workflow to incorporate own cloud. But I’m not sure how to do a SymLink with a web host. I’m not sure where to place to code in the Config_Local file.

                          Cops Configuration Check – It can’t seem to find my metadata.db file.
                          You’ve been redirected because COPS is not configured properly: Database error
                          Check if PHP version is correct: OK (5.5.28)
                          Check if GD is properly installed and loaded: OK
                          Check if Sqlite is properly installed and loaded: OK
                          Check if libxml is properly installed and loaded: OK
                          Check if Json is properly installed and loaded: OK
                          Check if mbstring is properly installed and loaded: OK
                          Check if intl is properly installed and loaded: OK
                          Check if Normalizer class is properly installed and loaded: OK
                          Check if the rendering will be done on client side or server side: Client side rendering
                          Check if Calibre database path is not an URL: OK
                          Check if Calibre database file exists and is readable: File metadata.db not found, Please check

                          Current config_local.php
                          <?php
                          if (!isset($config))
                          $config = array();

                          /*
                          * The directory containing calibre's metadata.db file, with sub-directories
                          * containing all the formats.
                          * BEWARE : it has to end with a /
                          */
                          $config['calibre_directory'] = ‘Library/‘;

                          /*
                          * Catalog's title
                          */
                          $config['cops_title_default'] = "COPS";

                          /*
                          * use URL rewriting for downloading of ebook in HTML catalog
                          * See README for more information
                          * 1 : enable
                          * 0 : disable
                          */
                          $config['cops_use_url_rewriting'] = "0";

                          Test Library Path: public_html/cops/Library
                          Final Library Path (entire library already uploaded to ownCloud) public_html/owncloud/data/nikkiadkins07/files/Books

                          Reply

                          1. Tyler Wagner’s avatar

                            So you need to do one of two things:

                            1. Create a symbolic link from public_html/cops/Library to public_html/owncloud/data/nikkiadkins07/files/Books. If you have shell access, do something like this:

                            cd ~public_html/cops/
                            rm Library
                            ln -s ../owncloud/data/nikkiadkins07/files/Books Library

                            2. Skip using a symbolic link, and configure COPS directly as so:

                            $config['calibre_directory'] = ‘../owncloud/data/nikkiadkins07/files/Books‘;

                            You may need to play with this second option to give it a full filesystem path or absolute web server path; I’m not sure. Examples to try:

                            $config['calibre_directory'] = ‘../owncloud/data/nikkiadkins07/files/Books‘;
                            $config['calibre_directory'] = ‘/owncloud/data/nikkiadkins07/files/Books‘;
                            $config['calibre_directory'] = ‘/home/INSERTUSERNAMEHERE/public_html/owncloud/data/nikkiadkins07/files/Books‘;

                            To be sure of your home directory, try the “pwd” command.

                            Reply

                          2. Petrus’s avatar

                            Hi Tyler,

                            What a awesome tool!!!! I am loving everything here!!

                            I have a problem:
                            I have installed COPS and am super happy.

                            On the index page there are categories
                            Authors
                            Series
                            Publishers
                            Tags
                            Ratings
                            Languages
                            All Books
                            Recent Additions

                            I am trying to add my own Category with all books that match a certain tag. So that mine will show in the main index page.

                            Example:
                            Authors
                            Series
                            Publishers
                            Tags
                            Test
                            Ratings

                            Any idea how I must do this? I have tried the ‘custom columns’ like this but it does not work:
                            $config[‘cops_calibre_custom_column’] = array (“test”, “test”);
                            $config[‘cops_calibre_custom_column_list’] = array (“test”, “test”);

                            This is really frustrating. Can you please pretty please help??

                            Reply

                            1. Tyler Wagner’s avatar

                              Sorry, I have not tried this. I suggest contacting Sebastién, author of COPS.

                              Reply

Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.