Quote:
Originally Posted by sortie
Both the directory and the files were created by the script as chmod 0777 for directory and chmod 0666 for the files.
Ok, maybe the domain directory in 711 and inherited.
But that would be an admin issue for most people.
Believe me, this is not a problem on all linux/unix servers because the admin has set the "real users" with permissions to delete and download from
user "nobody" or "nobody" automatically turns over ownership to real user.
I don't really know how they do it, but they do.
|
It's probably the differences between the user, and the user of the webserver, then. If you created the directory via FTP, and the script was writing files there before the directory was set 777, it will have problems writing files, there.
I agree that the domain directory should not be 711, it should be 755, but owned by the user; which still means that by default, the webserver (if not running as the user) will not be able to write there. Again, this is a security precaution to keep others on the virtualhost from messing with your shit.
Most larger virtualhosts use an SQL database as the back end for authentication and transparently set the uid/gid of the files when you upload them; they also have, or use SuExec policies so files will run as your user, with your user permissions. It's possible to even do this with CPanel, but nobody turns it on, since it's a performance hit as all PHP scripts now run as a CGI, rather than a builtin, and ho boy, do people bitch about tightened security.