![]() |
#1411 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
Quote:
I see a few use-cases for PageKite (and a few other companies that provide a similar service): A - if your WAN-ip address at home is very "dynamic" (or has changed without you realising and you want to remotely connect to data on your home server). B - if your internet service provider does not like you to run your own server on port 80 (or closes all other ports below 1024). C - if you, from a security perspective, do not want to open ports in your router and forward them to your PC('s)/NAS or find this to complex. D - if you want to connect to a portable device (laptop) when it's outside of our own LAN. (A read something about a guy using Starbucks/McDonalds wifi and giving a client access to (a preview) of some work done for them. If I can make MontyJ's COPS working I might try PageKite or a similar service to make A and/or D working for myself. $ 3/month is not a lot of money, but just a little bit to much for casual use a few times a year. |
|
![]() |
![]() |
![]() |
#1412 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
@MontyJ
Quote:
![]() I meant that you should remove only the second line from .htaccess in ./web/cops/ not the line that was there already as well. Can you please put this first line (RewriteEngine On) back in this file in the same place where it was. The second .htaccess file should now be in ./web. You should be aware of the fact that I am using as little as possible of the capabilities of PageKite and try to guide (or "push) you in the direction of a setup (not unlike my own) that I know works. QNAP and Synology sometimes make a otherwise rather straightforward solution in "regular" Linux (Debian/Ubuntu) sometimes a bit "complicated", mainly due to a different directory structure and different file names (where you least expect it). Now on to setting up username/password for your users (with apache). Please follow these steps: 1 - edit ./web/cops/.htaccess Remove from the bottom few lines the # so that this part of the file now looks like 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 "./.htpasswd" AuthGroupFile /dev/null AuthName "Secure access" AuthType Basic Require valid-user </FilesMatch> - from ./web/cops type at the prompt: Code:
htpasswd -c .htpasswd monty - then to add a second user: from ./web/cops type at the prompt: Code:
htpasswd .htpasswd user1 - for additional users repeat the previous step but maybe test first with just 2 or 3 users. Again fingers crossed. |
|
![]() |
![]() |
Advert | |
|
![]() |
#1413 |
Addict
![]() Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
|
@mariosipad,
Ok, here is where I am at now... First, just an FYI for QNAP users. The htpasswd program is not in the run path on QNAP for some reason. I had to point to it as in: Code:
/mnt/ext/opt/apache/bin/htpasswd Code:
[/share/Web/cops] # ls -la drwxrwxrwx 8 admin administ 4096 Jan 19 09:06 ./ drwxrwxrwx 6 admin administ 4096 Jan 19 09:37 ../ -rw-r--r-- 1 admin administ 2606 Jan 19 08:30 .htaccess -rw-r--r-- 1 admin administ 91 Jan 19 09:09 .htpasswd I then uncommented the lines per your last post. Then created a new .htaccess file in the /share/Web folder here: Code:
[/share/Web] # ls -la drwxrwxrwx 6 admin administ 4096 Jan 19 10:04 ./ drwxrwxrwx 30 admin administ 4096 Jan 15 03:00 ../ drwxrwxrwx 2 admin administ 4096 Jan 16 14:09 .@upload_cache/ -rw-r--r-- 1 admin administ 42 Jan 19 09:37 .htaccess drwxrwxrwx 2 admin administ 4096 Jan 18 10:20 @Recycle/ lrwxrwxrwx 1 admin administ 37 Jan 15 09:26 COPS -> /share/CACHEDEV1_DATA/.qpkg/COPS/COPS/ drwxrwxrwx 8 admin administ 4096 Jan 19 09:06 cops/ [/share/Web] # Code:
RewriteEngine On RewriteRule ^$ /cops [l] Next, I run "http://mydomain.pagekite.me". The url address line in the browser changed to "http://mydomain.pagekite.me/cops/" and gave me this error: Code:
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, admin@NAS 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. Apache Server at mydomain.pagekite.me Port 80 I suspect there is a log of some kind, but I don't know where to find it... Is the error because I didn't get one of the above files in the right location...? Last edited by MontyJ; 01-19-2017 at 12:50 PM. Reason: add comment |
![]() |
![]() |
![]() |
#1414 |
Addict
![]() Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
|
@mariosipad,
I just looked at the details of those lines at the end of /share/Web/cops/.htaccess that I uncommented: Code:
<FilesMatch "\.php$"> AuthUserFile /share/MD0_DATA/.qpkg/COPS/accesCops.htpasswd AuthGroupFile /dev/null AuthName "Acces securise" AuthType Basic Require valid-user </FilesMatch> |
![]() |
![]() |
![]() |
#1415 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
....... It is the same error I got yesterday evening and tried to solve. No idea how, but after some fiddling the "problem" seemed to have solved itself.
What did I fiddle? - restarted webserver (maybe restart QNAP) - cleared firefox caches - tried another browser (Chrome) -> worked - in firefox I tried http://192.168.xxx.xxx/cops/login.html And in the end it worked. Maybe you should try? |
![]() |
![]() |
Advert | |
|
![]() |
#1416 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
Quote:
|
|
![]() |
![]() |
![]() |
#1417 | |
Addict
![]() Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
|
Quote:
I did a 'restart' of qnap. I didn't disconnect my ssh sessions, but of course it terminated those. After it came up, I made sure I could login to the qnap desktop. Keep in mind the original COPS icon is still there, and just to check I selected it and the original COPS install still works normally; it came up an a new tab in Firefox. I then closed that session. Next I reconnected with a SSH session as 'admin', as normal. At the "/" folder I typed in pagekite.py to start it up again. Nothing. File not found. I then checked for the pagekite config and log files in the / folder, but they were not there. I did a 'find' for ANY pagekite files, but nada! I had read that the antivirus or malware removal could be a problem with some programs, but when I checked the Antivirus program on the desktop, it was not enabled and there were no scan jobs listed either. Not sure what this is all about, but I now have to recreate my pagekite config file as I did not do any backups during this testing Then reinstall pagekite.py...somewhere. The Linux script Pagekite provides puts it in /usr/local/bin/pagekite.py, but something does not seem to think it belongs there... I should note that the default Pagekite script for Linux install does not work "as is" in Qnap: Code:
curl -s https://pagekite.net/pk/ |sudo bash I have to try another Qnap restart to see if pagekite.py sticks around before I go any further. ![]() [edit] sure enough, it wiped my pagekite install again... Any ideas? If not, I will check with Pagekite, but those folks in Iceland seem to be out in the thermal baths and the heat is affecting their response time, LoL. Last edited by MontyJ; 01-19-2017 at 02:58 PM. Reason: Follow up |
|
![]() |
![]() |
![]() |
#1418 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
My idea's:
1 - see if you still have python in the QNAP OS 2 - copy pagekite.py to the home directory of admin (on a NAS admin is something like root or even copy it in a /root directory) and then start PageKite from there. Don't bother with curl and or sudo, if you want to be root just ssh into your QNAP as root. Tomorrow I have planned a PageKite install on one of my old PC's running Debian Jessie Linux. Maybe then I will understand something more about PageKite. Remember it is winter in the northern hemisphere and Iceland is way north near the polar circle. If they are not cooking themselves in lava they are probably hibernating. |
![]() |
![]() |
![]() |
#1419 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46
Karma: 500000
Join Date: Dec 2011
Device: Kobo Libra 2
|
If you want something to survive a reboot on the QNAP it pretty much needs to be within a share - not in ./root. I have most system 'stuff' within the .qpkg folder. You will also need to read about how to use 'autorun' to run things at startup assuming you want pagekite.py to start automatically once you get this all sorted.
|
![]() |
![]() |
![]() |
#1420 | |
Addict
![]() Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
|
Quote:
![]() Tho in the end, it may not mean a lot to pagekite if their script is used. I will look for someplace on a share to put it that is in the run path. I know /share/Web is not. |
|
![]() |
![]() |
![]() |
#1421 | |
Addict
![]() Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
|
Quote:
However, I it asks for a password when connecting via ssh as user 'root' and I haven't a clue. There is no user root, so I am not sure if making one and assigning him to the administrators group would really work. The usual 'admin' or 'root' passwords don't work of course. Thanks! |
|
![]() |
![]() |
![]() |
#1422 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46
Karma: 500000
Join Date: Dec 2011
Device: Kobo Libra 2
|
Quote:
Sorry I can't be much help but I have only had my QNAP a few months and am still getting my head around how it does things. Very different to my old readynas. |
|
![]() |
![]() |
![]() |
#1423 | |
Addict
![]() Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
|
Quote:
What I have done after a little experimenting is put pagekite.py into the Code:
/share/Web Since qnap blows away all the stuff in / and /root, and python has no set search path to the Web folder, I modify the pagekite.py startup by: Code:
python pagekite.py --optfile=/share/Web/pagekite.rc mydomain.pagekite.me It may be because python need a new path added to the /share/Web folder, but I really don't know. I looked at the instructions to modify qnap python's SET PATH but it is over my head. Coincidence! I had a ReadyNAS Duo V2 but it didn't have the chops to run COPS or Pagekite from what I read, so bought this TS-251 as a platform really to do just that, along with backup of course. Sold my ReadyNAS. So yea, the learning curve continues. Well time to call it quits here. |
|
![]() |
![]() |
![]() |
#1424 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
@MontyJ
If you get a "familiar" ![]() ![]() 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 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 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> 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> The unexpected error kept me baffled for a while as well. ![]() |
![]() |
![]() |
![]() |
#1425 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
Quote:
![]() I know a little about linux (Debian) and a little about a Synology NAS but QNAP seems to do a lot of thing is a slightly different way from all the others. That's interesting, but sometimes also frustrating. I can give an advise that sounds good to me (linux) but can have very adverse effects for MontyJ's QNAP. I just hope that in the end we will get there. ![]() |
|
![]() |
![]() |
![]() |
Tags |
calibre opds, dns, kobo aura, synology |
|
![]() |
||||
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 |