Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't download books with COPS, yet reading online is possible #515

Open
mwcem opened this issue Jul 28, 2022 · 13 comments
Open

Can't download books with COPS, yet reading online is possible #515

mwcem opened this issue Jul 28, 2022 · 13 comments

Comments

@mwcem
Copy link

mwcem commented Jul 28, 2022

Hi,
I installed COPS as a subdirectory of the folder web, and it starts alright, displaying all my books. Path of calibre-library is /volume1/books/calibre. Yet something must be wrong still as I cannot download a single book I have. But if I choose to read the book online in the browser it works alright - so where is my mistake?

You can try out here for yourselves: mwcem.synology.me/cops

Don't know what I'm doing wrong.

@marioscube
Copy link

Are you on a Synology?

@mwcem
Copy link
Author

mwcem commented Jul 28, 2022

Yes. DS418play, DSM 7.1

@marioscube
Copy link

marioscube commented Jul 28, 2022

Take a look at the Wiki.

Common steps number 2

Did this work?

@mwcem
Copy link
Author

mwcem commented Jul 28, 2022

Not really. My books are in /volume1/books/calibre together with calibre's metadata.db. This folder is included in the openbase_dir and also set in the config_local.php file.
So this should be alright, or am I missing something?

@marioscube
Copy link

Have you restarted the webserver?

Are the permissions of the calibre directory http:http?

@mwcem
Copy link
Author

mwcem commented Jul 28, 2022

Yes, all permissions granted. As you can see by the link I provided earlier, you can skip through the whole catalog. Even reading the books online is possible. The only thing not working is downloading the files - this always results in a classical 404-page.

@marioscube
Copy link

Ok (not OK).

Back to basic troubleshooting.

1 - http:///cops/checkconfig.php = OK?
2 - please post your config_local.php
3 - please post your open_basedir settings
4 - please post the permissions of /volume1/books/calibre and /volume1/books/calibre/metadata.db + a few books

I then can try to recreate your setup and see if I can reproduce your 404 error.

The only major problem is that I only have an obsolete version of a synology with DSM 5.2, but linux = linux I hope.

@mwcem
Copy link
Author

mwcem commented Jul 29, 2022

pic7
pic8
pic9
pic10
books.zip
Can't show you the rights of metadata.db at the moment as I'm not before my normal computer at home, but at work, where I can only connect via quickconnect. And DS-Filestation has the restriction, that it doesn't display the contents of a folder, when it has more than 100 subfolders, which is naturally the case when you got a rather broad library and calibre creates a folder for each author.

@marioscube
Copy link

marioscube commented Jul 29, 2022

Hmmmmm.....

I can reproduce your error 404.

1 - COPS seems to be installed OK and working
2 - PHP open_basedir is OK
3 - the calibre database is not the problem

The problem seems to be that either mod_rewrite is not installed or working or the .htaccess file in the COPS directory is not installed or not working.

On your Synology what is your webserver? NGINX or Apache2
If NGINX, I can't help you. I never understood it and gave up years ago. Maybe the wiki can give you some pointers.
If Apache2:

  • is there an .htaccess setting in a synology control panel? (Not in my version, but yours may be different)
  • is there a .htaccess file in the COPS directory (edit this file with a deliberate error, for example just put a 3 on an empty line. If COPS does not work the .htaccess file is read and we know more (then revert the edit). If there is no error the .htaccess file is not read and we should edit config files...... (don't really want to do that on a synology).

As a last resort you can always run COPS from a Docker container.

@mwcem
Copy link
Author

mwcem commented Jul 29, 2022

Trouble identified - and solved.
The Web Station had under "Standardserver" the NGINX as HTTP-Backend-Server. I changed ist to Apache 2.4, restarted the Web Station (and all it's dependent packages), and now it works just fine - thanks for helping in identifying the bad guy.
Perhaps you should stress this in the Wiki more promenently, that any NGINX is just a trouble-maker.
(The change to Apache 2.4 solved some troubles I had with other apps as well).

@mwcem
Copy link
Author

mwcem commented Jul 29, 2022

Maybe for clarification:
I had defined a webservice-portal for COPS with Apache 2.4, PHP 7.4 and a certain port, and web/cops as entry-point:
image
image
Therefor I assumed, that Apache was used, when I entered the COPS-Url. On Standardserver (80/443) NGINX was defined, which I know changed to Apache. So obviously I don't need to install special portals for web-applications as they are not used anyways. Don't know why I did it then - must have read somewhere that it's vital important, but propably it's just confusing and not useful at all.
Again thanks for pointing in the right direction.

@marioscube
Copy link

Great!
However it should also work with NGINX, but I do not know how.

I am not the developer of COPS, nor the maintainer of the WIKI. I am a (very) happy user of COPS since very early versions. So I know something about how to use and configure COPS on Apache2.
The developer of COPS seems to have gone on with his life (as is his right).

@marioscube
Copy link

Maybe as an additional point.

If you open your COPS to the WWW I would password protect it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants