• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue NGinx permissions denied when download files from PHP

Alexdb

New Pleskian
i have a Plesk: psa v12.5.30_build1205150826.19 os_Ubuntu 14.04

recently i made a big mistake and ran this command: chown -R 10003:1003 /
It set all my permissions to 10003 and myPlesk was broken. I repair it via ssh with plesk repair fs and launched an update of plesk via ssh.

But i have still some issue, when i triggers a download via PHP with this code:
$mm_type="application/octet-stream";
$file = '../uploads/files/' . $filename;
header("Cache-Control: public, must-revalidate");
header("Pragma: no-cache");
header("Content-Type: " . $mm_type);
header("Content-Length: " .filesize($filename));
header('Content-Disposition: attachment; filename="'.$filename.'"');
header("Content-Transfer-Encoding: binary\n");

ob_end_clean();

readfile($file);

my files are the size of 64kb so they should be 17MB. I investigated and found this error in "proxy_error_log':
2019/01/20 18:34:53 [crit] 28055#0: *17137 open() "/var/lib/nginx/proxy/3/10/0000000103" failed (13: Permission denied) while reading upstream, client: 80.XXX.XXX.XXX, server: mydomain.com, request: "GET /download.php?id=15 HTTP/1.1", upstream: "https://45.XXX.XXX.XXX:7081/download.php?id=15", host: "mydomain.com"

This permissions issue reapper, can you tell me whats the good permissions for /var/lib/nginx please? Or tell my how to set the rights permissions.
Thanks
 
drwx------ 7 nginx nginx 4096 Dec 4 13:40 nginx

./nginx:
drwx------ 7 nginx nginx 4096 Dec 4 13:40 .
drwxr-xr-x. 39 root root 4096 Dec 3 18:34 ..
drwx------ 2 nginx root 4096 Jan 20 20:31 body
drwx------ 9 nginx root 4096 Jan 4 16:57 fastcgi
drwx------ 12 nginx root 4096 Dec 7 13:54 proxy
drwx------ 2 nginx root 4096 Dec 2 15:07 scgi
drwx------ 2 nginx root 4096 Dec 2 15:07 uwsgi
 
thanks, that's what i have. But can you show me what you have in body and proxy please?

I think i solved my issue by ran this in body and proxy:
chown -R nginx:root *
because in body and proxy permissions were set to: root:root
 
Back
Top