10-27-2010, 01:44 PM | #16 |
Grand Sorcerer
Posts: 11,911
Karma: 7076137
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. |
10-27-2010, 01:59 PM | #17 |
creator of calibre
Posts: 44,277
Karma: 23661992
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? |
Advert | |
|
10-27-2010, 02:12 PM | #18 | ||
Grand Sorcerer
Posts: 11,911
Karma: 7076137
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
And yes, another application has taken /browse and (I think) /static. Quote:
(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.) |
||
10-27-2010, 02:15 PM | #19 |
creator of calibre
Posts: 44,277
Karma: 23661992
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 |
10-27-2010, 02:16 PM | #20 |
Grand Sorcerer
Posts: 11,911
Karma: 7076137
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.
|
Advert | |
|
10-27-2010, 02:21 PM | #21 |
creator of calibre
Posts: 44,277
Karma: 23661992
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. |
10-28-2010, 01:24 AM | #22 |
creator of calibre
Posts: 44,277
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I got bored of bug fixing so I implemented --url-prefix in the content server
|
10-28-2010, 01:52 AM | #23 | |
Grand Sorcerer
Posts: 9,707
Karma: 32763414
Join Date: Dec 2008
Location: Krewerd
Device: Pocketbook Inkpad 4 Color; Samsung Galaxy Tab S6
|
Quote:
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... |
|
10-28-2010, 09:03 AM | #24 |
Grand Sorcerer
Posts: 11,911
Karma: 7076137
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. |
10-28-2010, 09:06 AM | #25 | |
Grand Sorcerer
Posts: 9,707
Karma: 32763414
Join Date: Dec 2008
Location: Krewerd
Device: Pocketbook Inkpad 4 Color; Samsung Galaxy Tab S6
|
Quote:
|
|
10-28-2010, 09:14 AM | #26 | |
Grand Sorcerer
Posts: 11,911
Karma: 7076137
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
PHP works well under IIS. See http://php.net/manual/en/install.windows.php |
|
10-28-2010, 10:24 AM | #27 | |
Grand Sorcerer
Posts: 9,707
Karma: 32763414
Join Date: Dec 2008
Location: Krewerd
Device: Pocketbook Inkpad 4 Color; Samsung Galaxy Tab S6
|
Quote:
|
|
10-28-2010, 11:32 AM | #28 |
Wizard
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.
|
10-28-2010, 12:40 PM | #29 | |
creator of calibre
Posts: 44,277
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
|
|
10-28-2010, 05:30 PM | #30 |
creator of calibre
Posts: 44,277
Karma: 23661992
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. |
|
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 |