-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
This chapter describes a quick start using a simple config (as simple as it can be for our purpose). If you need something more complex (e.g. if you want to use multiple catalogs to serve multiple languages separately), see the information further below.
-
unpack the archive. Place the content into the folder
opds
directly below theDOCUMENT_ROOT
of your web server. -
copy/rename
config.simple.php
toconfig.php
and adjust it with your editor:- first block (Directories) can remain unchanged
- second block (Book Covers) as well
- in the third block (Web Service) replace "localhost" by the name/IP of the server (otherwise the catalog will work only locally on that machine, but not from your eBook-reader)
- in the fourth block (Person Info) adjust the personal data.
-
Prepare the database:
- change into the folder
install
and- Linux: execute
install.sh
- Windows: execute all
*.sql
files using sqlite3
- Linux: execute
- copy/move the resulting
metadata.db
to the directory one level up
- change into the folder
-
Prepare folder structure for your books:
-
change into the "books" folder
-
create a responding directory for each language you want to use (e.g. "de" for German, "en" for English...). You only need to create the directories for languages you plan to use.
-
in each language folder, create corresponding directories for Genres (e.g. "Computer", "Science Fiction", ...)
-
in the genre folders, create corresponding directories for the authors (e.g. "Jules Verne", "Paul Scheerbart", ...)
-
copy the books with the naming scheme <Title>. into the authors directories. Some example:
books/de/Science Fiction/Jules Verne/A Journey to the Centre of the Earth.epub
books/de/Science Fiction/Jules Verne/A Journey to the Centre of the Earth.mobi
-
For each book (which of course may be present in multiple formats) you can place a text file with a description, which must have the
.desc
file extension, e.g.:books/de/Science Fiction/Jules Verne/A Journey to the Centre of the Earth.desc
-
-
Feed the database (WARNING - NOT THE CALIBRE DB!):
- go to the main directory (opds) again
- run
php scan.php
If everything worked out, you should now be able to use the catalog. Just enter the configured $baseurl plus "/index.php" into your web browser /eBook reader - e.g. http://my_box/opds/index.php
Using an extended configuration, you can serve language specific catalogs. The configuration basically works as above – with some minor changes:
-
Instead of
config.simple.php
we useconfig.advanced.php
to base ourconfig.php
on. Language-specific adjustments now are done in the "Language dependent stuff" section, and overwrite previously defined values. The example configuration holds reasonable values for German and English – having German as default in case (e.g. in the URL) no language was specified. Of course you can adjust more settings here, like e.g. the site title. -
Step 3 now of course needs to be run for each additional database. To make it easier, you can create the (empty) database file once, and simply copy it then.
-
Minimal adjustments also for step 5 - examples are given by the files
scan_de.php
andscan_en.php
.
If you now call the URL as specified above, the default catalog (here: German) will be used. It's always better to specify the language to be used - which would e.g. be http://my_box/opds/index.php?lang=en
for the English catalog.
To use your Calibre database, just specify it as $dbfile
. BUT BE CAREFUL: DO NOT MAKE A BOOK SCAN WITH IT, OR YOU WILL DESTROY IT!
Instead, you can make adaptions in the second section (Book Covers – or use the corresponding statements in the language-specific part for some "artificial language" named e.g. "cal") to have cover images included. For this, set $cover_mode
to 'calibre'. To prepare the cover images, use the script scan_calibre_covers.php
– which will create symlinks: this means you either need a Linux/Unix machine, or Windows Vista, Windows Server 2008, or newer with PHP v5.3 or newer.