I want to connect a virtual SMB drive to a Linux server to let peoples save their files/data in a "cloud". To do this, i'm using wordpress, and now what i have to do is to let the apache User write on the shared drive.

Here is my /etc/fstab :

\\SSAV02\intranet$ /mnt/intranet/uploads    cifs    username=ApacheSLINUX01,password=*********,_netdev,file_mode=0777,dir_mode=0777,uid=48,gid=48 0 0

i've put uid and gid to 48, like the apache users to let him write on the mounted drive.

I've too made a symbolic link to this directory on the wordpress document root, to get on thers by getting to /uploads.

The wp_config is already managed, i've put the UPLOADS variables, and when i put another directory on this variable, it' work. But not with the symbolic link.

ls of my wordpress :

total 180
-rw-r--r--.  1 apache apache   418 Sep 25  2013 index.php
-rw-r--r--.  1 apache apache 19930 Mar 18 01:01 license.txt
-rw-r--r--.  1 apache apache  9027 Mar 18 01:01 readme.html
lrwxrwxrwx.  1 apache apache    22 Apr  1 15:32 uploads -> /mnt/intranet/uploads/
-rw-r--r--.  1 apache apache  5035 Oct  6 23:56 wp-activate.php
drwxr-xr-x. 10 apache apache  4096 Apr  1 09:23 wp-admin
-rw-r--r--.  1 apache apache   271 Jan  8  2012 wp-blog-header.php
-rw-r--r--.  1 apache apache  1369 Oct  3 16:47 wp-comments-post.php
-rw-rw-rw-.  1 apache apache  3884 Apr  1 15:57 wp-config.php
-rw-r--r--.  1 apache apache  3369 Mar 18 01:01 wp-config-sample.php
drwxr-xr-x.  8 apache apache  4096 Apr  1 15:03 wp-content
-rw-r--r--.  1 apache apache  3286 May 24  2015 wp-cron.php
drwxr-xr-x. 16 apache apache  4096 Mar 18 01:01 wp-includes
-rw-r--r--.  1 apache apache  2380 Oct 25  2013 wp-links-opml.php
-rw-r--r--.  1 apache apache  3316 Nov  6 00:59 wp-load.php
-rw-r--r--.  1 apache apache 33770 Dec 21 04:30 wp-login.php
-rw-r--r--.  1 apache apache  7887 Oct  6 16:07 wp-mail.php
-rw-r--r--.  1 apache apache 13021 Nov 20 08:24 wp-settings.php
-rw-r--r--.  1 apache apache 28594 Oct 30 09:52 wp-signup.php
-rw-r--r--.  1 apache apache  4035 Nov 30  2014 wp-trackback.php
-rw-r--r--.  1 apache apache  3061 Oct  3 00:46 xmlrpc.php

ls of the mounted drive :

root@SLINUX01:[/var/www/vhosts/intranet/html]$ll /mnt/intranet/
total 0
drwxrwxrwx. 1 apache apache 0 Apr  1 15:20 uploads

What can i do to enable is the right to write on the drive ? Normally, he could because on each side of the referenced drive, there is a umask of 777 and the user is apache.


Ok, so like kaiser suggested, i've tried to use a symlinks on another directory in the same system and i encounter some problem. So the problem is about my apache configuration, who don't want to follow symlink.

But it's problematic because i've added the followSymlink Option in the directory so normally, he had to work.

So i opened a new question, please go there to have an answer : Apache won't follow Symlink to have an upload path elsewhere than in document root

  • Have you tried mounting to some different real folder on the disk and then symlinking those?
    – kaiser
    Apr 5, 2016 at 20:11
  • Yes i've tried for another directory, and in the 5 second, the cron created some file for buddydrive (plugin that i've installed). Not sure i've tried for normal directory with symlink, i'll try tomorrow at work, please keep in touch, i'll take you abreast Apr 5, 2016 at 20:14
  • What do you mean with that cron?
    – kaiser
    Apr 5, 2016 at 20:19
  • The WordPress cron. With buddydrive, there is a function that create directory is they not exist in the upload path every 5 second, so i have fast a answer about if it worked or not Apr 5, 2016 at 20:21
  • 1
    Nicolas, please use edits to the question instead of answers for further progress. I do not delete the old one, so you can copy/paste that over. Please do so yourself after you are done. Also, I asked to move the other question over to ServerFault. Just FYI.
    – kaiser
    Apr 6, 2016 at 11:43


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.