0

I have a bash cgi script called by apache which should move one file in /var/www/html to another in the same directory. I've set up the relevant permissions with selinux (e.g. chcon to httpd_sys_content_t) and I've changed the read/write permissions of the files/dirs and yet it still returns the following in the httpd error logs:

mv: cannot move /var/www/html/file.txt to /var/www/html/file2.text: Permission denied

Any ideas? There's nothing relevant in the audit log either...

Edit:

ls -l on /var/www/html/ shows

-rwxrwxrwx. 1 apache apache  157 May 16 15:50 file.txt

ls -l on /var/www/ shows

drwxr-xr-x. 9 root root  4096 May 17 12:28 html
David Wadge
  • 149
  • 1
  • 7

1 Answers1

2

The file permissions for /var/www/html do not allow the apache user to manipulate the directory containing the file. You will need to allow apache write access to the /var/www/html directory.

user9517
  • 114,104
  • 20
  • 206
  • 289