[TriLUG] Apache sharing files out of a samba share

David McDowell turnpike420 at gmail.com
Fri Jul 15 11:23:29 EDT 2005


OK, this is *really* really weird.  We are still having an issue
opening "some" files through this sym link.  We have
/home/myuser/public_html/ and a sym link in there called doc.  doc
points to /mnt/mysharename.  So the web path is
http://www.myserver.com/~myuser/doc/.  The PHP file that reads the
directory to list the files is:
/home/myuser/public_html/readfilelist.php.  The PHP code reads the
directory "doc" using a for loop and generates HTML output to the
screen so a user can see the list of files in doc and puts a URL
around the filename which gives a web path to each file.  No problem.

Ok, so a web path to a file in doc is now:
http://www.myserver.com/~myuser/doc/myfile.bar.  A plain jane Word
doc, no form fillable stuff opens using that link just fine.  A Word
doc with form fillable is opened blank, and if saved to disk, is a 0
byte .doc file.  This goes BEYOND Word which is where the *really*
weird part comes in.  I can put a JPG in as
/mnt/mysharename/mypic.jpg, so the web path from the readfilelist.php
becomes: http://www.myserver.com/~myuser/doc/mypic.jpg.  However, this
fails to open due to error, and if we save it to disk, is a 0 byte
.jpg file.  The same thing happened with an MP3, it failed to open due
to an error, when saved to disk was a 0 byte .mp3 file.

All this, yet we can get PDF, they work fine.  We can get some Word
docs (the non form fillable) they work fine.  No jpgs, no mp3s, no
.xls either.  We tried the JPG and MP3 formats to make sure this
wasn't related soley to Word, and have found that it isn't just Word.

Errors for the Word doc in /var/log/messages:  
Jul 15 11:13:45 dev100s kernel: smb_open: //FDA-1572.doc open failed, result=-13
Jul 15 11:13:45 dev100s kernel: smb_open: //FDA-1572.doc open failed, result=-13
Jul 15 11:13:45 dev100s kernel: smb_readpage_sync: //FDA-1572.doc open
failed, error=-13

Errors for the Word doc in /var/log/httpd/error_log:
[Fri Jul 15 10:59:24 2005] [error] [client 192.168.1.105] File does not exist: /
var/www/html/favicon.ico
WTF is this thing thinking?

No errors appear for the 0 byte jpg or mp3.  We put a different jpg in
the /mnt/mysharename directory and it works.  The first original one
is working on another machine and my linux laptop, but not other
workstations.

my fstab entry is like such:
//win2kserver/mysharename        /mnt/mysharename        smbfs  
uid=apache,credentials=/path/to/credfile 0 0

here's what a file looks like in /mnt/mysharename:
-rwxr-xr-x    1 apache   root        51712 Jul 15 10:12 FDA-1572.doc


Sorry for the horribly long email... but I think I described everything!

Thanks,
David McD


On 7/14/05, David McDowell <turnpike420 at gmail.com> wrote:
> bravo Ian!  I need to make sure permissions and such are good, but
> this works, thanks.
> 
> Interesting behavior at the moment.  A plain jane Word doc will open
> fine.  A regular PDF will open fine, we haven't tried other file types
> yet.  However, a Word doc with form fillable fields in it... opens a
> blank doc.  We tried removing the IncludesNoExec in case that made
> some crazy difference due to the form fillable part of that particular
> Word doc, but it didn't.  Anyone seen this kind of behavior?  lol  :)
> I am getting the same behavior with a win client and a linux client
> using open office.
> 
> thanks,
> David
> 
> 
> On 7/14/05, Ian Kilgore <ian at trilug.org> wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> >
> >
> > David McDowell wrote:
> > | I put a sym link in the Apache directory, for example:
> > | /home/user/public_html/mysymlink
> > | points to /mnt/mysharename.
> > |
> > | PHP can also list the contents perfectly fine via the sym link, but
> > | Apache cannot and /var/log/httpd/error_log indicates "Symbolic link
> > | not allowed".  Well, I kinda expected PHP would work and Apache would
> > | throw an error like that, but I had to try.
> > |
> > Try adding FollowSymLinks to your apache conf for that dir.
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.2.5 (GNU/Linux)
> >
> > iD8DBQFC1qr7wsRpgTiXSOERAjGLAKCKsADY7DcF+dnx5hXTF2CIQPQOuACfUJ52
> > q8WpRGa9Ue5Vd/XXHT4phT4=
> > =4YSM
> > -----END PGP SIGNATURE-----
> > --
> > TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> > TriLUG Organizational FAQ  : http://trilug.org/faq/
> > TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> > TriLUG PGP Keyring         : http://trilug.org/~chrish/trilug.asc
> >
>



More information about the TriLUG mailing list