|
|
#121 | |
|
Member
![]() Posts: 21
Karma: 10
Join Date: Jun 2011
Device: none
|
Quote:
I'm sure it's config related. My structure is as follows: \calibre - Main Calibre dir, with index.php, etc \calibre\smarty - contains the templates, libs, etc. \calibre\Library - location of my Calibre library (metadata.db) Here is my config, would someone be willing to review and tell me where I fell off the road? Code:
<?php
/*
Name: Calibre PHP webserver
license: GPL v3
copyright: 2010, Charles Haley
http://charles.haleys.org
*/
$config = array();
/*
* The title that appears at the top of every page in the default template
*/
$config['page_title'] = 'CHANGE PAGE_TITLE IN CONFIG';
/*
* The directory containing calibre's metadata.db file, with sub-directories
* containing all the formats.
*/
$config['library_dir'] = '/library';
/*
* The directory containing the PHP code.
*/
$config['web_dir'] = '/calibre';
/*
* The directory in web space where smarty will find the templates.
*/
$config['smarty_web_dir'] = $config['web_dir'] . '/smarty/templates';
/*
* The directory where smarty is to store its caches and the like. The web
* server must have write access here.
*/
$config['smarty_dir'] = '/smarty';
/*
* The directory containing the Smarty PHP files, and in particular the file
* Smarty.class.php.
*/
$config['smarty'] = '/smarty/libs';
/*
* The maximum width of a cover. A cover's aspect ratio is preserved, so
* one of width or height will win.
*/
$config['cover_max_width'] = 100;
$config['cover_max_height'] = 100;
/*
* The maximum number of books appearing on a page.
*/
$config['books_page_count'] = 20;
/*
* The format of the publication date. Use the same format strings as
* calibre's GUI.
*/
$config['pubdate_format'] = 'dd-MMM-yyyy';
/*
* The format of the timestamp, which is called 'date' in calibre.
*/
$config['timestamp_format'] = 'dd-MMM-yyyy';
/*
* The list of fields, custom or otherwise, to display in the information
* column of a book and in the categories pages. An entry of '*' means
* all fields. A value of '' means no fields. A value of
* array('foo', 'bar', 'pubdate')
* means the three fields named. The items in this list must be lowercase.
*/
$config['fields_to_display'] = '*';
/*
* The list of fields, custom or otherwise, not to display in the information
* column of a book and in the categories pages. Entries as in
* 'fields_to_display'. The 'not_to_display' filter is applied first.
*/
$config['fields_not_to_display'] = '';
/*
* Use the short form books display. If true, then the fields displayed
* on the books display will be limited to XXX, the length of the comment
* will be limited to the value of YYY, and a URL will be added to get
* the full details
*/
$config['use_short_form'] = false;
$config['fields_in_short_form'] = array('title', 'authors', 'series', 'tags');
$config['short_form_comments_length'] = 500;
/*
* Automatically make the following fields into URLS. Has the same syntax
* as fields_to_display. To make no fields into URLS, use
* $config['fields_to_make_urls'] = array();
*/
$config['fields_to_make_urls'] = '*';
/*
* A search that books must match to be displayed. This is a restriction
* in calibre terms. If the restriction is a string, then it is applied to
* all accesses. If it is an array, then the keys are usernames, and the
* appropriate restriction is applied based on the user. In this case, the
* user key '*' is the default. Example:
* $config['restrict_display_to'] = array('bill'=>'series:1632', '*'=>'');
* which says that bill can see only the books in the 1632 series, while
* everyone else has no restrictions.
*/
$config['restrict_display_to'] = '';
/*
* Use built-in authentication. The format of the password file is the one
* generated by apache's htpasswd: username:password. Be sure that you
* use an encryption that your installation of PHP supports. Don't put your
* password file into web_dir
*/
$config['use_internal_login'] = false;
$config['password_file'] = 'some path goes here';
/*
* Default initial sort. Set the field to the field name (see these in
* the sort dialog box) and the direction to 'ascending' or 'descending'.
* Be sure to use the exact spelling for the field as found in the sort box,
* including case.
*/
$config['initial_sort_field'] = 'Title';
$config['initial_sort_direction'] = 'ascending';
?>
|
|
|
|
|
|
|
#122 | |||||
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
Quote:
Quote:
Quote:
FWIW: here are my variables, somewhat elided. The ... represents the same text in each path. Apache has write access to all the folders except 'smarty'. Code:
$config['library_dir'] = 'C:/.../Library.test_small'; $config['web_dir'] = 'C:/.../php_server'; $config['smarty_dir'] = 'C:/.../smarty'; $config['smarty'] = 'C:/PHP/Smarty-2.6.26/libs'; $config['smarty_web_dir'] = $config['web_dir'] . '/smarty'; It might help if you say what error you are getting. Can you run php code? For example, does the following run if put into foo.php in some web-accessible folder? Code:
{?php
phpinfo();
?}
|
|||||
|
|
|
|
|
#123 |
|
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
|
I have a problem with my .htaccess / .htpasswd protected installation. Since shortly i cant access my libarary from the kindle. With Firefox or any other brower there is no problem, works perfect.
I already increased the Apache timeouts.. Does someone have a idea or a similar setup? Is the htaccess protection a problem? How can i solve this? Thx in advance... |
|
|
|
|
|
#124 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
I know my brother has problems accessing a password protected library using the Kindle 3 browser.
|
|
|
|
|
|
#125 |
|
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
|
How u guys protect your installations?
Need to find an other way.... |
|
|
|
|
|
#126 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,337
Karma: 123457
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
There are two methods for password protecting the php server - the original used .htacess with simple 401 authentication, but this breaks Kindles and Android devices. Charles later added the ability to authenticate to the server using forms based auth instead - the .htpasswd file can still be used to store the usernames. I know this fixes Android for sure, but I don't have firsthand experience with the Kindle.
Note these options from the config file: Code:
/* * Use built-in authentication. The format of the password file is the one * generated by apache's htpasswd: username:password. Be sure that you * use an encryption that your installation of PHP supports. Don't put your * password file into web_dir */ $config['use_internal_login'] = false; $config['password_file'] = 'some path goes here'; |
|
|
|
|
|
#127 |
|
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
|
Thanks ldolse, overlooked this.
Works better
|
|
|
|
|
|
#128 | |
|
Member
![]() Posts: 21
Karma: 10
Join Date: Jun 2011
Device: none
|
OK - I'm making some progress. Here's what I get now:
Quote:
|
|
|
|
|
|
|
#129 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I am totally confused by what you are seeing. There is no reference to the language table in the PHP server. Have you customized the templates? Have you added a reference to languages somewhere? Are you running against a database created by an old version?
I am running with the server 0.2.6 against a database created by calibre 0.8.21. I don't have your problem. What are you doing? |
|
|
|
|
|
#130 | |
|
Member
![]() Posts: 21
Karma: 10
Join Date: Jun 2011
Device: none
|
Quote:
I've made no changes to templates, or references to other languages. Here's what I've got: Library_dir: D:\Websites\Bunker\Calibre\Library Web_dir:\library-web Smarty_web_dir: \library-web\smarty Smarty_dir: D:\Websites\Bunker\Library-Web\smarty\ config smarty : D:\Websites\Bunker\Library-web\smarty\install\libs I'm sure i'm missing something basic. Last edited by Pope Viper; 10-13-2011 at 06:32 PM. |
|
|
|
|
|
|
#131 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Release 0.2.7 available
Release 0.2.7 is available at http://charles.the-haleys.org/calibre/
This release adds support for the new languages table. Change log: Spoiler:
|
|
|
|
|
|
#132 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
I would put a drive letter on web_dir. I assume that d:\Websites\Bunker ... is not in web space. It shouldn't be. |
|
|
|
|
|
|
#133 |
|
Member
![]() Posts: 21
Karma: 10
Join Date: Jun 2011
Device: none
|
Thanks, Charles, I've made good progress, I can now call the page up, and access the books. Only problem I have now is that I'm getting the following:
Last edited by Pope Viper; 10-14-2011 at 11:59 AM. |
|
|
|
|
|
#134 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
My guess is that your web server doesn't have write permission in the smarty cache directory.
Other than that, I don't know. I have never seen those errors. Perhaps someone else has? |
|
|
|
|
|
#135 |
|
Member
![]() Posts: 21
Karma: 10
Join Date: Jun 2011
Device: none
|
OK, I went ahead and changed the directory to D:/Websites/Bunker/Library-Web/smarty/temp, loaded up the page, and confirmed that I am getting write access.
I've got three files in there that correspond to the strings displayed in the errors. |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calibre Command Line usage with PHP | artoros | Related Tools | 13 | 07-01-2010 10:57 AM |
| Web Content Server | mezme | Calibre | 7 | 01-08-2010 10:59 PM |
| Calibre web server on MAC I cant get to work.. any help appreciated. | stustaff | Calibre | 5 | 01-06-2010 07:05 PM |
| Calibre - web server problems | eclpmb | Calibre | 9 | 11-28-2008 03:04 PM |