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 10-27-2010, 01:44 PM   #16
chaley
Grand Sorcerer
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: 11,703
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Well, with great assistance from Kovid, I have this working (I think).

Rough outline of steps (on a debian system):

1) create a chrooted installation. Use debootstrap to build the one you want. I used squeeze.

For the next few steps, we are in the chrooted copy.

2) get the calibre binary. Untar it to /opt/calibre
3) run ./calibre-server. It should complain about missing libglib2.0-0. Install it.
4) run ./calibre-debug -c "import PyQt4.QtGui". It will complain about missing libraries, one by one. On my system,they were libx11-6, libxext6, libfreetype6, libSM6, libXrender1, libXrandr2, libfontconfig. Keep going until it doesn't complain any more.
5) Run calibre-server. It will now complain about missing libraries. I had to give it libXt6, libltdl7, libgomp1, libdbus-1-3.
6) Ensure you have set up a timezone in the chrooted copy. Use dpkg-reconfigure tzdata. If you don't do this, you will get very strange exceptions complaining about timevalues being too large.

In a non-chrooted copy ...

7) If necessary, set up a mount point so the chrooted system can see the library. Use mount bind. This is almost certainly necessary if you use dropbox. Change fstab if you wish to do the mount at boot time.
8) I also did mounts for /proc and for /sysfs because the chroot howto suggested it. I think that the /proc entry is necessary for networking, but I am not sure of sysfs.
9) Set up /etc/init.d/calibre-server. There is a prototype on mobileread. Change the paths as appropriate, and add the --chroot argument.
10) Set up the reverse proxy if you want it. I use it to get both SSL and better control over authentication.
chaley is offline   Reply With Quote
Old 10-27-2010, 01:59 PM   #17
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Incidentally, you can use mod_rewrite for reverse proxying provided your normal server URL namespace doesn't conflict with the calibre-server base paths, namely: /browse, /static, /opds, /stanza, /mobile

Would you be interested in implementing a --prefix feature for calibre-server to take care of URL namespace conflicts?
kovidgoyal is offline   Reply With Quote
Old 10-27-2010, 02:12 PM   #18
chaley
Grand Sorcerer
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: 11,703
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kovidgoyal View Post
Incidentally, you can use mod_rewrite for reverse proxying provided your normal server URL namespace doesn't conflict with the calibre-server base paths, namely: /browse, /static, /opds, /stanza, /mobile
I tried mod_rewrite in both its native form and the proxypassreverse form. Neither take care of internal URLS, which of course is the problem you are referring to with the base paths.

And yes, another application has taken /browse and (I think) /static.
Quote:
Would you be interested in implementing a --prefix feature for calibre-server to take care of URL namespace conflicts?
At this point I never want to see the (&% thing again. Tomorrow I will feel better.

(I have 50% spent more time getting this working than I spent in implementing the PHP version. But then, the PHP version isn't finished.)
chaley is offline   Reply With Quote
Old 10-27-2010, 02:15 PM   #19
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Just to keep the options coming

you can apparently run cherrypy servers from within mod_python see

http://www.cherrypy.org/wiki/ModPython
kovidgoyal is offline   Reply With Quote
Old 10-27-2010, 02:16 PM   #20
chaley
Grand Sorcerer
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: 11,703
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
That was the first thing I looked at, even before starting the PHP stuff. Installing mod-python w/python 2.6 on lenny would be a nightmare.
chaley is offline   Reply With Quote
Old 10-27-2010, 02:21 PM   #21
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Ah, well there's also wsgi

http://tools.cherrypy.org/wiki/ModWSGI

Though I doubt installing that would be any easier.
kovidgoyal is offline   Reply With Quote
Old 10-28-2010, 01:24 AM   #22
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I got bored of bug fixing so I implemented --url-prefix in the content server
kovidgoyal is offline   Reply With Quote
Old 10-28-2010, 01:52 AM   #23
Sweetpea
Grand Sorcerer
Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.
 
Sweetpea's Avatar
 
Posts: 9,707
Karma: 32763414
Join Date: Dec 2008
Location: Krewerd
Device: Pocketbook Inkpad 4 Color; Samsung Galaxy Tab S6
Quote:
Originally Posted by chaley View Post
So, to restate the question: are there people interested in having something like this? If so, are you willing to live with the requirements, or hack it themselves to make it work?
Something like this...

If you run your server without Calibre content server running and directly accessing the DB, I'd love to see your code so I can adapt it to my Windows IIS environment, running .NET 3.5... Right now, the application I'm building requires Calibre content server to run and I've had to create some work-arounds to make that happen on my web server...
Sweetpea is offline   Reply With Quote
Old 10-28-2010, 09:03 AM   #24
chaley
Grand Sorcerer
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: 11,703
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
My son has asked me to continue development of the PHP stuff. He uses a nook to browse (no reasonable javascript) and strongly prefers the OPDS-like layout to /mobile. So, now I will have both.

@sweetpea: The PHP stuff is totally independent of calibre's content server. It uses the db and the files in the library. I will let you know when I have something that works well enough to share. There is no apache-specific stuff in it, so using it under IIS should be quite doable once you get PHP5.3 able to run.
chaley is offline   Reply With Quote
Old 10-28-2010, 09:06 AM   #25
Sweetpea
Grand Sorcerer
Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.
 
Sweetpea's Avatar
 
Posts: 9,707
Karma: 32763414
Join Date: Dec 2008
Location: Krewerd
Device: Pocketbook Inkpad 4 Color; Samsung Galaxy Tab S6
Quote:
Originally Posted by chaley View Post
@sweetpea: The PHP stuff is totally independent of calibre's content server. It uses the db and the files in the library. I will let you know when I have something that works well enough to share. There is no apache-specific stuff in it, so using it under IIS should be quite doable once you get PHP5.3 able to run.
Don't want PHP. Not even sure how I could get it to work as I've never used it. I simply want to translate it to C# (I know I can read it).
Sweetpea is offline   Reply With Quote
Old 10-28-2010, 09:14 AM   #26
chaley
Grand Sorcerer
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: 11,703
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Sweetpea View Post
Don't want PHP. Not even sure how I could get it to work as I've never used it. I simply want to translate it to C# (I know I can read it).
Well, that will probably be a total rewrite. Not only will you need to deal with all the semantic differences between the languages, but you will need either to implement something equivalent to the smarty template processor or to hand-code all of that as well. You probably would be better off starting from the python, because it doesn't use templates.

PHP works well under IIS. See http://php.net/manual/en/install.windows.php
chaley is offline   Reply With Quote
Old 10-28-2010, 10:24 AM   #27
Sweetpea
Grand Sorcerer
Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.
 
Sweetpea's Avatar
 
Posts: 9,707
Karma: 32763414
Join Date: Dec 2008
Location: Krewerd
Device: Pocketbook Inkpad 4 Color; Samsung Galaxy Tab S6
Quote:
Originally Posted by chaley View Post
Well, that will probably be a total rewrite. Not only will you need to deal with all the semantic differences between the languages, but you will need either to implement something equivalent to the smarty template processor or to hand-code all of that as well. You probably would be better off starting from the python, because it doesn't use templates.

PHP works well under IIS. See http://php.net/manual/en/install.windows.php
I mostly learn by example, so, if I have examples on how I can read from the database, for example, I will be able to put it in C#. I've been using too much ASP, HTML and Javascript at work, my .NET knowledge is getting rusty again... So, I want a project again. I have started using the services Calibre is offering (which are also used by the content server's client side code), but if I can directly plug into the DB, it would save me a lot of problems on my server machine...
Sweetpea is offline   Reply With Quote
Old 10-28-2010, 11:32 AM   #28
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
I for one think the php stuff would be cool. My server is hosted, and they don't let you run compiled executables. Script based stuff like php, perl, non-compiled python is all good though. I think a lot of other people with hosting solutions would be in the same boat if they don't have dedicated servers.
ldolse is offline   Reply With Quote
Old 10-28-2010, 12:40 PM   #29
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by ldolse View Post
I for one think the php stuff would be cool. My server is hosted, and they don't let you run compiled executables. Script based stuff like php, perl, non-compiled python is all good though. I think a lot of other people with hosting solutions would be in the same boat if they don't have dedicated servers.
A better solution for that problem is to write a WSGI adapter for calibre-server
kovidgoyal is offline   Reply With Quote
Old 10-28-2010, 05:30 PM   #30
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I've implemented support for running the calibre server within Apache as a WSGI application. Tutorial here:

http://calibre-ebook.com/user_manual/server.html

Note this will only apply after the next release.
kovidgoyal 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 03:59 AM.


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