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-03-2013, 11:09 AM   #1
fiuwe
Junior Member
fiuwe began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2013
Device: Kindle WP
Calibre server on apache2 server from port 80

Hi all,
I would like to show my library using TCP port 80, but I have an apache2 server listening there.

It's more days that I'm trying to set both WSGI from calibre guide and reverse proxy from guide and different sites.
No way.

I tried installing binary pack, recompiling from source ( first I recompiled PyQT and SIP).........

All finished with an error :

"ImportError: No module named calibre.library.server.main"

I've never used this kind of stuff and now my head is exploding.
Could anyone help me with a SuperIgnorantDummy guide step-by-step ? :


thanks for any news


Last edited by fiuwe; 10-04-2013 at 03:23 AM.
fiuwe is offline   Reply With Quote
Old 10-03-2013, 04:52 PM   #2
At_Libitum
Addict
At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.
 
Posts: 265
Karma: 724240
Join Date: Aug 2013
Device: KyBook
Funny, I recently tried exactly the same just to get rid of the need to enter a portnumber. Although I only tried as reverse proxy, haven't tried the in-process route using WSGI

Here's what I did
in httpd.conf made sure mod_proxy.so and mod_proxy_http.so are uncommented.
in mine mod_proxy_rewrite.so was already uncommented so do not know if it is required

then in the extra folder I modified http-proxy.conf and added these lines
Code:
# OPDS
ProxyPass /opds http://127.0.0.1:8080/opds
ProxyPassReverse /opds  http://127.0.0.1:8080/opds

# Web Interface
ProxyPass /browse http://127.0.0.1:8080/browse
ProxyPassReverse /browse http://127.0.0.1:8080/browse

# 'Mobile' Web Interface
ProxyPass /mobile http://127.0.0.1:8080/mobile
ProxyPassReverse /mobile http://127.0.0.1:8080/mobile

# Required paths
ProxyPass /static http://127.0.0.1:8080/static
ProxyPassReverse /static http://127.0.0.1:8080/static
ProxyPass /get http://127.0.0.1:8080/get
ProxyPassReverse /get http://127.0.0.1:8080/get
and that was all, restarted Apache and now if I navigate in Stanza to localhost/opds I get to see Calibre's OPDS output and if I use localhost/browse in a browser I can use the web-interface and if I want to use web-interface on my phone I visit localhost/mobile

In that same file is likely a section <proxy *>

I've changed that from the default restrictive order deny, allow to

Order allow,deny
Allow from all

for testing purposes, so make sure to modify this to your requirements if you restrict access to only selected users.

Last edited by At_Libitum; 10-03-2013 at 08:24 PM.
At_Libitum is offline   Reply With Quote
Old 10-03-2013, 05:36 PM   #3
fiuwe
Junior Member
fiuwe began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2013
Device: Kindle WP
Thanks a lot

It works ... more or less :P

I also had to add the static folder from calibre otherwise I could not see anything.
The only problem now is to show the books cover.
looking at the page source code, they are linked as src="get/thumb_123_23/1234" and i dont' have an idea on how to set that on the proxy conf O.o

Any idea ?

Last edited by fiuwe; 10-03-2013 at 06:06 PM.
fiuwe is offline   Reply With Quote
Old 10-03-2013, 08:22 PM   #4
At_Libitum
Addict
At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.
 
Posts: 265
Karma: 724240
Join Date: Aug 2013
Device: KyBook
Quote:
Originally Posted by fiuwe View Post
Thanks a lot

It works ... more or less :P

I also had to add the static folder from calibre otherwise I could not see anything.
The only problem now is to show the books cover.
looking at the page source code, they are linked as src="get/thumb_123_23/1234" and i dont' have an idea on how to set that on the proxy conf O.o

Any idea ?
Ah, so that's why I had the /static reroute in there...forgotten about it and since it didn't do anything when I tried, I figured it was a leftover from another experiment.

The images then likely also need another entry for the /get path, at least they started showing when adding
Code:
ProxyPass /get http://127.0.0.1:8080/get
ProxyPassReverse /get http://127.0.0.1:8080/get
edited first reply to make the list complete
At_Libitum is offline   Reply With Quote
Old 10-04-2013, 03:22 AM   #5
fiuwe
Junior Member
fiuwe began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2013
Device: Kindle WP
I thoght the same and did earlier this morning

Everything is working now

Thanks for ur support

fiuwe is offline   Reply With Quote
Old 10-04-2013, 03:58 AM   #6
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,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
@At_Libitum: why did you reverse-proxy calibre's sub-URLS instead of using a URL prefix as described in http://manual.calibre-ebook.com/server.html, e.g. http://foo.bar.com/library or as in the manual, http://foo.bar.com/calibre? The way you did it ensures that the main calibre page will not be visible and will create maintenance problems if calibre's URLs are ever extended. Using a URL prefix eliminates both problems.

Also, you should add /ajax.
chaley is offline   Reply With Quote
Old 10-04-2013, 07:09 AM   #7
At_Libitum
Addict
At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.
 
Posts: 265
Karma: 724240
Join Date: Aug 2013
Device: KyBook
Quote:
Originally Posted by chaley View Post
@At_Libitum: why did you reverse-proxy calibre's sub-URLS instead of using a URL prefix as described in http://manual.calibre-ebook.com/server.html,
Also, you should add /ajax.
Yes, If I could have gotten the URL prefix working I wouldn't have needed to use the separate paths but had only needed a rule for the prefix.

The reason I entered several paths is because when I tried it by configuring a url prefix in Calibre, I got nothing but 404's and because each of those paths I entered has a different kind of output I decided to go that route.

Since I use it mostly only to access /opds from my iPhone I only started out with that one, the others got added for good measure and the occasional use...turns out that /static is required and /get only if you want to see thumbnails. At least in this form of setup

and what do you mean, main calibre page? That page you get when using /localhost:8080/ is the same as when you type /localhost:8080/browse

PS. FWIW, I found the opds/webinterface rather unstable. When it works it works, but when you start changing it from the default, I regularly had to kill Calibre because it got stuck when tryin to stop the content server, so I stopped experimenting and stuck with what I have now.

Last edited by At_Libitum; 10-04-2013 at 07:21 AM.
At_Libitum 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
Problems finding a port for Calibre Server cptnemo Library Management 4 09-10-2012 02:37 AM
500 Internal Server Error accessing content server Calibre 0.8.8 DaddyO57 Calibre 1 07-20-2012 06:08 PM
Calibre-server port not open issue on Fedora server stueyboy Devices 0 08-17-2011 04:57 PM
Can only start the Calibre Content Server once Per port Apothe0sis Calibre 1 04-16-2011 08:25 AM
calibre-server on port 80 problem jquest Calibre 2 11-06-2009 06:04 AM


All times are GMT -4. The time now is 11:32 AM.


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