[TriLUG] Apache sharing files out of a samba share
David McDowell
turnpike420 at gmail.com
Thu Jul 14 13:28:54 EDT 2005
We can list the files, we cannot open the files... in light of that, I
tried a different method (since responses are limited so far)
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.
Any other suggestions? This is so our files can be hosted on a smb
share (fileserver on separate machine) but be accessed by our
application running on Apache. Smb share perms are not in question...
they are unlimited rights in the sandbox with our sample files while
we test things.
thanks,
David McD
On 7/13/05, John Berninger <johnw at berningeronline.net> wrote:
> On Wed, 13 Jul 2005, David McDowell wrote:
>
> > I'm not sure I follow... here's more:
> >
> > http://www.example.com/viewfiles.php for example can list the files
> > from /mnt/mysharename b/c PHP can access the file system. The web
> > server has NO rights to /mnt/mysharename so the web URL for a file
> > can't be http://www.example.com/myfirstfile.pdf and it can't be
> > http://www.example.com/mnt/mysharename/myfirstfile.pdf. Those just
> > don't make sense. Does Apache need a directive that puts
> > /mnt/mysharename as a valid web directory, or an alias folder in
> > /var/www/html/ or some other method?
>
> PHP can list the dir, so PHP *should* be able to read the files.
>
> Build the viewfiles.php page so that the hyperlinks are pointing
> at things like getfile.php?file=myfirstfile.pdf and then have
> getfile.php do sanity checking (lots of sanity checking) and then just
> readfile($file).
>
> --
> John Berninger
>
> GPG Key ID: A8C1D45C
> Fingerprint: B1BB 90CB 5314 3113 CF22 66AE 822D 42A8 A8C1 D45C
>
> Ita erat quando hic adveni.
> --
> --
> 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