Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

How can I serve a directory of shared files?

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  <Directory cgi-bin> - Question  
Author Message
madams9

External


Since: Feb 09, 2004
Posts: 3



(Msg. 1) Posted: Mon Feb 09, 2004 6:29 am
Post subject: How can I serve a directory of shared files?
Archived from groups: alt>apache>configuration (more info?)

I've never done any html coding on a linux platform, but a little with
Windows -- no experience wiht Apache at all. I'm trying to put together
a homepage for my intranet that my kids can use. Server is Mandrake 9.2
with Apache 2.0.47. The other machines are either WinXP Pro or Win2K Pro.

I want to be able to load a file directory of my public share in an html
page. I can see the directory from any machine with
"file://adamsmdk/mnt/nt3/shared" in a browser address field from any
machine on the LAN (IE 6 or Netscape 7.1). But when I code this into an
html page:

<a href="file://adamsmdk/mnt/nt3/shared"><img
src="/icons/hrddrv.gif" name="Graphic2" align="left" width="32"
height="32" border="0">Access local file stores.</a>

I get nothing. The browser doesn't respond at all. I've diddled with
the tag trying everything I can think of from more slashes ("///") to
different permutations of the pathname.

When I code it <a href="http://adamsmdk/mnt/nt3/shared">... I get a 404
File not Found error.

Can anybody tell me where I'm going wrong here? Do I need to be looking
at some kind of ftp solution?

Thanks.
--
Mark E. Adams, 2004 -- drop the "dot" to email me.

CONSIDER: ===========---------,,,,,,,,,............. . . . . .

It's more than magnificent -- it's mediocre.
   -- Sam Goldwyn

=====================---------,,,,,,,,,............. . . . . .<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: How can I serve a directory of shared files? 
Back to top
Login to vote
anon9

External


Since: Feb 09, 2004
Posts: 3



(Msg. 2) Posted: Mon Feb 09, 2004 6:50 am
Post subject: Re: How can I serve a directory of shared files? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

you should have a slash at the end of the address. maybe you tried that, but
it's not in your example

ie: http://adamsmdk/mnt/nt3/shared/

also, instead of using the host name you should try and set the link with
the ip address
ie: http://192.168.0.1/mnt/nt3/shared/

confirm that the http:// address will work before putting it into an html
page as a link, then you know if the problem is the link or the address

 >> Stay informed about: How can I serve a directory of shared files? 
Back to top
Login to vote
nospam179

External


Since: Aug 20, 2003
Posts: 29



(Msg. 3) Posted: Mon Feb 09, 2004 10:29 am
Post subject: Re: How can I serve a directory of shared files? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Mark Adams wrote:

 > I've never done any html coding on a linux platform, but a little with
 > Windows -- no experience wiht Apache at all. I'm trying to put together
 > a homepage for my intranet that my kids can use. Server is Mandrake 9.2
 > with Apache 2.0.47. The other machines are either WinXP Pro or Win2K Pro.
 >
 > I want to be able to load a file directory of my public share in an html
 > page. I can see the directory from any machine with
 > "file://adamsmdk/mnt/nt3/shared" in a browser address field from any
 > machine on the LAN (IE 6 or Netscape 7.1). But when I code this into an
 > html page:
 >
 > <a href="file://adamsmdk/mnt/nt3/shared"><img
 > src="/icons/hrddrv.gif" name="Graphic2" align="left" width="32"
 > height="32" border="0">Access local file stores.</a>
 >
 > I get nothing. The browser doesn't respond at all. I've diddled with
 > the tag trying everything I can think of from more slashes ("///") to
 > different permutations of the pathname.
 >
 > When I code it <a href="http://adamsmdk/mnt/nt3/shared">... I get a 404
 > File not Found error.
 >
 > Can anybody tell me where I'm going wrong here? Do I need to be looking
 > at some kind of ftp solution?
 >
 > Thanks.

Remember that these paths are relative to your document root.
ie if Server <a style='text-decoration: underline;' href="http://www.Adams.com" target="_blank">http://www.Adams.com</a> is in reality /var/www/
then
<a style='text-decoration: underline;' href="http://www.Adams.com/adamsmdk/mnt/nt3/shared" target="_blank">http://www.Adams.com/adamsmdk/mnt/nt3/shared</a> is actually

/var/www/adamsmdk/mnt/nt3/shared

And you code it like this: (bells and whistles removed for clarity)
Access local file stores.

also, make sure you set permissions properly.
chown apache:apache
chmod ugo=r *
set the directory itself to have perms of ug=rwx,o=rx
Eric

ps: I assume you are doing this in linux, if not, your on your own there,
cant help you with winders. Besides Windows really isnt a good platform for
apache. But we wont get into that.
Eric<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How can I serve a directory of shared files? 
Back to top
Login to vote
madams9

External


Since: Feb 09, 2004
Posts: 3



(Msg. 4) Posted: Mon Feb 09, 2004 6:13 pm
Post subject: Re: How can I serve a directory of shared files? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Eric. Thanks for the hand. See below.

Eric wrote:
 > Mark Adams wrote:
 >
 >
  >>I've never done any html coding on a linux platform, but a little with
  >>Windows -- no experience wiht Apache at all. I'm trying to put together
  >>a homepage for my intranet that my kids can use. Server is Mandrake 9.2
  >>with Apache 2.0.47. The other machines are either WinXP Pro or Win2K Pro.
  >>
  >>I want to be able to load a file directory of my public share in an html
  >>page. I can see the directory from any machine with
  >>"file://adamsmdk/mnt/nt3/shared" in a browser address field from any
  >>machine on the LAN (IE 6 or Netscape 7.1). But when I code this into an
  >>html page:
  >>
  >><a href="file://adamsmdk/mnt/nt3/shared"><img
  >> src="/icons/hrddrv.gif" name="Graphic2" align="left" width="32"
  >> height="32" border="0">Access local file stores.</a>
  >>
  >>I get nothing. The browser doesn't respond at all. I've diddled with
  >>the tag trying everything I can think of from more slashes ("///") to
  >>different permutations of the pathname.
  >>
  >>When I code it <a href="http://adamsmdk/mnt/nt3/shared">... I get a 404
  >>File not Found error.
  >>
  >>Can anybody tell me where I'm going wrong here? Do I need to be looking
  >>at some kind of ftp solution?
  >>
  >>Thanks.
 >
 >
 > Remember that these paths are relative to your document root.
 > ie if Server <a style='text-decoration: underline;' href="http://www.Adams.com" target="_blank">http://www.Adams.com</a> is in reality /var/www/
 > then
 > <a style='text-decoration: underline;' href="http://www.Adams.com/adamsmdk/mnt/nt3/shared" target="_blank">http://www.Adams.com/adamsmdk/mnt/nt3/shared</a> is actually
 >
 > /var/www/adamsmdk/mnt/nt3/shared
 >
 > And you code it like this: (bells and whistles removed for clarity)
 > Access local file stores.


Okay, I'm not sure I follow this. All my files are in directories under
/var/www. The directory I want to share is literally at mountpoint
/mnt/nt3/shared.

I tried coding it "<a href="adamsmdk/mnt...." but I still get the 404.

 > also, make sure you set permissions properly.
 > chown apache:apache

This CHOWN command is giving me a "too few arguments" error. I'm not
familiar with chown'ing anything but files and the TFM is not too
helpful here. What am I missing?

 > chmod ugo=r *
 > set the directory itself to have perms of ug=rwx,o=rx

Umm, which directory is that? The directory I'm trying to share is
setup as a public Samba share -- 0777.

Sorry for the cluelessness on my end, but I've never dealt with Apache
before.

Thanks.
--
Mark E. Adams, 2004 -- drop the "dot" to email me.

CONSIDER: ===========---------,,,,,,,,,............. . . . . .

I WILL NOT BURP IN CLASS
I WILL NOT BURP IN CLASS
I WILL NOT BURP IN CLASS
I WILL NOT BURP IN CLASS

  Bart Simpson on chalkboard in episode 7G04

=====================---------,,,,,,,,,............. . . . . .<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How can I serve a directory of shared files? 
Back to top
Login to vote
nospam179

External


Since: Aug 20, 2003
Posts: 29



(Msg. 5) Posted: Tue Feb 10, 2004 7:34 am
Post subject: Re: How can I serve a directory of shared files? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

OK, let me comment on things as they come up below.
First su to root, nothing below is possible unless you are logged in as root
su is how to get there temporarily if you are logged in as yourself.


Mark Adams wrote:

 > Hi Eric. Thanks for the hand. See below.
 >
 > Eric wrote:
  >> Mark Adams wrote:
  >>
  >>
   >>>I've never done any html coding on a linux platform, but a little with
   >>>Windows -- no experience wiht Apache at all. I'm trying to put together
   >>>a homepage for my intranet that my kids can use. Server is Mandrake 9.2
   >>>with Apache 2.0.47. The other machines are either WinXP Pro or Win2K Pro.
   >>>
   >>>I want to be able to load a file directory of my public share in an html
   >>>page. I can see the directory from any machine with
   >>>"file://adamsmdk/mnt/nt3/shared" in a browser address field from any
   >>>machine on the LAN (IE 6 or Netscape 7.1). But when I code this into an
   >>>html page:
   >>>
   >>><a href="file://adamsmdk/mnt/nt3/shared"><img
   >>> src="/icons/hrddrv.gif" name="Graphic2" align="left" width="32"
   >>> height="32" border="0">Access local file stores.</a>
   >>>
   >>>I get nothing. The browser doesn't respond at all. I've diddled with
   >>>the tag trying everything I can think of from more slashes ("///") to
   >>>different permutations of the pathname.
   >>>
   >>>When I code it <a href="http://adamsmdk/mnt/nt3/shared">... I get a 404
   >>>File not Found error.
   >>>
   >>>Can anybody tell me where I'm going wrong here? Do I need to be looking
   >>>at some kind of ftp solution?
   >>>
   >>>Thanks.
  >>
  >>
  >> Remember that these paths are relative to your document root.
  >> ie if Server <a style='text-decoration: underline;' href="http://www.Adams.com" target="_blank">http://www.Adams.com</a> is in reality /var/www/
  >> then
  >> <a style='text-decoration: underline;' href="http://www.Adams.com/adamsmdk/mnt/nt3/shared" target="_blank">http://www.Adams.com/adamsmdk/mnt/nt3/shared</a> is actually
  >>
  >> /var/www/adamsmdk/mnt/nt3/shared
  >>
  >> And you code it like this: (bells and whistles removed for clarity)
  >> Access local file stores.
 >
 >
 > Okay, I'm not sure I follow this. All my files are in directories under
 > /var/www. The directory I want to share is literally at mountpoint
 > /mnt/nt3/shared.
 >
 > I tried coding it "<a href="adamsmdk/mnt...." but I still get the 404.

The directory isnt accessable cuz its off of / and Apache cant get any
higher than /var/www so you cant use /mnt/nt3/shared
Solution: make directories /var/www/mnt/nt3/shared
and copy the files from /mnt/nt3/shared to there then in reality
/var/www/mnt/nt3/shared will be your shared dir and people will access
it with this link: (put this link in your web page)

Download local file stores.

Note there is NO leading /
Apache will translate this to <Document Root>/mnt/nt3/shared
and since your <Document Root> is actually /var/www the end result is
/var/www/mnt/nt3/shared

Uploading is entirely different if you intend to let apache users upload
stuff you need some special stuff in your web page and a script.

OK on that one?


 >
  >> also, make sure you set permissions properly.
  >> chown apache:apache
 >
 > This CHOWN command is giving me a "too few arguments" error. I'm not
 > familiar with chown'ing anything but files and the TFM is not too
 > helpful here. What am I missing?

Just as well, you were headed down the wrong road anyway. But what you
missed was the trailing filename
ie: chown apache:apache myfile.txt
ie: chown -R apache:apache /var/www/*
check out man chown
everything (or nearly everything) in linux has a help file
use man (a command that actually means manual) to look at help files
man chown
man chmod
man man
etc etc
Get real familiar with man, its one of your best friends.

OK, back to our job...

First make the dirs i mentioned above
Then:
chown -R apache:apache /var/www/*

chmod ugo=r /var/www/mnt/*
chmod ugo=r /var/www/mnt/nt3/*
chmod ugo=r /var/www/mnt/nt3/shared/*
chmod ug=rwx,o=rx /var/www/mnt
chmod ug=rwx,o=rx /var/www/mnt/nt3
chmod ug=rwx,o=rx /var/www/mnt/nt3/shared
Now everyone has read only access to the files there
(Note: dont "chmod -r ugo=r /var/www/*" as that will also
change permissions on the directories themselves and screw things up)


OK, now to share the dir with samba
edit /etc/samba/smb.conf
at the bottom add this: (ShareName is whatever you want it to be called
when other computers look for it)

[ShareName]
comment = shared stuff
path = /var/www/mnt/nt3/shared
public = yes
guest ok = yes
writable = no
printable = no
create mask = 0755

Then save it and run this
samba restart
apachectl restart

Let me know how you make out
Eric
ps: i can be reached directly via
hmm, how do i munge this to make it safe...
remove nosp and and dots before the at sign
also at is @
e.r.bent..onatcomcast.net


 >
  >> chmod ugo=r *
  >> set the directory itself to have perms of ug=rwx,o=rx
 >
 > Umm, which directory is that? The directory I'm trying to share is
 > setup as a public Samba share -- 0777.
 >
 > Sorry for the cluelessness on my end, but I've never dealt with Apache
 > before.
 >
 > Thanks.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How can I serve a directory of shared files? 
Back to top
Login to vote
madams9

External


Since: Feb 09, 2004
Posts: 3



(Msg. 6) Posted: Tue Feb 10, 2004 8:47 am
Post subject: Re: How can I serve a directory of shared files? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Eric wrote:
 > OK, let me comment on things as they come up below.
 > First su to root, nothing below is possible unless you are logged in as root
 > su is how to get there temporarily if you are logged in as yourself.

Yup, I'm doing it all as root.

 >
 > The directory isnt accessable cuz its off of / and Apache cant get any
 > higher than /var/www so you cant use /mnt/nt3/shared
 > Solution: make directories /var/www/mnt/nt3/shared
 > and copy the files from /mnt/nt3/shared to there then in reality
 > /var/www/mnt/nt3/shared will be your shared dir and people will access
 > it with this link: (put this link in your web page)
 >
 > Download local file stores.
 >
 > Note there is NO leading /
 > Apache will translate this to <Document Root>/mnt/nt3/shared
 > and since your <Document Root> is actually /var/www the end result is
 > /var/www/mnt/nt3/shared
 >
 > Uploading is entirely different if you intend to let apache users upload
 > stuff you need some special stuff in your web page and a script.
 >
 > OK on that one?

I understand, but the fact that I can't offer the files in that Samba
share directly makes this a much less attractive option. I don't want
to provide the gigabyte or so of space it would take to duplicate the
file share, and it would make managing the files in that share
(mirroring?) a hassle.

It seems I might be better off figuring out how to get a link coded to
logon FTP and allow file transfers that way.

I appreciate all the help on this Eric. You obviously know what you are
doing. I on the other hand seem to be barking up the wrong tree. It
seems what I want to do would be much easier and more efficient if I did
it some other way, possibly via <a style='text-decoration: underline;' href="http://ftp." target="_blank">ftp.</a>

Or maybe this is just WAY beyond the scope of my skills and shouldn't be
done at all.

--
Mark E. Adams, 2004 -- drop the "dot" to email me.

CONSIDER: ===========---------,,,,,,,,,............. . . . . .

Paradise is exactly like where you are right now ... only much, much better.
   -- Laurie Anderson

=====================---------,,,,,,,,,............. . . . . .<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How can I serve a directory of shared files? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Apache to serve files given by absolute filename - Hello Brief description: I want Apache not to prepend the server name to file names that are activated by clicking on the html anchor in a document. Detailed description: I have a document that contains anchors with HREF attribute pointing to a file...

See files in my directory - I have apache as web server but I would like to see the files in a directory. by exemple if I have http://192.168.1.105/~philippe/files/ I would like to see all directory in files in this folder but I can not how to configure apache to do it. please..

Viewing files in order of "last modified" in a directory - Hello, I am currently running Server version: Apache/2.0.44 and was wondering if there was some way in which the files in a directory appeared in the order of "last modified" without having to click the "last modified" column. than...

How can I ask Apache not to serve anything with 777 perms ? - Hello group: <font color=purple> ; </font> <font color=purple> ; While uploading PHP scripts to my hosting provider's server, I noticed </font> that if a certain PHP script had 777 permissions, it would cause a 'S...

Need apache to serve up MRTG web pages. - I am tring to tap Apache (httpd.conf) to serve up MRTG files. The Apache web server was installed and used by CiscoWorks2000. The thing is I can access the web pages fine when I'm logged into CiscoWorks, but when I'm not logged in it gives me 403..
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]