LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 08-20-2015, 04:27 PM   #1
kaplan71
Member
 
Registered: Nov 2003
Posts: 810

Rep: Reputation: 39
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>&nbsp;</td><td align="right">  - </td><td>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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.

Why would this occur, and how can I correct it?

Thanks.
 
Old 08-20-2015, 04:45 PM   #2
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
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: Reputation: 157Reputation: 157
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)...
 
Old 08-20-2015, 04:58 PM   #3
kaplan71
Member
 
Registered: Nov 2003
Posts: 810

Original Poster
Rep: Reputation: 39
Hello --

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
Thanks again for the help.
Attached Files
File Type: txt smb.conf.txt (10.7 KB, 10 views)
 
Old 08-23-2015, 02:39 AM   #4
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
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: Reputation: 157Reputation: 157
That helps a little bit, but I'm a little unclear...

1) Are the directories you are mounting being shared from Windows machines???

2) What Windows systems are you accessing the shares from (Win7, Win8/8.1)???

Here's a nice page from RedHat about mounting Windows shares...
https://access.redhat.com/solutions/448263
 
Old 08-31-2015, 09:20 AM   #5
kaplan71
Member
 
Registered: Nov 2003
Posts: 810

Original Poster
Rep: Reputation: 39
Hello --

My apologies for not replying sooner.

The directories in question are being shared from Windows 2008 servers.
 
Old 09-01-2015, 08:40 AM   #6
kaplan71
Member
 
Registered: Nov 2003
Posts: 810

Original Poster
Rep: Reputation: 39
Hello --

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?

Thanks.
 
Old 09-01-2015, 08:47 AM   #7
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: RHEL9.4
Posts: 735

Rep: Reputation: 154Reputation: 154
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
 
Old 09-01-2015, 08:57 AM   #8
kaplan71
Member
 
Registered: Nov 2003
Posts: 810

Original Poster
Rep: Reputation: 39
Hello --

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.
 
Old 09-01-2015, 11:57 AM   #9
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: RHEL9.4
Posts: 735

Rep: Reputation: 154Reputation: 154
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.

Hope you can getit sorted soon.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
hidden folders and files become viewable in home directory User247 Linux - Newbie 4 05-12-2015 10:49 AM
Samba Server Directory and printer is not accessible jitenderana Linux - Newbie 3 09-26-2011 07:25 AM
Can't list Samba directory contents from FreeBSD using smbclient baldwonder *BSD 0 08-26-2007 02:25 AM
Samba - home directory not accessible essdeeay Linux - General 2 03-31-2006 12:59 PM
Are the tape's contents viewable? dtournas Linux - General 2 04-30-2004 07:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration