Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I moved from managed VPS to unmanaged VPS few weeks ago and set it up as I could find guides on net. I've installed Kloxo as my webui for server management etc.

I have a problem with ownership permissions. Most of my websites are running Wordpress, and it is crucial for me to have apache permissions on those folders so WP can do updates and install plugins. But when I give apache ownership ftp breaks in a way that I can't write anything.

I found that groups are for this, and did add apache and ftp to the same group and chowned the folders, but without success. It gives me, or the 403 forbidden in some cases, or the ftp access but not the apache. I'm a bit confused on how to set things up :|

I was also trying to switch to suphp as it can solve some things hear (as I can read), but I have php 5.2.17 version which doesn't go along O_o

I would upgrade to php5.3 if I'm sure that would solve problems, but as my sites need to be live, I have almost no room for playing.

What are your suggestions? I need to have both ftp and php(apache) write permissions!

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You need to make sure you change the group of apache and FTP user to be for example new_group.

Then, you need to change the ownership and permissions of files/folders using the following commands:

$ sudo chgrp new_group -R /path/to/folder
$ sudo chmod g+rwx /path/to/folders
$ sudo chmod g+rw /path/to/files

Folders should be given x permission to be able to access them.

share|improve this answer
    
1) usermod -g new_group apache (remove apache from apache group) OR useradd -G new_group apache (add apache to a secondary group) 2) how do I allow apache to delete an FTP_user file and vice versa? Say in the case of a plugin that was created by ftp_user and updated by apache. –  Christopher Ickes Feb 28 '13 at 23:54

Your Answer

 
discard

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.