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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 01-31-2012, 04:19 PM   #1
Fmstrat
G:RSS-Web Creator
Fmstrat began at the beginning.
 
Posts: 91
Karma: 14
Join Date: Aug 2010
Device: Kindle 3, PW, Nexus 4,10
Wrapping Calibre in SSL, Issue.

Hi,

I'm trying to use rewrite rules to wrap Calibre in SSL so that I can open it up to access when I'm on the road. However, I'm receiving some errors. Using the latest version of Calibre, and I've tried this using Apache and this guide: http://manual.calibre-ebook.com/server.html, and I've tried it using IIS, both with the same results. The page loads fine, but when I go to view newest books or browse books, I get:

Code:
Error: error

Object.createException (https://server/calibre/static/stacktrace.js:81:18)

Object.run (https://server/calibre/static/stacktrace.js:66:25)

printStackTrace (https://server/calibre/static/stacktrace.js:57:62)

render_error (https://server/calibre/static/browse/browse.js:134:18)

error()@https://server/calibre/static/browse/browse.js:246:43

Function.handleError (https://server/calibre/static/jquery.js:5304:12)

XMLHttpRequest. (https://server/calibre/static/jquery.js:5210:13)
I also get the errors when using the rewrite without SSL. My guess is the source is trying to grab a page with the XMLHttpRequest, but it's not being parsed properly because of the rewrite rule.

Any thoughts?

Thanks,
Ben
Fmstrat is offline   Reply With Quote
Old 01-31-2012, 04:29 PM   #2
Fmstrat
G:RSS-Web Creator
Fmstrat began at the beginning.
 
Posts: 91
Karma: 14
Join Date: Aug 2010
Device: Kindle 3, PW, Nexus 4,10
Of course I would spend forever on this and then figure it out right after I post. Calibre's Javascript calls use root urls, such as "/browse", and while the Rewrite rules can modify those in the HTML code, they can't modify the JS variables.

Therefore, for anyone trying this, you can't set up an "https://site.com/calibre" wrapper to "http://localhost:7070". It can only be "https://calibre.site.com/". Since Kindles require a validated cert, you would have to get a separate cert specific to that hostname.

I'm going to guess there's no chance of getting a setting added into the interface to specify a directory to run calibre in? Such as setting it to "foldername" would make calibre host in "http://localhost:7070/foldername".

Thanks!
Ben
Fmstrat is offline   Reply With Quote
 
Advertisement
Old 01-31-2012, 08:38 PM   #3
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 2,312
Karma: 5761596
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PRS-350, Nexus S, Galaxy S, Nook Color, iPhone4, iPT4, iPad 2012
Quote:
Originally Posted by Fmstrat View Post
I'm going to guess there's no chance of getting a setting added into the interface to specify a directory to run calibre in? Such as setting it to "foldername" would make calibre host in "http://localhost:7070/foldername".
Already exists. No idea how to get to it via GUI but if you launch calibre-server from command-line you can do this:

(assuming https://site.com/calibre)
Code:
calibre-server --url-prefix /calibre
You can also set other options (e.g. username, password, port number, etc) via command line.

On my Apache install, I didn't need to bother with mod_rewrite. I just added the following to my httpd.conf:
Code:
<Location "/calibre" >
    ProxyPass http://localhost:8080/calibre
    ProxyPassReverse http://localhost:8080/calibre
    SetEnv force-proxy-request-1.0 1
    SetEnv proxy-nokeepalive 1
</Location>

Last edited by ilovejedd; 01-31-2012 at 08:47 PM.
ilovejedd is offline   Reply With Quote
Old 01-31-2012, 11:29 PM   #4
Fmstrat
G:RSS-Web Creator
Fmstrat began at the beginning.
 
Posts: 91
Karma: 14
Join Date: Aug 2010
Device: Kindle 3, PW, Nexus 4,10
Quote:
Originally Posted by ilovejedd View Post
Already exists. No idea how to get to it via GUI but if you launch calibre-server from command-line you can do this:

(assuming https://site.com/calibre)
Code:
calibre-server --url-prefix /calibre
You can also set other options (e.g. username, password, port number, etc) via command line.

On my Apache install, I didn't need to bother with mod_rewrite. I just added the following to my httpd.conf:
Code:
<Location "/calibre" >
    ProxyPass http://localhost:8080/calibre
    ProxyPassReverse http://localhost:8080/calibre
    SetEnv force-proxy-request-1.0 1
    SetEnv proxy-nokeepalive 1
</Location>
Good to know! I ended up setting up a separate site on a different port, that way I could use the root domain with SSL.

Thanks,
Ben
Fmstrat 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
Justified word paragraph not wrapping in mobi wlloydw Conversion 0 03-05-2011 04:03 PM
Line un-wrapping Factor jjansen Calibre 6 08-18-2010 01:21 AM
Images and text wrapping steveboyett Calibre 3 07-20-2010 09:26 PM
Stop line wrapping at quotes at the end of a paragraph sherman ePub 6 05-13-2010 03:52 PM
How to deal with irregular hard-wrapping on a large scale? Robotech_Master Workshop 7 04-27-2009 09:06 PM


All times are GMT -4. The time now is 12:15 PM.


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