04-12-2011, 10:58 PM | #1 |
Enthusiast
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> 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.... |
04-12-2011, 11:05 PM | #2 |
creator of calibre
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
04-12-2011, 11:08 PM | #3 |
Enthusiast
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... |
04-12-2011, 11:12 PM | #4 |
creator of calibre
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 |
04-12-2011, 11:13 PM | #5 |
Enthusiast
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! |
04-12-2011, 11:32 PM | #6 |
Enthusiast
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.") |
04-13-2011, 12:00 AM | #7 |
creator of calibre
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
|
04-13-2011, 12:36 AM | #8 |
creator of calibre
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 |
04-13-2011, 12:43 AM | #9 |
Enthusiast
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" Code:
<Location /books/> order deny,allow deny from all allow from all ProxyPass http://localhost:19553/ ProxyPassReverse http://localhost:19553/ </Location> Both give the same results - the raw html text but no CSS etc. |
04-13-2011, 12:45 AM | #10 | |
Enthusiast
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:
|
|
04-13-2011, 01:11 AM | #11 |
Enthusiast
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] |
04-13-2011, 10:51 AM | #12 |
creator of calibre
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.
|
04-13-2011, 07:46 PM | #13 |
Enthusiast
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. |
09-16-2011, 09:38 AM | #14 |
Junior Member
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. |
Tags |
apache, content server, reverse proxy |
|
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 |