0

Ubuntu Server 14.04.1 w/ LAMP and Webmin/proFTP (haven't really used webmin much; too much stuff flying around)

Issue: With my user as owner of /var/www/ I can ftp files to the server, but PHP cannot handle files without www-data as the owner.

I also tried: sudo adduser myUsername www-data sudo chown -R www-data:www-data /var/www/

This still did not allow my user to FTP upload to this directory; changing it back to sudo chown -R myUsername:myUsername /var/www/ allows for FTP again.

How can I setup permissions to able to use FTP and have PHP be able to handle files (cURL, fopen, exec, etc.)?

Caleb Pitman
  • 1,105
  • 1
  • 12
  • 24
  • A suggestion: you should strongly reconsider the pros and cons of allowing FTP access directly to www. Unless there is a specific technical reason for it, the negatives will almost always outweigh the positives in a production site. What will happen if you lose connection when an upload is only partially completed? What happens if your users access a larger file in the middle of an upload? In both cases your users will be served a broken file. You are better off uploading to another folder, then copying over to www. – Ken Herbert Nov 30 '14 at 22:01

2 Answers2

0

I don't think this is the correct site to ask this question.

However try:

usermod -a -G www-data yourUserName
MeetTitan
  • 3,383
  • 1
  • 13
  • 26
0

The folder permission was set to 755, and it should have been 775 (write for group).

Caleb Pitman
  • 1,105
  • 1
  • 12
  • 24