Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a www-data that was automatically set up when I installed Apache. I have a ftpuser that I configured myself to use with ProFTPd. I use a MySQL database with users that use this user to log on.

The problem is that Apache with PHP is working as it should, but I cannot add files with FTP. I tried to do chmod 777, and it worked, but now Apache gave me a 500 internal error. I suppose chmod isn't the correct way to go. I deleted my folder and made a new one.

How can I give ftpuser permissions to read and write, while www-data should not loose its permissions. I don't have much experience with Linux command line.


share|improve this question
check /var/log/apache2/error.log for the specific error that is happening when apache reports a 500 – stew Jun 7 '12 at 13:33
up vote 1 down vote accepted

you could try changing the owner and group like this:

chown ftpuser:www-data

chmod 775

This will allow ftpuser and the group www-data (in which the user www-data resides) to read and write files in the directory and to change to this directory. Those commands do not affect it's subdirectories, you'll need the recursive switches for chown and chmod for that.

Don't use chmod 777. It's something you'll often find in forums and there's always a better way than giving permissions to everyone.

share|improve this answer
just as one shouldn't give everyone rights with 777, one shouldn't give the www-data user write access, as the www-data user write access unless it is specifically needed for some particular directory. The www-data user exists in order to have very few (write) privileges – stew Jun 7 '12 at 13:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.