Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Related Tools

Notices

Reply
 
Thread Tools Search this Thread
Old 01-20-2017, 12:59 PM   #1426
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
Quote:
Originally Posted by mariosipad View Post
@MontyJ

If you get a "familiar" error, then PageKite is working (again)

Does the error looks something like this?
Code:
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
The error is caused by a wrong path in AuthUserFile /path/to/.htpasswd in ./web/cops/.htaccess.

The path needs to be an absolute path from the QNAB / to the .htpasswd file.

The line
Code:
AuthUserFile /share/MD0_DATA/.qpkg/COPS/accesCops.htpasswd
must be wrong. (At the very least I am missing a / in front of .htpasswd )

If we want (for the time being) to put .htpasswd in ./web/cops we need to find the absolute path to this location. If you know what it is then disregard the next lines.

To find out the absolute location of the web root (from there is it ./cops/.htpasswd) please make a file named myroot.php in ./web with this content:
Code:
<html>
<head>
<title>Getting your AuthUserFile root location</title>
</head>
<?php
echo "<h1>Your website root location is -->  ";
echo $_SERVER['DOCUMENT_ROOT'];
echo "  <--<h1/>";?>
<body>
</body></html>
then in a browser http://192.168.xxx.xxx/myroot.php.
Note the web root between -> /Y/Y/Y <-.

Now go to ./web/cops and edit .htaccess. The last few lines must now look like (where you fill in /Y/Y/Y (starting with the /)
Code:
###########################################
# Uncomment if you wish to protect access with a password
###########################################
# If your covers and books are not available as soon as you protect it
# You can try replacing the FilesMatch directive by this one
# <FilesMatch "(index|feed)\.php">
# If helps for Sony PRS-TX and Aldiko, beware fetch.php can be accessed
# with authentication (see $config ['cops_fetch_protect'] for a workaround).
###########################################
<FilesMatch "\.php$">
AuthUserFile "/Y/Y/Y/cops/.htpasswd"
AuthGroupFile /dev/null
AuthName "Secure access"
AuthType Basic
Require valid-user
</FilesMatch>
Did this help?

The unexpected error kept me baffled for a while as well.
Good morning, afternoon, evening...where ever you may be, LoL!

Ok, the result of myroot.php is: Your website root location is --> /share/Web <--

When I put that in my .htaccess file, here are the lines in total:
Code:
<FilesMatch "\.php$">
AuthUserFile "/share/Web/cops/.htpasswd"
AuthGroupFile /dev/null
AuthName "Acces securise"
AuthType Basic
Require valid-user
</FilesMatch>
The only thing different is AuthName "Access securise", which I assume is French for "Secure Access". Does that make a diff? Should I change it?

In any case I still get the "500 Internal Server Error", and the browser url window changed to "http://mydomain.pagekite.me/cops/"

[edit] Here are the terminal results when I run pagekite and then try to login:
Code:
[/share/Web] # python pagekite.py --optfile=/share/Web/pagekite.rc mydomain.pagekite.me
>>> Hello! This is pagekite.py v0.5.9.0.                        [CTRL+C = Stop]
    Connecting to front-end relay 54.183.178.65:443 ...                        
     - Protocols: http http2 http3 https websocket irc finger httpfinger raw   
     - Protocols: minecraft                                                    
     - Ports: 79 80 443 843 2222 3000 4545 5222 5223 5269 5670 6667 8000 8080  
     - Ports: 8081 9292 25565                                                  
     - Raw ports: 22 virtual                                                   
    Quota: You have (my acct data) connections left.              
~<> Flying localhost:80 as https://mydomain.pagekite.me/                 
!!! xxx.xxx.xxx.xxx - http://mydomain.pagekite.me:80 (USER ACCESS DENIED)   
    xxx.xxx.xxx.xxx < http://mydomain.pagekite.me:80 (localhost:80)         
 << pagekite.py [flying]   Kites are flying and all is well.
Interesting...I just noticed a pagekite version change. I had sent him/them(?) a descriptive email on the problems and a request for help 2 days ago. Maybe he got out of the hot lava thermal pool to check on things?...

Last edited by MontyJ; 01-20-2017 at 01:14 PM. Reason: add details
MontyJ is offline   Reply With Quote
Old 01-20-2017, 01:23 PM   #1427
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: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
Good evening from the Netherlands!

What happens if you try: http://192.168.xxx.xxx ?
mariosipad is offline   Reply With Quote
Advert
Old 01-20-2017, 03:15 PM   #1428
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
Quote:
Originally Posted by mariosipad View Post
Good evening from the Netherlands!

What happens if you try: http://192.168.xxx.xxx ?
Firefox: The first time I put in exactly "https://192.168.x.xxx" it gave me a login screen requested by "Acces securise" (Hmmm, Dutch, not French?)

I entered monty and the password, then got the 500 Internal Server error.

I tried it again, but went straight to the 500 error, no login screen.

I cleared the FF caches, but still went to the 500 error screen.

I then opened Chrome, entered the same address and got a different styled login screen that did not have "Acces securise" in it at all. But after entering login info, got 500 error.

And the url in the address box did change to .../cops like before.
MontyJ is offline   Reply With Quote
Old 01-20-2017, 03:32 PM   #1429
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: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
"Access secUrise" is French. The developer of COPS is from France. You can change this to anything you like.

The error means that the path to .htpasswd still is wrong.

You might try to change the path to something you know that is true for QNAP and copy .htpasswd to this directory. Just for testing, try to keep it simple like /etc (if it exits al all in QNAP).

Then try again.
mariosipad is offline   Reply With Quote
Old 01-20-2017, 03:41 PM   #1430
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
Quote:
Originally Posted by mariosipad View Post
"Access secUrise" is French. The developer of COPS is from France. You can change this to anything you like.

The error means that the path to .htpasswd still is wrong.

You might try to change the path to something you know that is true for QNAP and copy .htpasswd to this directory. Just for testing, try to keep it simple like /etc (if it exits al all in QNAP).

Then try again.
I had tried .htpasswd in /share/Web as will, didn't change anything.

Then copied it to /etc but same results. I did check it and the two users, one being "monty" were in there, along with the encrypted passwords. So the file itself looks ok.
MontyJ is offline   Reply With Quote
Advert
Old 01-20-2017, 03:47 PM   #1431
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: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
As a last (test) resort put .htpasswd in /
and change in ./web/cops/.htaccess
AuthUserFile "/share/Web/cops/.htpasswd" to
AuthUserFile "/.htpasswd"

Any Luck?
mariosipad is offline   Reply With Quote
Old 01-20-2017, 04:06 PM   #1432
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
Quote:
Originally Posted by mariosipad View Post
As a last (test) resort put .htpasswd in /
and change in ./web/cops/.htaccess
AuthUserFile "/share/Web/cops/.htpasswd" to
AuthUserFile "/.htpasswd"

Any Luck?
You the Man!!

That appears to have solved the problem! I first tried the url in Chrome and got my COPS menu with all my libraries. So, we are not

Then left that session open and put in the same url into Firefox. It opened immediately to the same COPS with no stop at a login.

I now have to sort out which security login to go with...Pagekites or Apaches.

Thanks for the patience and efforts Mario!
MontyJ is offline   Reply With Quote
Old 01-20-2017, 04:15 PM   #1433
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: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD


Just remember that .htpasswd in / will not survive a reboot (if I understood correctly).

I would suggest moving it to a "safer" place (and editing .htaccess accordingly).

You can now delete all the small *.php files I have asked you to make (like test.php).
They pose a small security risk, so remove them (not the .htaccess file though ).

I'm happy I could be of some little help.

Last edited by mariosipad; 01-20-2017 at 04:19 PM.
mariosipad is offline   Reply With Quote
Old 01-20-2017, 04:37 PM   #1434
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
Quote:
Originally Posted by mariosipad View Post


Just remember that .htpasswd in / will not survive a reboot (if I understood correctly).

I would suggest moving it to a "safer" place (and editing .htaccess accordingly).

You can now delete all the small *.php files I have asked you to make (like test.php).
They pose a small security risk, so remove them (not the .htaccess file though ).

I'm happy I could be of some little help.
Good reminder! I just tried it in /share/Web and it worked after changing .htaccess. So it looks to be a solid place to start.

I want to have one of my users check it out first, then will add the other 39, LoL.

After that I will need to get the autorun or whatever sorted out so I can get this bad boy running at startup.
MontyJ is offline   Reply With Quote
Old 01-20-2017, 05:06 PM   #1435
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: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
In theory /share/Web is not the most secure place to put .htpasswd.

It might be better to try to place .htpasswd in a (new) subdirectory of /share/Web/cops (for example /share/Web/cops/pw/.htpasswd) and change .htaccess accordingly.

But for now it's good enough to test.
mariosipad is offline   Reply With Quote
Old 01-20-2017, 05:31 PM   #1436
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
Quote:
Originally Posted by mariosipad View Post
In theory /share/Web is not the most secure place to put .htpasswd.

It might be better to try to place .htpasswd in a (new) subdirectory of /share/Web/cops (for example /share/Web/cops/pw/.htpasswd) and change .htaccess accordingly.

But for now it's good enough to test.
Ok, I will take you advice on that!
MontyJ is offline   Reply With Quote
Old 01-21-2017, 05:00 PM   #1437
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
Just an update on how this QNAP+COPS+Pagekite thing is going..

Since my last update, I entered all my users into .htpasswd. Keep in mind they were already in the pagekite.rc file.

I then flipped the switch and invited them to try it out.

It was a mixed bag. Some users got in w/o any problems, others simply could not get past the login.

And I noticed that, seemingly randomly, and with different browsers, I would sometimes get the 'pagekite' login screen, and other times get the Apache login.

So I decided to eliminate the pagekite logins and commented them all out in the pagekite.rc file. That seems to have cleared up the problem of the logins...knock on wood, LoL.

But, I lost the great activity data on each user login realtime and in the pagekite.log file. I am running it from a ssh command prompt, but it also runs as a daemon which does not provide any realtime data, but does put it into the log file realtime. Still, w/o the users activated in pagekite.rc, I only get basic IP info.

Q) So, question: Is there a log file in COPS with time stamped activity? Is there some config file setting to turn that on if not?

I can eventually find the apache log file(s), but cannot find anything for COPS.

Q) I have yet to find any examples of a 'autorun' setup that will work for the tS-251. The 'ramblock' examples I see for the TS-251+ do not show up in the TS-251...as least as far as I can find.

Q) Any one know if there is a better way to to configure an app to automatically start when the QNAP reboots? In my case, the current startup looks like this, tho for security I will change it after I let the users bang on it a while:

Code:
[/share/Web] # python pagekite.py --optfile=/share/Web/pagekite.rc mydomain.pagekite.me
I did get an answer from the Pagekite developer. Very polite, but could only offer generalities on my issues and pointed out that the .deb install of Pagekite automatically set it up for start on boot. I doubt, but don't really know, if there are any .deb installers for QTS running on x86 Intel chips.

Monty
MontyJ is offline   Reply With Quote
Old 01-21-2017, 06:41 PM   #1438
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: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
@MontyJ

With both Pagekite and apache login enabled what should have happened is that your users first need to login to Pagekite and second login to apache/COPS.
if the PageKite logincodes were still in the browserchaches or stored as logincredentials in their browsers they (in their experience) gp straight to the apache/login. Enable both, get double safety! . (And as a bonus your statistics.)

COPS does not have it's own logfiles.
You should search for the apache "access.log" logfile. There the users activity (login, files downloaded) is logged.
What do you want/need to know? Somewhere in this forum (probably many many pages back) this was solved in a number of post between a user from Australia and me (he did the heavy lifting). If you want I can try to adopt what we were doing for your purpose, if possible.

As I do not have a QNAP ......... you are at the mercy of other helpful members of this forum.
mariosipad is offline   Reply With Quote
Old 01-21-2017, 08:13 PM   #1439
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
@mariosipad

Quote:
With both Pagekite and apache login enabled what should have happened is that your users first need to login to Pagekite and second login to apache/COPS.
if the PageKite logincodes were still in the browserchaches or stored as logincredentials in their browsers they (in their experience) gp straight to the apache/login. Enable both, get double safety! . (And as a bonus your statistics.)
Hmmm, I never once saw two sequential logins, and the users did not report that either. As to requiring two logins? Well, seems a little pointless unless they have two different sets of login credentials...and that, I believe, would be a show stopper for the users, not to mention my grinding teeth on having to keep up two separate sets of the dang things, LoL.

Calibre Server has some really great log files. They were csv formatted, so I simply linked the files into a spreadsheet and then ran reports up the kazoo to get the info I wanted. It was a huge help in figuring out how the users used the system, types of titles they preferred, etc.

As to the Apache log files, the only 'access.log' file anywhere in qnap is:
Code:
# find / -name access.log -type f
/mnt/ext/opt/netmgr/api/core/access.log
find: ‘/proc/13017’: No such file or directory
#
And it has entries ending back in 2015, so not applicable here.

I did go through every .log file I could find anywhere in a folder with the word apache in it, nada. Apache's error.log has nothing in it at all.

Surely apache can be made to log stuff, so perhaps there is a config parameter that is just not turned on. i will take a look through the .conf files and see what I can find.

Was this comment referring to the apache log files?:
Quote:
What do you want/need to know? Somewhere in this forum (probably many many pages back) this was solved in a number of post between a user from Australia and me (he did the heavy lifting). If you want I can try to adopt what we were doing for your purpose, if possible.
Thanks!
MontyJ is offline   Reply With Quote
Old 01-22-2017, 12:49 PM   #1440
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: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
Perhaps httpd.conf is the file you are looking for?

And yes, I was referring to apache log files.
mariosipad is offline   Reply With Quote
Reply

Tags
calibre opds, dns, kobo aura, synology


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:52 AM.


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