• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Issue with PDF Files

Fabhino22Elz

Basic Pleskian
Hello,
i have a Problem with PDF Files on my Server.

The files are generated by my Shop System and they are available. I can download them thorugh Plesk and then open them on my Browser.

But if i want to open a file in plesk and klick on the pdf i geht the following error message on my screen attatched.

Also i cant open the file if i try to open it thorugh my shop. it always says 404, not found, even the shop is there.

I copied the whole Filesystem and run the system local and on a seperte server (withput centos / plesk) and all is working fine.

Any ideas what my Problem here is?
 

Attachments

  • Bildschirmfoto 2019-07-31 um 17.12.53.png
    Bildschirmfoto 2019-07-31 um 17.12.53.png
    100.4 KB · Views: 9
Hi, can you put plesk in english and then take screanshot to error.

In any case, are you try to see logs ?

I not see any reason to get 404 in plesk, maybe can happen if you have some symlink
 
You are trying to view a PDF file in the Plesk Filemanager. PDF files cannot be opened in the Filemanager, see this KB:
Which file types are supported for viewing/editing in Plesk domain File Manager?

Regarding your 404 error: This is something different. So either your shop creates an URL that does not correspond to the true location of the file or a mod_rewrite rule prevents access to it.

Things to investigate:
* Check the URL of the PDF as shown in your shop application
* Click on the URL and check your access_log (or access_ssl_log) and proxy_access_log (or proxy_access_ssl_log) files
* Verify if the path of the URL (everything after the first slash) is correct. Is the file location correct? Does the path in the URL exist on the server?
* Anything relevant in the error_log and proxy_error_log files?
* Do you have any rewrite rules in any .htaccess file? Check all directories in the path of the URL
* Any custom Apache or nginx rules?
* Can you access a file that you created manually in the folder where the PDF is supposed to be?
 
First - Thank you for your answers and your help!

You are trying to view a PDF file in the Plesk Filemanager. PDF files cannot be opened in the Filemanager, see this KB:
Which file types are supported for viewing/editing in Plesk domain File Manager?

Regarding your 404 error: This is something different. So either your shop creates an URL that does not correspond to the true location of the file or a mod_rewrite rule prevents access to it.

Things to investigate:
* Check the URL of the PDF as shown in your shop application
The URL is https://www.domain.de/backend/Order/openPdf?id=8b502f1847113be76d3876efc275e094 - As i mentioned before - i copied the whole filesystem to another server without plesk / centos and it worked. also it worked locally. On the Server i run my Shop on PHP7.2 FPM Served by Apache. Shops is running in a chrotted subscription.

* Click on the URL and check your access_log (or access_ssl_log) and proxy_access_log (or proxy_access_ssl_log) files
I cleared the access_log and the ssl_access_log in the chrooted subscrition, opend the file and looked at the file. Could not find anything in there. But you find it attatched to this answer,

* Verify if the path of the URL (everything after the first slash) is correct. Is the file location correct? Does the path in the URL exist on the server?
As i mentioned on Point 1 - It is working local and on another server - The Link 7 Route to the file is not exactly like the folder strcutre because it is processed on a generated link from the shop system (which works on local and another server without changing anything of my shop then the db connection settings)

* Anything relevant in the error_log and proxy_error_log files?
I attathced the log files from the chrooted subscription also to this post. I only see one error in the proxy_error log that points on my attemp to open the file:
2019/08/01 09:38:36 [error] 3628#0: *3084 open() "/var/www/vhosts/domain.de/live.domain.de/backend/Order/openPdf" failed (2: No such file or directory), client: 87.190.50.98, server: domain.de, request: "GET /backend/Order/openPdf?id=d24aff7aa3e8bbd98931e2816c00d6e2 HTTP/2.0", host: "www.domain.de", referrer: "https://www.domain.de/backend/"


* Do you have any rewrite rules in any .htaccess file? Check all directories in the path of the URL
Attatched you find the original htaccess File from the shop which has not been modified from its original and which is working as i mentioned local and on other server without any changes

* Any custom Apache or nginx rules?
No rules or something special set from me in nginx or apache as rewrite rules. Only stuff like leverage browser caching and gzip are activated server wide - but they are activated on the other server too^^

* Can you access a file that you created manually in the folder where the PDF is supposed to be?
If i open the URL on the direct way as you asked i can see and access the pdf file in the browser so "https://www.domainname.de/files/documents/0061799f6451d47c889d8e8350c015be.pdf" works

Can this be a Problem of the Apache FPM Mode or something?
 

Attachments

  • Logfiles.zip
    308.8 KB · Views: 7
Back
Top