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?