2

Piwigo gallery, on apache and php, CentOS 6.

The root system is a RAID 128GB. /var/www/html is on the root file system.

Mounted the 320GB hdd to /var/www/html/320 using defaults, it's an ext4 fs.

Put a symlink to it in /var/www/html/galleries which is read by the gallery script so I can upload images to there, then click sync. It gives me the error:

[./galleries/] PWG-ERROR-NO-FS (File/directory read error) PWG-ERROR-NO-FS: The file or directory cannot be accessed (either it does not exist or the access is denied)

chmod 777 set on /dev/sdb1, /var/www/html, and /var/www/html/320 as well as the symlink galleries too. All recursive.

chown apache:apache to everything too.

PHP just can't read/write to it. I tried with and without the symlink, I've tried everything I can think of. Nothing.

Any ideas how I can give apache/php permission to read/write to this drive? With 777 permissions all around it should already be able to.

2
  • Well, since you broke everything by using chmod 777 you should probably just start over and reinstall your web app. Anyway you should check your error logs to find any actual errors. Commented Jun 9, 2014 at 21:52
  • No errors in logs and nothing is broken if the files are in ./galleries on the main hdd and not the mounted one.
    – Dan
    Commented Jun 9, 2014 at 21:55

1 Answer 1

1

CentOS has a special kind of security on his kernel (SELinux), you should try disabling it first.

Check if it's enabled with this command:

#sestatus

It should show enabled

Disable it editing this file:

nano /etc/selinux/config

and change this:

SELINUX=enabled

to:

SELINUX=disabled

And try again...

Good luck...

3
  • You got it! Thanks so much. Been at it for 3 days, tried everything I could think of. Now setting everything back to the way it was before all this problem-solving.
    – Dan
    Commented Jun 10, 2014 at 15:32
  • No problem, you can also set it up to permissive and give SELinux a more personal configuration...
    – Alonimus
    Commented Jun 10, 2014 at 18:02
  • you could relabel the dir where the gallery is to have a proper selinux context to serve web files: (as root) chcon -Rv --type=httpd_sys_content_t /path/to/dir and re-enable selinux. This is a nice howto: wiki.centos.org/HowTos/SELinux Commented Jun 11, 2014 at 8:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .