Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-12-2011, 10:58 PM   #1
bossanova808
Enthusiast
bossanova808 began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Apr 2011
Device: Many
Content server apache reverse proxy issue

Hi Folks

I am running UniServer (a nice WAMP package) as my home server and I use reverse proxies for a bunch of apps so that I can have nice, neat navigation to my server using simple URLs and everything over only one open port 80.

I am trying to add calibre this same was as http://servername/books/

I am using the following Location directive:

Code:
<Location /books/>
    order deny,allow
    deny from all
    allow from all
    ProxyPass http://localhost:19553/
    ProxyPassReverse http://localhost:19553/
</Location>
...this works for my other apps (sickbeard, sabnzbd etc)....but I can't quite get it to work for Calibre with the above. I get to the Calibre front page but the CSS is clearly not loading, I just get raw html text (Mobile/Old/etc).

I am running the server as:

"C:\Program Files\Calibre2\calibre-server.exe" --with-library "K:\Calibre Library" --port 19553 --username BookLibrary --password XXX

Any ideas?? I can reach the calibre server remotely fine using the classic http://servername:19553/ and can also reach it on the server via localhost:19553

Thanks in advance for any help! I am by no means an Apache guru but I haev 4 or 5 other apps running this way ok....
bossanova808 is offline   Reply With Quote
Old 04-12-2011, 11:05 PM   #2
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,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
http://calibre-ebook.com/user_manual/server.html
kovidgoyal is offline   Reply With Quote
Old 04-12-2011, 11:08 PM   #3
bossanova808
Enthusiast
bossanova808 began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Apr 2011
Device: Many
Hi Kovid

Many thanks - I have already read this - you mention using reverse proxy - but not really how to do it...
bossanova808 is offline   Reply With Quote
Old 04-12-2011, 11:12 PM   #4
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,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Pasting from that page:

First start the calibre content server as shown below:

calibre-server --url-prefix /calibre --port 8080


Note the use --url-prefix
kovidgoyal is offline   Reply With Quote
Old 04-12-2011, 11:13 PM   #5
bossanova808
Enthusiast
bossanova808 began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Apr 2011
Device: Many
Actually reading that again - do I need to use a full Virtual Host set up rather than just a location directive? I didn't need to do this for the others.

Many thanks for your attention and Calibre is stupendously good BTW!
bossanova808 is offline   Reply With Quote
Old 04-12-2011, 11:32 PM   #6
bossanova808
Enthusiast
bossanova808 began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Apr 2011
Device: Many
I've added the --url-prefix "/calibre" - but it doesn't seem to 'take' - does this mean if I am locally browsing I should be using localhost:19553/calibre/ ? If I do, I get:

Code:
The path '/calibre/' was not found.

Traceback (most recent call last):
  File "site-packages\cherrypy\_cprequest.py", line 606, in respond
  File "site-packages\cherrypy\_cperror.py", line 227, in __call__
NotFound: (404, "The path '/calibre/' was not found.")
bossanova808 is offline   Reply With Quote
Old 04-13-2011, 12:00 AM   #7
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,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You need to figure out what URL your main server is passing to calibre and set --usr-prefix accordingly
kovidgoyal is offline   Reply With Quote
Old 04-13-2011, 12:36 AM   #8
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,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
A good way to understand the process is to run the calibre server as

calibre-server --usr-prefix /calibre

then go to localhost:8080/calibre in your browser and you will see that the content server now runs with all URLS prefixed by /calibre
kovidgoyal is offline   Reply With Quote
Old 04-13-2011, 12:43 AM   #9
bossanova808
Enthusiast
bossanova808 began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Apr 2011
Device: Many
That is not as easy as it sounds! Any tips on how to do that??

I am currently at:

Code:
--with-library "K:\Calibre Library" --port 19553 --username BookLibrary --password XXX --url-prefix "/books"
with (n.b. NOT in a virtual host):

Code:
<Location /books/>
    order deny,allow
    deny from all
    allow from all
    ProxyPass http://localhost:19553/
    ProxyPassReverse http://localhost:19553/
</Location>
I have also tried the above with --url-prefix "/calibre" and /calibre/ in the location directive.

Both give the same results - the raw html text but no CSS etc.
bossanova808 is offline   Reply With Quote
Old 04-13-2011, 12:45 AM   #10
bossanova808
Enthusiast
bossanova808 began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Apr 2011
Device: Many
Oh BTW - if you ARE supposed to use --url-prefix with the ProxyPass methos then you might want to cahnge this note in the docs:

Quote:
If you are willing to devote an entire VirtualHost to the content server, then there is no need to use –url-prefix and RewriteRule, instead just use the ProxyPass directive.
bossanova808 is offline   Reply With Quote
Old 04-13-2011, 01:11 AM   #11
bossanova808
Enthusiast
bossanova808 began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Apr 2011
Device: Many
I just tried the other method:

Code:
RewriteEngine on
RewriteRule ^/calibre/(.*) http://localhost:19551/calibre/$1 [proxy]
RewriteRule ^/calibre http://localhost:19551 [proxy]
...and the result is the same as with the ProxyPass method....html text but no css etc.
bossanova808 is offline   Reply With Quote
Old 04-13-2011, 10:51 AM   #12
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,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Sorry, I do not have the time to walk you through setting up Apache correctly.
kovidgoyal is offline   Reply With Quote
Old 04-13-2011, 07:46 PM   #13
bossanova808
Enthusiast
bossanova808 began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Apr 2011
Device: Many
(Yeah not really what I was asking was it?)

Apache is working fine and serving 5 other reverse proxy apps. So I think the problem is probably Calibre using some non relative URLs or something...I had the same results with one other app and this was the cause in that case (hardcoded references to /gui/). Fixed the non relative URLs and it worked fine, with that app.

Anyway, it's no big deal, and in any case, I've decided the reverse proxy thing actually has some negatives when you use a bunch on inter-related apps anyway, so I have unwound the changes and am back to serving Calibre on its own port.

Thanks for your attention in any case, and the great program that is Calibre.
bossanova808 is offline   Reply With Quote
Old 09-16-2011, 09:38 AM   #14
Sevie
Junior Member
Sevie began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Sep 2011
Device: Sony PRS-T1 (in a month)
Hi guys,

Just wanted to let you know i've had the same problem. Solved it by using the / after the portnumber....

In the httpd_vhosts.conf file the proper command is:
ProxyPass / http//whatever:8080/
The answer was indeed in the logfile.
Sevie is offline   Reply With Quote
Reply

Tags
apache, content server, reverse proxy


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP+Apache web server for calibre ... chaley Related Tools 254 04-28-2014 08:18 PM
Content server, IIS proxy, and gzip compression abrinton Calibre 9 04-08-2011 01:26 PM
calibre, apache, mod_python content server rupa Calibre 0 12-26-2010 10:29 AM
Content Server thibaulthalpern Calibre 5 04-28-2009 12:56 PM


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


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