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 12-01-2011, 01:38 PM   #166
ogarcia
Junior Member
ogarcia began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2011
Device: Android
Quote:
Originally Posted by chaley View Post
If I were you, I would start with downgrading smarty to V2 and see if the errors go away. I would also switch to loaded modules, unless there is some overriding reason you want to use fastcgi.
Yes. The error is smarty v3. With v2 no errors. The fastcgi works fine. I use it because my server is nginx no apache.

Thanks!
ogarcia is offline   Reply With Quote
Old 12-02-2011, 05:07 AM   #167
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,898
Karma: 1216548
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by ogarcia View Post
Yes. The error is smarty v3. With v2 no errors. The fastcgi works fine. I use it because my server is nginx no apache.
Glad to hear it works with fastcgi.

I suppose that for completeness, some day I need to look at making things work with smarty 3.
chaley is offline   Reply With Quote
Old 12-02-2011, 10:10 AM   #168
nobo
Junior Member
nobo began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2011
Device: kindle 2011
Quote:
Originally Posted by ilovejedd View Post
I did a quick perusal of the scripts earlier. Really, pretty much the only thing that needs to be changed are the smarty templates. Perhaps the index.php file, too, although from my initial review, it doesn't appear as if that's needed.
Thanks for the feedback, I will have a look over the smarty template system this weekend and test if I can find a valid solution
nobo is offline   Reply With Quote
Old 12-02-2011, 10:35 AM   #169
nobo
Junior Member
nobo began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2011
Device: kindle 2011
Quote:
Originally Posted by chaley View Post
Sure, I will look at patches.

I and others don't have problems downloading books, so I don't know what you mean when you say 'did not properly look at extensions'. I suppose that the patch will tell me.
Hi,

I just had another more deep look at the script .. there was no need for a fix. The Problem rather occured when using lighttpd 1.5 + php-fastcgi . The server did not properly rewrite the request, so that php would be able to server the PATH_INFO var. Fixed it by changing the config
nobo is offline   Reply With Quote
Old 12-10-2011, 08:19 AM   #170
ogarcia
Junior Member
ogarcia began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2011
Device: Android
404 error when download

Hello,

I have the software installed and work fine. But when I click on a link to download, the server give me a 404 error.

The links have this format:
http://my.server.com/index.php/book_...ge_Orwell.epub

¿Some of url rewrite? I don't see any .htaccess file

Greetings
ogarcia is offline   Reply With Quote
Old 12-10-2011, 08:41 AM   #171
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,898
Karma: 1216548
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by ogarcia View Post
Hello,

I have the software installed and work fine. But when I click on a link to download, the server give me a 404 error.

The links have this format:
http://my.server.com/index.php/book_...ge_Orwell.epub

¿Some of url rewrite? I don't see any .htaccess file
What error is in your web server error log?

There should be a folder named "George Orwell" (or something like that) in the folder pointed at by config['library_dir']. Is there? That folder should contain the folder "1984 (19)" (or something like that). Does it? Does that folder contain the file "1984 - George Orwell.epub". Does it? Does your web server have read permission on all these folders and files?
chaley is offline   Reply With Quote
Old 12-10-2011, 03:08 PM   #172
ogarcia
Junior Member
ogarcia began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2011
Device: Android
Quote:
Originally Posted by chaley View Post
What error is in your web server error log?

There should be a folder named "George Orwell" (or something like that) in the folder pointed at by config['library_dir']. Is there? That folder should contain the folder "1984 (19)" (or something like that). Does it? Does that folder contain the file "1984 - George Orwell.epub". Does it? Does your web server have read permission on all these folders and files?
The only error is the 404 not found:
2011/12/10 20:11:32 [error] 27913#0: *986 open() "/var/www/books/htdocs/index.php/book_format/3/Linux_Pocket_Guide___Daniel_J__Barrett.pdf" failed (20: Not a directory), client: 192.168.10.6, server: my.server.com, request: "GET /index.php/book_format/3/Linux_Pocket_Guide___Daniel_J__Barrett.pdf HTTP/1.1", host: "my.server.com", referrer: "http://my.server.com/index.php?m=catval&id=PDF&p=1&cat=formats&v=PDF"

And yes, the library_dir contains this folder and the file.

I think that is the translation. The server looks for /index.php/book_format/19/1984___George_Orwell.epub and think that index.php is a folder.

I think that this must be rewrited to something also /index.php?book=book_format/19/1984___George_Orwell.epub to work. But I don't know the rewrite rule.

Can you help me?.

Tanks.

Last edited by ogarcia; 12-10-2011 at 03:13 PM. Reason: Added 404 error description
ogarcia is offline   Reply With Quote
Old 12-10-2011, 03:37 PM   #173
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,898
Karma: 1216548
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by ogarcia View Post
The only error is the 404 not found:
2011/12/10 20:11:32 [error] 27913#0: *986 open() "/var/www/books/htdocs/index.php/book_format/3/Linux_Pocket_Guide___Daniel_J__Barrett.pdf" failed (20: Not a directory), client: 192.168.10.6, server: my.server.com, request: "GET /index.php/book_format/3/Linux_Pocket_Guide___Daniel_J__Barrett.pdf HTTP/1.1", host: "my.server.com", referrer: "http://my.server.com/index.php?m=catval&id=PDF&p=1&cat=formats&v=PDF"

And yes, the library_dir contains this folder and the file.

I think that is the translation. The server looks for /index.php/book_format/19/1984___George_Orwell.epub and think that index.php is a folder.

I think that this must be rewrited to something also /index.php?book=book_format/19/1984___George_Orwell.epub to work. But I don't know the rewrite rule.

Can you help me?.

Tanks.
It is not a translation problem. The url must not be rewritten in the form you provide, because doing so will break everything. The server expects that index.php will be executed (as it is with apache servers) and that the rest will be passed as extra components.

Your configuration is clearly different from mine and several others that I know of. Your web server appears to be broken. What versions of what web server and php are you using? Is php a module, or are you using CGI?
chaley is offline   Reply With Quote
Old 12-10-2011, 05:50 PM   #174
ogarcia
Junior Member
ogarcia began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2011
Device: Android
Quote:
Originally Posted by chaley View Post
[..] Is php a module, or are you using CGI?
SOLVED!

I'm using php-fastcgi with nginx frontend. The problem is that the part of url book_format/19/1984___George_Orwell.epub must be passed as PATH_INFO to the CGI.

I give you my config for other users.

Code:
server {

  listen   80; ## listen for ipv4
  listen   [::]:80; ## listen for ipv6

  server_name  books.myserver.com;

  access_log  /var/log/nginx/books.access.log;
  error_log   /var/log/nginx/books.error.log;

  root   /var/www/books/htdocs;

  location / {
    index  index.php index.html index.htm;
  }

  location ~ ^.+\.php {
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    fastcgi_param  PATH_INFO        $fastcgi_path_info;
    include /etc/nginx/fastcgi_params;
  }

  location ~ /\.ht {
    deny  all;
  }
}
The important is fastcgi_split_path_info ^(.+\.php)(/.*)$; that cuts the index.php to the path (by example: book_format/19/1984___George_Orwell.epub), and fastcgi_param PATH_INFO $fastcgi_path_info; that pass this part as PATH_INFO to fastcgi.

This confirms that it work fine with nginx and php-fastcgi.

Thanks!!!!
ogarcia is offline   Reply With Quote
Old 12-29-2011, 06:23 PM   #175
edent
Enthusiast
edent began at the beginning.
 
edent's Avatar
 
Posts: 29
Karma: 20
Join Date: Dec 2009
Location: UK
Device: Kindle 3G, Nook STR, 511eb
Can you explain how the restrict_display_to section works?

What I want to do is make the user "fred" only be able to see works tagged as fiction.

I'm using the line
$config['restrict_display_to'] = array('fred'=>'tags:"=fiction"');

But it just returns no titles whatsoever. Am I being a bit thick?

Ideally, what I want to do is exclude all books tagged "ignore". Is that possible?
edent is offline   Reply With Quote
Old 12-30-2011, 04:14 AM   #176
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,898
Karma: 1216548
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by edent View Post
Can you explain how the restrict_display_to section works?

What I want to do is make the user "fred" only be able to see works tagged as fiction.

I'm using the line
$config['restrict_display_to'] = array('fred'=>'tags:"=fiction"');

But it just returns no titles whatsoever. Am I being a bit thick?

Ideally, what I want to do is exclude all books tagged "ignore". Is that possible?
Your search syntax is incorrect. The server expects that quotes surround words, not operators ('=' is an operator). This is different from calibre, which expects the text after the colon to be quoted. In addition, there is no need to use quotes if the search text contains no white space.

In your case, use
Code:
$config['restrict_display_to'] = array('fred'=>'tags:=ignore');
or
Code:
$config['restrict_display_to'] = array('fred'=>'tags:="ignore"');
chaley is offline   Reply With Quote
Old 01-05-2012, 11:03 AM   #177
hekom
Member
hekom began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jan 2012
Device: samsung galaxy 10.1
Quote:
Originally Posted by chaley View Post
Sorry, but I know nothing about IIS, so I can't give much help. That said, there are some things to look at.
  • You say the "latest smarty". The server runs with smarty 2.6. I have no idea if it runs with smarty 3.
  • The server has been tested with PHP 5.2 and PHP 5.3. You should verify that you have one of those.
  • Be sure to run PHP as a module and not in CGI mode (assuming IIS can make that distinction).
  • Given that you are using IIS, you might want to change all the '/' characters to '\\'.
  • the values for config web_dir, smarty_dir, and smarty must be real file paths, probably including a drive letter as you are running on IIS. They are specifically *not* URL paths.
  • I don't know what "binded the directory to port 8060" means, so I can't say if doing so overrides any of the above comments.
Hello All

Environment:
- Windows2008 R2; IIS 7.5; PHP 5.3.8; Smarty 2.6.26; pdo_sqlite 3.7.7.1

Config_local:
$config['web_dir'] = 'c:/inetpub/wwwroot/calibre';
$config['smarty_web_dir'] = $config['web_dir'] . '/smarty';
$config['smarty_dir'] = 'c:/tmp';
$config['smarty'] = 'c:/inetpub/wwwroot/calibre/smarty/libs';

IIS user has RW rights on c:\tmp

UPDATE: former Http error 500 is gone... how hard can it be... forgottten to enable the php extension sqlite3.dll in php.ini... ;-)

Now, something else is wrong.. my website displays the template in stead of opening it.
So it displays:
{config_load file=test.conf section="setup"} {include file="header.tpl" title=foo}

{* bold and title are read from the config file *}
{if #bold#}{/if}
{* capitalize the first letters of each word of the title *}
Title: {#title#|capitalize}
{if #bold#}{/if}

The current date and time is {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}

etc. etc.


Do I have to change index.tpl ???


thanks
Henny

Last edited by hekom; 01-07-2012 at 09:43 AM.
hekom is offline   Reply With Quote
Old 01-08-2012, 06:02 AM   #178
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,898
Karma: 1216548
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by hekom View Post
Now, something else is wrong.. my website displays the template in stead of opening it.
So it displays:
[I] {config_load file=test.conf section="setup"} {include file="header.tpl" title=foo}
It looks like smarty is returning the templates instead of processing them. I have no idea why that might be, but the place to start is to ensure that smarty is correctly installed, that the server is able to use it, that the server can find the smarty code, and that the smarty cache directory is writable.
chaley is offline   Reply With Quote
Old 01-14-2012, 09:45 AM   #179
hekom
Member
hekom began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jan 2012
Device: samsung galaxy 10.1
Quote:
Originally Posted by chaley View Post
It looks like smarty is returning the templates instead of processing them. I have no idea why that might be, but the place to start is to ensure that smarty is correctly installed, that the server is able to use it, that the server can find the smarty code, and that the smarty cache directory is writable.
Hi Chaley,

I have replaced Smarty 2.6.26 into version 3.1.7 and it works !

So now, your content server is running perfecly on
Windows2008 R2; IIS 7.5; PHP 5.3.8; Smarty 3.1.7; pdo_sqlite 3.7.7.1

Thanks for all your work, I'm a happy user now!

Henny.
hekom is offline   Reply With Quote
Old 01-23-2012, 09:34 AM   #180
Kharlanki
Junior Member
Kharlanki began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jan 2012
Device: iPad1
Quote:
Originally Posted by ogarcia View Post
Hello,

I have the software installed and work fine. But when I click on a link to download, the server give me a 404 error.

The links have this format:
http://my.server.com/index.php/book_...ge_Orwell.epub
I have the same problem.
library_dir contains the author folder and within a folder with the epub file.

My vServer runs under PHP 5.3 and cgiwrap.
Kharlanki 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 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


All times are GMT -4. The time now is 12:30 AM.


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