1

When I set up a site on my server I set permissions to /var/www/ like so:

chown -R $USER:$USER var/www/

However, when I try and write to my image directory I get a permission denied error. The only way I have found is setting the permissions like this:

chown -Rf www-data.www-data /var/www/

So this fixes that problem, but creates another one. Now I cannot save any files to my server via ftp on my ide.

I'm a bit new to this and don't fully understand the difference between the two ways of setting permissions. Any help would be appreciated.

EDIT Not a dupe. I've done my research. This is not an issue about using sudo in /var/www. I'm getting permission denied errors when generating and trying to save images to a specific directory using GD Lib.

MP_Webby
  • 121
  • 5

1 Answers1

0

You need to set write_enable to be able to write files to your FTP server.

Open Terminal (Ctrl+Alt+T), and Type:

sudo nano /etc/vsftpd.conf

Change the line:

#write_enable=YES

To this:

write_enable=YES

Make sure you have:

chroot_local_user=YES

And add the following parameter:

allow_writeable_chroot=YES

Then, Restart:

sudo service vsftpd restart
Benny
  • 4,920