Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Related Tools

Notices

Reply
 
Thread Tools Search this Thread
Old 08-14-2011, 11:40 PM   #121
Pope Viper
Member
Pope Viper began at the beginning.
 
Pope Viper's Avatar
 
Posts: 21
Karma: 10
Join Date: Jun 2011
Device: none
Quote:
Originally Posted by Pope Viper View Post
I'd appreciate some help, if someone who is running this under a IIS 7.5 would be willing to post their config_local.php, I would appreciate it, I seem to be having difficulties getting it figured out.

Thanks!
OK, I've been futzing around, and am getting a internal server error when trying to get the site to open. No issues with the other sites I'm running on this server.

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';
?>
Pope Viper is offline   Reply With Quote
Old 08-15-2011, 04:32 AM   #122
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,203
Karma: 821512
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by Pope Viper View Post
OK, I've been futzing around, and am getting a internal server error when trying to get the site to open. No issues with the other sites I'm running on this server.
...
\calibre - Main Calibre dir, with index.php, etc
\calibre\smarty - contains the templates, libs, etc.
\calibre\Library - location of my Calibre library (metadata.db)
...
Code:
<?php
	/*
	 * The directory containing calibre's metadata.db file, with sub-directories
	 * containing all the formats.
	 */
	$config['library_dir'] = '/library';
You are running on windows. These must be paths to real folders on the computer. Are they? If so, then I would put the drive letter in the paths. From here on I will use XXX: as the drive letter.
Quote:
Code:
	/*
	 * The directory containing the PHP code.
	 */
	$config['web_dir'] = '/calibre';
This tells me that the real folder XXX:/calibre can be served by IIS. Is that true?
Quote:
Code:
	/*
	 * The directory in web space where smarty will find the templates.
	 */
	$config['smarty_web_dir'] = $config['web_dir'] . '/smarty/templates';
This is fine as long as XXX:/calibre is served by IIS.
Quote:
Code:
	/*
	 * The directory where smarty is to store its caches and the like. The web
	 * server must have write access here.
	 */
	$config['smarty_dir'] = '/smarty';
Can your web server write to XXX:/smarty?
Quote:
Code:
	/*
	 * The directory containing the Smarty PHP files, and in particular the file
	 * Smarty.class.php.
	 */
	$config['smarty'] = '/smarty/libs';
The combination of this plus 'smarty_dir' is suspicious. 'smarty' is where the smarty release lives. The cache should not be intermixed with the smarty released code.

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';
Also note that you should be putting your changes in config_local.php, so that they aren't overwritten if you install a new release.

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();
?}
chaley is offline   Reply With Quote
 
Enthusiast
Old 08-25-2011, 07:25 AM   #123
Gomez
Junior Member
Gomez began at the beginning.
 
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...
Gomez is offline   Reply With Quote
Old 08-25-2011, 05:13 PM   #124
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,040
Karma: 777825
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.
itimpi is offline   Reply With Quote
Old 08-26-2011, 04:45 AM   #125
Gomez
Junior Member
Gomez began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
How u guys protect your installations?

Need to find an other way....
Gomez is offline   Reply With Quote
Old 08-26-2011, 07:50 AM   #126
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
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';
ldolse is offline   Reply With Quote
Old 09-08-2011, 11:04 AM   #127
Gomez
Junior Member
Gomez began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
Thanks ldolse, overlooked this.

Works better
Gomez is offline   Reply With Quote
Old 10-13-2011, 01:22 PM   #128
Pope Viper
Member
Pope Viper began at the beginning.
 
Pope Viper's Avatar
 
Posts: 21
Karma: 10
Join Date: Jun 2011
Device: none
OK - I'm making some progress. Here's what I get now:


Quote:
Warning: SQLite3::query() [sqlite3.query]: Unable to prepare statement: 1, no such table: tag_browser_filtered_languages in D:\Websites\Bunker\Library-Web\db.php on line 334

Warning: SQLite3::query() [sqlite3.query]: Unable to prepare statement: 1, no such table: tag_browser_filtered_languages in D:\Websites\Bunker\Library-Web\db.php on line 334

Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file 'index.tpl'' in D:\Websites\Bunker\Library-Web\smarty\Install\libs\sysplugins\smarty_internal _templatebase.php:123 Stack trace: #0 D:\Websites\Bunker\Library-Web\smarty\Install\libs\sysplugins\smarty_internal _templatebase.php(352): Smarty_Internal_TemplateBase->fetch('index.tpl', NULL, NULL, NULL, true) #1 D:\Websites\Bunker\Library-Web\index.php(138): Smarty_Internal_TemplateBase->display('index.tpl') #2 {main} thrown in D:\Websites\Bunker\Library-Web\smarty\Install\libs\sysplugins\smarty_internal _templatebase.php on line 123
Pope Viper is offline   Reply With Quote
Old 10-13-2011, 04:59 PM   #129
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,203
Karma: 821512
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by Pope Viper View Post
OK - I'm making some progress. Here's what I get now:
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?
chaley is offline   Reply With Quote
Old 10-13-2011, 05:29 PM   #130
Pope Viper
Member
Pope Viper began at the beginning.
 
Pope Viper's Avatar
 
Posts: 21
Karma: 10
Join Date: Jun 2011
Device: none
Quote:
Originally Posted by chaley View Post
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?
I'm running 0.2.6, also against a .8.21 database

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 05:32 PM.
Pope Viper is offline   Reply With Quote
Old 10-14-2011, 04:34 AM   #131
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,203
Karma: 821512
Join Date: Jan 2010
Location: France
Device: Many android devices
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:
81 charles <> 2011-10-14 {REL 0.2.7}
Release 0.2.7

80 charles <> 2011-10-14
Update version number

79 charles <> 2011-10-14
Fix problem with the new languages table.
chaley is offline   Reply With Quote
Old 10-14-2011, 04:44 AM   #132
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,203
Karma: 821512
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by Pope Viper View Post
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
Try making the backslashes into forward slashes. Otherwise they are interpreted as escapes. You could also double them.

I would put a drive letter on web_dir.

I assume that d:\Websites\Bunker ... is not in web space. It shouldn't be.
chaley is offline   Reply With Quote
Old 10-14-2011, 09:23 AM   #133
Pope Viper
Member
Pope Viper began at the beginning.
 
Pope Viper's Avatar
 
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:
Attached Thumbnails
Click image for larger version

Name:	Untitled.png
Views:	126
Size:	78.6 KB
ID:	77801  

Last edited by Pope Viper; 10-14-2011 at 10:59 AM.
Pope Viper is offline   Reply With Quote
Old 10-14-2011, 11:15 AM   #134
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,203
Karma: 821512
Join Date: Jan 2010
Location: France
Device: Many android devices
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?
chaley is offline   Reply With Quote
Old 10-14-2011, 11:32 AM   #135
Pope Viper
Member
Pope Viper began at the beginning.
 
Pope Viper's Avatar
 
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.
Pope Viper is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre Command Line usage with PHP artoros Related Tools 13 07-01-2010 09:57 AM
Web Content Server mezme Calibre 7 01-08-2010 09:59 PM
Calibre web server on MAC I cant get to work.. any help appreciated. stustaff Calibre 5 01-06-2010 06:05 PM
Calibre - web server problems eclpmb Calibre 9 11-28-2008 02:04 PM


All times are GMT -4. The time now is 09:34 PM.


MobileRead.com is a privately owned, operated and funded community.