Open stefanogithub opened 7 years ago
Are you trying to download in a browser like firefox or to an e-reader like a kobo?
hi marioscube, i'm trying to download in a browser
Do you have url_rewriting enabled in config_local.php? If 1 then set 0.
/*
* use URL rewriting for downloading of ebook in HTML catalog
* See Github wiki for more information
* 1 : enable
* 0 : disable
*/
$config['cops_use_url_rewriting'] = '0';
+1 for marios's answer. URL rewriting with latest DSM need some tweaking.
@seblucas may you share tweaking for latest DSM ?
I never done it myself, I just remember seeing one page about that. Still I don't remember DSM's version.
I never used COPS on DSM (except to test some installation) so I never had to look for answers ;)
I am getting a similar error (a 404) but mine looks like ….com/fetch.php?data=1396&type=epub&id=593
and I already have $config['cops_use_url_rewriting'] = "0"
set in config_local.php.
my cops install is in /volume1/web/cops/ and the calibre folder is at /volume1/web/Calibre/ and configcheck is happy. (DSM 6.2-23739 up=to=date)
Howdy !
Any update on this ?
YOS, Markus
Just when you start asking ...
I had a breakthrough. With this additional config for NGINX in /etc/nginx/conf.d/www.cops.conf :
location ~ ^/cops/download/ { rewrite ^/cops/download/(\d+)/(\d+)/..(.)$ /cops/fetch.php?data=$1&db=$2&type=$3 last; rewrite ^/cops/download/(\d+)/..(.)$ /cops/fetch.php?data=$1&type=$2 last; break; }
A call to ;
http://XXX.XXX.XXX.XXX/cops/download/
Will be translated to :
http://XXX.XXX.XXX.XXX/cops/fetch.php?id=
Which is exactly what I need.
... unlesss I start calling my library with the virtual hostname :
I added :
location ~ ^/download/ { rewrite ^/download/(\d+)/(\d+)/..(.)$ /fetch.php?data=$1&db=$2&type=$3 last; rewrite ^/download/(\d+)/..(.)$ /fetch.php?data=$1&type=$2 last; break; }
to the file mentioned above and called:
https://ebooks.domain/download/
but it results in an 404:
2020/05/26 18:05:12 [error] 1097#1097: 6021 open() "/volume1/web/cops/download/
I think, the second one is a subsequent error, which can be ignored. SSL config and domain resulution work like charm.
Any ideas ?
I'm a fellow user and I have COPS working the way I want it to, but ... I can't use Synology DSM 6 (my device only works with DSM 5) to help you test.
Just 1 or 2 questions:
Howdy !
I just yesterday download the latest cops 1.1.3.
$config['cops_use_url_rewriting'] = "1";
That is all I did to my cops config.
YOS, Markus
Do you need url_rewriting? What if you try without?
Can you check if mod_rewrite is enabled on your Synology?
I will try do do some tests with my old, old Synology (DS110j) with DSM 5.2 tomorrow.
I just confirmed what I suspected yesterday: I cannot reproduce your error with or without $config['cops_use_url_rewriting'] = "1";
But, I'm on DSM 5 not 6. It might make a difference. .......And I use Apache (httpd) and you NGINX. Another difference. However the creator of COPS uses (?) NGINX himself so it should just work.
Just a thought ..... what are the permissions on the library directories and the file inside it?
For testing set the relevant permissions in the calibre library to 777.
Hello marioscube, I appreciate your efforts, but I think, you're on the wrong track. As I wrote the URL rewrite works in general, but not when accessing the page via the reverse proxy. I think, it is somewhere there in the depths of the nginx configuration, where the magic needs to take place. YOS, Markus
Got it :
You need to find in /etc/nginx/app.d/server.webstation-vhost.conf your vhost and look for :
include /usr/local/etc/nginx/conf.d/<LARGE NUMBER/user.conf*;
Now copy the file /etc/nginx/conf.d/www.cops.conf I mentiond earlier to /usr/local/etc/nginx/conf.d/
Thanks for your patience !
Great!
As I use apache I will not be using your solution.
Nevermind a lot of deleted text. I forgot something on my new Debian setup..
Enjoy COPS (and the fine weather at leat over here ;-) )
Hi everybody. I'm running DMS 6.1.1-15101 Update 2 on a NAS-Synology. Installed COPS package 1.0.0RC2-3 from SynoCommunity. I'm able to browse all ebooks but i can't download ebooks. Downloading i get the following errror
2017/05/17 23:48:43 [error] 10040#10040: *210 open() "/var/services/web/cops/download/3/title.pdf" failed (2: No such file or directory), client: 192.168.1.101, server: , request: "GET /cops/download/3/A+40+anni+-+Sconosciuto.pdf HTTP/1.1", host: "nas-camker", referrer: "http://servername/cops/index.php?page=3&id=5" 2017/05/17 23:48:43 [error] 10040#10040: *212 open() "/var/services/web/missing" failed (2: No such file or directory), client: 192.168.1.101, server: , request: "GET /missing HTTP/1.1", host: "nas-camker", referrer: "http://servername/cops/download/3/titolo.pdf"
is a configuration problem ? (what's file have to configure? how?) is a permission problem ? is a php problem ? (i tried to find php .log on NAS-Synology but i was not able to find)Thanks in advance for any help or sugestions. Regards, Stefano