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 01-17-2017, 06:01 PM   #1396
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 205
Karma: 10
Join Date: Jul 2012
Device: Kindle
@mariosipad

Here is the "Web" directory:
Code:
[/share/CACHEDEV1_DATA/Web] # ls -l
drwxrwxrwx    2 admin    administ      4096 Jan 12 09:47 @Recycle/
lrwxrwxrwx    1 admin    administ        37 Jan 15 09:26 COPS -> /share/CACHEDEV1_DATA/.qpkg/COPS/COPS/
[/share/CACHEDEV1_DATA/Web] #
When I put in the browser:
Code:
https://mydomain.pagekite.me/cops/index.php
It has the same results as in my previous post:
- I get the Pagekite login menu.
- I put in my username and password
- I get the Apache 403 error

That is because "mydomain" gets resolved to go to Pagekite, which then does its thing on my port 80.

However, if I put in my browser:
Code:
http://192.168.x.xxx/COPS/index.php
then I get the normal COPS menu, showing my 5 libraries, ready for browsing! Also, Pagekite works with either https or http. But locally https with the above does not work.

It seems to me, in my inexperience with website stuff, that Apache config file(s) might need a tweak. But I have no clue what/where or the risks, if any!

I am certainly open to suggestions!!
MontyJ is offline   Reply With Quote
Old 01-17-2017, 06:45 PM   #1397
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 711
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
Not that I think it will help, but ......

Try http://mydomain.pagekite.me/COPS/index.php

So COPS in capitals.

It's way after midnight here and I need my zzzzzz's. I will explore another idea in about 12 hours.
mariosipad is offline   Reply With Quote
Old 01-17-2017, 07:04 PM   #1398
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 205
Karma: 10
Join Date: Jul 2012
Device: Kindle
Quote:
Originally Posted by mariosipad View Post
Not that I think it will help, but ......

Try http://mydomain.pagekite.me/COPS/index.php

So COPS in capitals.

It's way after midnight here and I need my zzzzzz's. I will explore another idea in about 12 hours.
Yes, the COPS folder is upper case.
MontyJ is offline   Reply With Quote
Old 01-18-2017, 05:09 AM   #1399
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 711
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
Let's take COPS out of the equation for now and just focus on PageKite.

Can you save (with a text editor) the following code in a file named test.php:
Code:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php 
phpinfo(); 
?>
</body>
</html>
and then place this file in ./web (not just like COPS with a symlink but straight in ./web)

What do you see (does it work) when you http://192.168.xxx.xxx/test.php and http://mydomain.pagekite.me/test.php?
mariosipad is offline   Reply With Quote
Old 01-18-2017, 11:05 AM   #1400
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 205
Karma: 10
Join Date: Jul 2012
Device: Kindle
Quote:
Originally Posted by mariosipad View Post
Let's take COPS out of the equation for now and just focus on PageKite.

Can you save (with a text editor) the following code in a file named test.php:
Code:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php 
phpinfo(); 
?>
</body>
</html>
and then place this file in ./web (not just like COPS with a symlink but straight in ./web)

What do you see (does it work) when you http://192.168.xxx.xxx/test.php and http://mydomain.pagekite.me/test.php?
In both cases I got a very long page of php info, starting with "PHP Version 5.5.38".

I did save it as an html page, so if any of the info is needed, I have it.
MontyJ is offline   Reply With Quote
Old 01-18-2017, 11:58 AM   #1401
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 711
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
Ok!!

That means that PageKite seems to be working.

COPS should be working too.

Just to try it out:
- copy COPS from it"s present location on your QNAP to ./web/cops-test
- maybe edit config_local.php (don't think it's needed)
- http://192.168.xxx.xxx/cops-test
- http://mydomain.pagekite.me/cops-test/checkconfig.php

And? (fingers crossed)
mariosipad is offline   Reply With Quote
Old 01-18-2017, 01:08 PM   #1402
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 205
Karma: 10
Join Date: Jul 2012
Device: Kindle
Quote:
Originally Posted by mariosipad View Post
Ok!!

That means that PageKite seems to be working.

COPS should be working too.

Just to try it out:
- copy COPS from it"s present location on your QNAP to ./web/cops-test
- maybe edit config_local.php (don't think it's needed)
- http://192.168.xxx.xxx/cops-test
- http://mydomain.pagekite.me/cops-test/checkconfig.php

And? (fingers crossed)
Yes, uncross fingers, both worked! To anticipate, I created a third folder "cops" (not "COPS", so the Web folder contents is now:
Code:
lrwxrwxrwx    1 admin    administ        37 Jan 15 09:26 COPS -> /share/CACHEDEV1_DATA/.qpkg/COPS/COPS/
drwxrwxrwx    8 admin    administ      4096 Jan 18 10:52 cops/
drwxrwxrwx    8 admin    administ      4096 Jan 18 10:39 cops-test/
I know I could have renamed cops-test, but left it for now if you suggest more 'testing', LoL.

And, if I enter http://mydomain.pagekite.me/cops, I do get the proper main cops menu with my specified Calibre libraries
but no login screen of course since I bypassed pagekite.

So, again anticipating, how to I get the version in "cops" to be the default?
MontyJ is offline   Reply With Quote
Old 01-18-2017, 01:51 PM   #1403
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 711
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
Great!

Do I understand correctly that you want http://mydomain.pagekite.me to point to cops?
(Instead of http://mydomain.pagekite.me/cops ?)


Edit:

Did you also try to actually download an epub or pdf?

Last edited by mariosipad; 01-18-2017 at 02:06 PM.
mariosipad is offline   Reply With Quote
Old 01-18-2017, 02:15 PM   #1404
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 205
Karma: 10
Join Date: Jul 2012
Device: Kindle
Quote:
Originally Posted by mariosipad View Post
Great!

Do I understand correctly that you want http://mydomain.pagekite.me to point to cops?
(Instead of http://mydomain.pagekite.me/cops ?)
Preferably, yes.

It set up out-of-the-box that way when I installed in Linux Mint. My users are used to that. Here is some more detail why.

My subdomains at Pagekite go something like this:

lib1-name.pagekite.me
lib2-name.pagekite.me
etc for a current total of 6 libs.

That was necessary because all libraries rolled into one was simply to slow for searching due to size. So in Calibre I broke it down to 6 individual libraries. So, 6 Calibre Server daemons running on 6 ports, so lib1-6 at pagekite.

Now, COPS allows me to use a single port that points to the still separate 6 Calibre libraries that users can switch between. If that were the end of it, I would not ask for more, but If this does not work out for some reason and I have to go back to the 6 urls for users to use like before, I don't want to have to create 6 COPS instances...if that is even possible.

And, I do need to provide individual logins for 40+ users. Currently that is in the Pagekite config file, and going directly to the 'cops' folder bypasses that!

So, yes, I would like to keep the Pagekite login structure unless I can do the same thing in COPS or Apache?

[edit] On second thought, If I could manage the login requirements in COPS or Apache or other locally, then I could eliminate Pagekite and get a single domain registered for probably little $$. So that is a good alternative if available and secure.

Last edited by MontyJ; 01-18-2017 at 02:39 PM. Reason: Clarify
MontyJ is offline   Reply With Quote
Old 01-18-2017, 03:12 PM   #1405
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 711
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
First:
http://mydomain.pagekite.me (and lib1-name.pagekite.me and lib2-name.pagekite.me etc) will all point to http://localhost and not to http://localhost/cops .

But if you make a file named .htaccess (pay attention to the .) in the ./web directory with code:
Code:
RewriteEngine On
RewriteRule ^$ /cops [l]
that "problem" is solved.

Is it?

Easier is to let all of your users get used to using just 1 (one) url.

Second:
40 unique users with unique usernames and passwords is a lot but can be done by apache.
A - is there an utility named htpasswd on your QNAP? Can you find out?
If not, there are work arounds.
B - will follow if A is answered ;-)


I thought you needed to use PageKite because of frequent IP changes?

Buying a domain name means that you yourself must make sure that the domain name points to your (changing) external IP.
It's also possible to use a dynamic DNS service (ranging from free to expensive). These services sometimes have an app that does the changing for you. But for the moment lets not complicate things.)
mariosipad is offline   Reply With Quote
Old 01-18-2017, 04:55 PM   #1406
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 205
Karma: 10
Join Date: Jul 2012
Device: Kindle
@mariosipad,

Yes, Pagekite does provide a dynamic ip connection, but won't others provide similar capabilities?

Hmmm, but will they eliminate the need to port forward like Pagekite? Not a big deal, as I assume apache is secure...

Ok, I have added the line to .htaccess, which is in the cops dir:
Code:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ /cops [l]
RewriteRule ^download/(\d*)/(\d*)/.*\.kepub\.epub$ fetch.php?data=$1&db=$2&type=epub [L]
RewriteRule ^download/(\d*)/(\d*)/.*\.(.*)$ fetch.php?data=$1&db=$2&type=$3 [L]
RewriteRule ^download/(\d*)/.*\.kepub\.epub$ fetch.php?data=$1&type=epub [L]
RewriteRule ^download/(\d*)/.*\.(.*)$ fetch.php?data=$1&type=$2 [L]
</IfModule>
As for htpasswd, here are some files by that name:
Code:
/share/CACHEDEV1_DATA/.qpkg/QKVM/opt/bin/htpasswd
/mnt/ext/opt/apache/bin/htpasswd
I don't see a 'utility' called htpasswd, but perhaps it is is part of the section in the Control Panel > Security
- Security Level
- Network Access Protection
- Certificate & Private Key

Under Security Level Select
- Allow all connections (selected)
- Deny all connections on the list
- Allow connections from the list only
- Area to enter items in list (no current entries)

Under Network Access Protection
- Enabled
- Selectable list of: SSH, Telnet, HTTP(S), FTP, SAMBA, AFP
None are selected at this point.

Under Certificate & Private Key
- Download Certificate
- Download Private Key
- Restore Default Certificate & Private Key
- No certs or keys entered; never been in this menu before.

I also see a Control Panel > Network Access section with:
- Service Binding
- Proxy
- DDNS Service (all services are checked for binding)

But, no "Password" or (htpasswd) that I have found so far.
MontyJ is offline   Reply With Quote
Old 01-18-2017, 05:32 PM   #1407
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 711
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
@MontyJ

The main advantage of a service like PageKite is that there is no need to open ports in your modem/router. Opening ports is the main security risk for any local network. And unless you *think* you know what you are doing do not open any ports. So for the time being you better stick with PageKite.
And you assume wrong, apache is only as safe as you set it up. And I fear your setup at this moment is just not safe enough to use with direct access from the www. Using PageKite is what I call "security through obscurity" and in your case safe enough!

Please do not add the lines
Code:
RewriteEngine On
RewriteRule ^$ /cops [l]
to the .htaccess file in ./web/cops but make a new file in ./web with just these 2 lines in it.

... more in the next post. (later)

Edit: later regrettably will become tomorrow. I ran into a problem. Something I know that has worked in the past, now gives me an ugly error. I have to fix this before I can tell you with confidence that it will work.

Edit2: I seem to have fixed it (don't know how, but it works).
I keep up the suspense. As it is too late here in Europe (almost an hour after midnight) to continue, you'll have to wait a few hours. I hope you don't mind?

Have a nice day!

Last edited by mariosipad; 01-18-2017 at 06:54 PM.
mariosipad is offline   Reply With Quote
Old 01-18-2017, 07:14 PM   #1408
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 205
Karma: 10
Join Date: Jul 2012
Device: Kindle
@mariosipad,

You won't hear any complaints from me about getting some well deserved rest!

The first line was already in that file, I added only the second/new line below it.

So I am a little unclear of your intentions on that. I will, for now, proceed with your instructions exactly and remove both lines and put them in a new file.

Then will wait for you being back to proceed with any changes.

Thanks again for the efforts!!
MontyJ is offline   Reply With Quote
Old 01-18-2017, 09:53 PM   #1409
jillmess
Enthusiast
jillmess ought to be getting tired of karma fortunes by now.jillmess ought to be getting tired of karma fortunes by now.jillmess ought to be getting tired of karma fortunes by now.jillmess ought to be getting tired of karma fortunes by now.jillmess ought to be getting tired of karma fortunes by now.jillmess ought to be getting tired of karma fortunes by now.jillmess ought to be getting tired of karma fortunes by now.jillmess ought to be getting tired of karma fortunes by now.jillmess ought to be getting tired of karma fortunes by now.jillmess ought to be getting tired of karma fortunes by now.jillmess ought to be getting tired of karma fortunes by now.
 
jillmess's Avatar
 
Posts: 43
Karma: 500000
Join Date: Dec 2011
Device: Kobo Libra 2
Quote:
Originally Posted by mariosipad View Post
@jillmess

I hope you have secured your webserver access (on port 80) from the WWW with at least a username/password? (I'm 99.9% sure of this, but better safe than sorry)


Am following this 'pagekite' stuff with interest though. Never heard of it before.
jillmess is offline   Reply With Quote
Old 01-18-2017, 11:29 PM   #1410
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 205
Karma: 10
Join Date: Jul 2012
Device: Kindle
Quote:
Originally Posted by jillmess View Post


Am following this 'pagekite' stuff with interest though. Never heard of it before.
Well, so far everything is behind a username/password, as you now know if you have been following this thread. And with Pagekite there is no port forwarding.

If you haven't already, you can check them out at pagekite.net.

The cost is right at $3/mo, tho if you plead hardship you can get it for free. The only drawback is the lack of quick support, and the delayed responses are often erratic. But if you are a little experienced with web/networking stuff, their online documentation is pretty extensive.

I am pretty much a noob at this, and even I was able to get it set up in Linux with little effort and only one question to them I couldn't find the answer to, tho I had to ask the question a second time, LoL.

QNAP, however, threw in a bunch of curves due to the way they implement QTS and I would be lost w/o Mario's great help.
MontyJ is offline   Reply With Quote
Reply

Tags
calibre opds, dns, kobo aura, synology

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre OPDS server with windows apps? nickdma Related Tools 10 03-03-2024 02:53 PM
[Old Thread] Android FBreader and Calibre OPDS server question kalex Calibre 5 12-24-2015 10:16 PM
PHP+Apache web server for calibre ... chaley Related Tools 254 04-28-2014 08:18 PM
External OPDS catalogue in Calibre bolton Calibre 1 09-05-2012 06:14 AM
Calibre Command Line usage with PHP artoros Related Tools 13 07-01-2010 09:57 AM


All times are GMT -4. The time now is 02:49 AM.


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