Recently, I have migrated to a self managed VPS and run a few WordPress websites. But what really confuses me how WordPress won't upload, modify files and folders without 777 permissions. I know a few things about Unix and I do know that giving any file/folder 777 is very, very dangerous but I can't help it since it just doesn't work without that permissions.
Other than giving 777 permissions to wp-content/ and all its sub directories and files, I also did chown apache:apache -R wp-content/
which gives the ownership to the user and group apache. Only then everything "works".
So, how do I make it work with the right permissions and user/group on a VPS? I have seen somewhere from a Google search that I need to add a few user into the same group. I do not understand how that works. I have also seen that I need to add FTP info in the wp-config.php file.
- I have created a ftp user with the username ftpuser and have vsftpd running. Why? Well, WordPress requires a FTP connection, it keeps prompting me for one.
- All the files and folders of wp-content/ are set to usergroup apache:apache with perms 777
- I have tried permissions 755, 775 for folders/directories and 664, 644 for files. It won't work
- OS I am running: Ubuntu Server, CentOS
That's all I can think of now, will update later on.
Thank you so much for you help.