Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 08 Sep 2000 22:13:07 -0500
From:      David Kelly <dkelly@hiwaay.net>
To:        Bentley Rhodes <bentley3@mediaone.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: query ... 
Message-ID:  <200009090313.WAA70446@nospam.hiwaay.net>
In-Reply-To: Message from Bentley Rhodes <bentley3@mediaone.net>  of "Fri, 08 Sep 2000 21:08:12 EDT." <39B98D7B.111BBACF@mediaone.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
Bentley Rhodes writes:
> second, where is the directory for APACHE kept ... so i can use host my
> web page

First lets mention that freebsd-chat isn't the right place for these 
questions. They belong on freebsd-questions where I have moved my reply. 
Than again, maybe it belongs on newbies.

If you are having that much trouble with apache then let me suggest 
kindly that you are not ready to let your FreeBSD system be exposed 
continuously to the internet. However, your FreeBSD system is a 
wonderful host to prototype web pages before uploading to your ISP's 
server.

If you have the apache port installed you'll find a directory with 
apache in its name in /var/db/pkg/. Nose around in the files contained 
therein and you'll see where the port installed apache.

/usr/local/www/data/ is probably the root of your apache's web 
directory.

> fourth:
> 
> i know that say. ...
>         [ ln -s /usr/whatever ]
> can be used to point to directories or files...and that
>         [ ln /usr/whatever/file(s) ]
> has to be used specifically for files (right?)....so besides that (if
> i'm right)...whats the difference in Linking?
> does a HARD LINK mean that i have that file on my computer?  instead of
> another users computer or area?  i guess i mean copying (cp ).....but
> that would be redundant.

The problem is that you are assuming that the filename is how the 
computer knows the difference between files. In the Unix tradition 
files are really tracked in the OS by number, not by name. The record 
telling the OS how to find the file contents is known as an inode. Try 
"ls -i" to see the inode numbers.

The filesystem is (good enough for this discussion) simply a linear 
array of inodes, which describe the files. No directories. No 
subdirectories. No filenames.

A directory is a file of names. With each name is an inode number
"linking" that name to an inode so mere humans (and software written by
mere humans) can find their file data. When you create a link with ln 
you simply write a new directory entry. No reason why one should be 
limited to one name per "file" (inode).

Having multiple "links" to a file turned out to be awfully useful but it
didn't work across filesystems. Each filesystem starts the inode
numbering all over again. So somebody invented "symbolic links" and the
other version became known as "hard links". Rather than reference by
inode number the symbolic link references by path. There are no means of
guaranteeing the path is any good. Or once its good that it stays good,
unlike a hard link.

When you create a hard link a counter is incremented in the inode. That 
counter is the number you see between the permissions and owner when 
you do "ls -l". Make a directory. "ls -ld dirname". You'll see it has 
two links. One is the "dot" directory inside. The other is the name you 
just created. And if you are observant you will notice the parent 
directory's inode count increased also as you just created a dot-dot 
directory linking one up inside the one you just created. "ls -i" again 
to see the actual numbers. Then start matching numbers to see what I'm 
saying.

When one deletes a file, the syscall is unlink(2). You'll notice the 
man page for rm(1) is also for unlink(1). When the last link to a file 
is removed the filesystem frees the inode and its space for reuse after 
the last process closes it.

> i know SOFT links redirect to the area or file...and if i [ cd .. ]
> from it , say as an FTP thing, someone could end up in my root
> directory.  so my theory is that if i make a hard link to a file...then
> basically, i still save space because the file is only like what...a
> couple of kilobytes, versus the real file?

You need to play with links more to understand what you wrote above. You
seem to be infering links could somehow bypass the permissions
mechanism. There are unsafe situations which could allow that, but not
as you are suggesting. You can make a symbolic/soft link to someplace
you are not allowed. But if you try to follow it you won't get anywhere.

> bottom line...can someone fess up whats the best?

Yes. The best is to have both to use as appropriate.


--
David Kelly N4HHE, dkelly@hiwaay.net
=====================================================================
The human mind ordinarily operates at only ten percent of its
capacity -- the rest is overhead for the operating system.




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200009090313.WAA70446>