Need some help here with NFS. Here's what I have (all servers running CentOS 5.6 with SELinux): - Primary server with static IP. Varnish redirects requests to the web servers. - Web server 1 - Web server 2

The application residing on the web servers is running Drupal and I need both of them to share the same files directory. I have created a folder in called /var/nfs with root user. Here is my /etc/exports content:


On both the web servers (, I have it mounted like below:

[root@web2 ~]# mount
... on /mnt/nfs/var/nfs type nfs (rw,sync,hard,intr,addr=

On all the servers, I've added the user apache to the root group to get the desired write access:

[root@main ~]# cat /etc/group

[root@web1 ~]# cat /etc/group

Folder permission on main:

drwxrwxr-x  4 root root 4096 Mar 11 15:49 nfs

Folder permission on web servers:

drwxrwxrwx   3 apache apache  4096 Feb 18 13:51 mnt

Despite all this, when I try to write files into the /mnt/nfs/var/nfs folder from Drupal/PHP, it cannot write to it. I even tried with a simple PHP upload script but it doesn't work, so the problem is not with Drupal.

Any help you guys can do is much appreciated. I've spent hours and hours with it, without any success :(

Thanks in advance.


I've added the user apache to the root group to get the desired write access

But you've not shown us what the permissions are on the files / directories. (and BTW this is not a good idea from a security stand point - similar for no_root_squash).

Why sync?

| improve this answer | |
  • I've updated the question with the permissions. I know its not a good idea, but I've tried everything desperately! Syncing is needed because files will be uploaded in both web nodes - unless synced to a central place, the servers will not have each others file. – Mohammad Emran Hasan Mar 26 '12 at 13:36
  • 1
    This does look like a simple permissions issue - unless you've got syncronised uids across server and client then the simplest solution will be to make the directory on the server rwx for other. – symcbean Mar 26 '12 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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