Contents of Samba directory accessible but not viewable
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Contents of Samba directory accessible but not viewable
Hello --
I have Apache 2.2.23 running on a CentOS 5.3 server. The web server root directory, /var/www/html, has two folders that are Samba mounts. The contents of the two mounts, various folders containing Microsoft Excel 2007 files, are accessible and readable from the console of the local machine. This is done via the OpenOffice application.
However, when the same files are accessed via a web browser on a Window system, the files can be opened but the contents of the files are not shown.
As a test, I also created a text document in one of the shares, and the results were the same.
I checked the source code of a given webpage going to one of the mounts, and I have it listed below:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>Index of /UNIX_Server_Backups/UNIX/2015/August</title>
</head>
<body>
<h1>Index of /UNIX_Server_Backups/UNIX/2015/August</h1>
<table><tr><th><img src="/icons/blank.gif" alt="[ICO]"></th><th><a href="?C=N;O=D">Name</a></th><th><a href="?C=M;O=A">Last modified</a></th><th><a href="?C=S;O=A">Size</a></th><th><a href="?C=D;O=A">Description</a></th></tr><tr><th colspan="5"><hr></th></tr>
<tr><td valign="top"><img src="/icons/back.gif" alt="[DIR]"></td><td><a href="/UNIX_Server_Backups/UNIX/2015/">Parent Directory</a></td><td> </td><td align="right"> - </td><td> </td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="03aug2015.xls">03aug2015.xls</a></td><td align="right">07-Aug-2015 12:37 </td><td align="right"> 28K</td><td> </td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="10aug2015.xls">10aug2015.xls</a></td><td align="right">14-Aug-2015 07:42 </td><td align="right"> 28K</td><td> </td></tr>
<tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="Test.txt">Test.txt</a></td><td align="right">20-Aug-2015 16:03 </td><td align="right"> 24 </td><td> </td></tr>
<tr><th colspan="5"><hr></th></tr>
</table>
<address>Apache/2.2.23 (CentOS) Server at rorecovery.mgh.harvard.edu Port 80</address>
</body></html>
It appears the files in question, 03aug2015, 10aug2015, Test.txt, have relative paths rather than full paths.
Distribution: K/Ubuntu 18.04-14.04, Scientific Linux 6.3-6.4, Android-x86, Pretty much all distros at one point...
Posts: 1,802
Rep:
Find and print out the contents of your smb.conf... Feel free to redact anything you feel might compromise your system (but let us know you've done that)...
Thank-you for your reply. Per your request, the smb.conf file has been attached to this posting. I have gone through the file, and there is nothing that needed to be redacted from view.
Also, to clarify my earlier posting: The mounts in question are shares originating from a Windows server. They are mounted via two commands within the /etc/rc.local file. The redacted text of the commands in question are the following:
Quote:
mount -t cifs -o credentials=/<directory>/<file> '//<windows server ip address>/<share$>/<folder name>' /var/www/html/UNIX_Server_Backups
mount -t cifs -o credentials=/<directory>/<file> '//<windows server ip address>/<share$>/<second folder name>' /var/www/html/Semi-Offsite_Archives
I had a follow-up to my posting. I downloaded a file from the Samba share, and its reported size was zero bytes, as opposed to the thirty-five kilobytes reported in the directory.
That would explain why the opened file appears blank. The question now is the following: Why would this occur, and how can it be corrected?
I am truly sorry I cannot be of specific help but may I pose a question. If served from server 2008, why do you want samba server and apache involved? Maybe it is easier sharing from alternatives like webdav that would be accessible from http.
My experience does not reach back to major version 5 but, is SElinux not at fault? Itmay be a simple permissions problem as well
I do not have control of the Windows 2008 servers; my access is limited to the shares in which I have read and write access. I did some preliminary reading on
webdav, and correct me if I am wrong, but if I go that route, I would need to copy the contents of the Windows shares to a directory on the local server. If that
is the case, that would not be an ideal option.
I did check the selinux settings on the server, and they are set to permissive. I could disable them entirely, and see if that makes a difference.
I will have a look out for webdav part. Bummer you need the files but don't have access to the server, that would make it easier, but leave permissive mode. No need to disable selinux. Many people recommend to set permissive or disable but i view permissive as absolute last resort if nothing else works.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.