0

This is on CentOS 7
I have a Windows share mapped under /mnt/t
The folder /mnt/t is symbolically linked to /var/www/html/users.
When logged as root, I have no issue accessing the shared folder and all subfolders from the /var/www/html/user link
I have an index.html file in the root of the windows share at /mnt/t/index.html.
Apache properly shows the index.html file, so I know it can access the Windows share (that did not work outright and required editing httpd.conf).
Apache does not let me access any of the folders on the Windows share below the top with a "Forbidden You don't have permission to access ..." error message.
The error log says "Symbolic link not allowed or link target not accessible: /var/www/html/users"
The Windows account that I use to access the Windows share has a username of "linux".
I cannot understand why Windows would let Apache (or user "linux") see files in the top directory but not lower. The Windows server has no more restrictions for folders than for files.
I have tried many things found on this and other forums with no luck. Most are in the httpd.conf file displayed below.
Any suggestion appreciated.

Response to questions: Apache runs as UID 48. This is the UID I use to map the Windows share:

\\FWB-FILE-V01\Public /mnt/t cifs ip=10.168.1.32,user, uid=48,rw,suid,iocharset=utf8,credentials=/root/.smbcredentials 0 0

I have asked the Windows sysadmin for info, I will post his answer.

Here is httpd.conf (stripped of comments):

ServerRoot "/etc/httpd"
Listen 10.168.101.35:80
Include conf.modules.d/*.conf
User apache
Group apache
ServerAdmin root@localhost
ServerName 10.168.101.35:80

<Directory />
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride none
    Require all denied
</Directory>

DocumentRoot "/var/www/html"

<Directory "/var/www">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride None
    # Allow open access:
    Require all granted
</Directory>

# Further relax access to the default document root:
<Directory "/var/www/html">
Options All
    AllowOverride None
    Order allow,deny
    Allow from All
Require all granted
</Directory>

<Directory "/var/www/html/users">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from All
    # Allow open access:
    Require all granted
</Directory>

<Directory "/var/www/html/users/*">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from All
    # Allow open access:
    Require all granted
</Directory>

<Directory "/mnt/t">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from All
    # Allow open access:
    Require all granted
</Directory>

<Directory "/mnt/t/users">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from All
    # Allow open access:
    Require all granted
</Directory>

Note: this is not the compete httpd.conf file, only the top part that has the changes I made. The rest of it has not been altered since installation. There are no virtual hosts on that machine.

The Windows shared folder does not contain any symbolic link.

When logged in as "linux", I can access all the files and folders in the shared drive. I cannot log in as "apache"...

Still no progress :( Any help appreciated!

As of 3/29, no new response and no new result from my end. I am getting desperate.
I tried a few things related to SE Linux without success. SE Linux is enabled, I have tried to disable it momentarily and it made no difference.

  • Share level permissions versus the file and folder level permissions. Check the Windows Server and ensure the Linux user has NTFS file and folder permissions to the shared folder. – Pimp Juice IT Mar 27 '18 at 16:29
  • What have you tried? What UID does Apache run under? Have you tried accessing the tree from a shell running as that user?  Please do not respond in comments; edit your question to make it clearer and more complete. – Scott Mar 27 '18 at 16:31
  • Give more info - at least post httpd.conf. And does the Windows shared folder contain symbolic links? – harrymc Mar 27 '18 at 17:04

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.