This is a discussion on Phantom directories? within the Linux General forums, part of the Linux Forums category; I'm an old (since the mid-'80s) *ix person, and I thought I knew just about everything about its ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I'm an old (since the mid-'80s) *ix person, and I thought I knew just
about everything about its directory structure and rules...but I guess not. This is a bit difficult to explain, so please bear with me. .. When I access my domain (let's call it mydomain.com) via FTP, I'm in "/u179/my_user_name"; this is my root directory and I cannot "cd .." back a level; in a browser's address box, this directory is reflected as "www.mydomain.com" .. When checking my Urchin reports, I found references to a directory named "/icons"; when I went to it via my browser, it displayed a list of, you guessed it!, icon files. In the browser's address box, it shows that I'm in "www.mydomain.com/icons". There's also a subdirectory named "small"; when in it, my browser shows "www.mydomain.com/icons/small" .. Back at my FTP command line, "ls -al" shows no directory named "/icons", nor can I "cd" into it .. In my root directory I can "mkdir icons"; "pwd" shows that I'm in "/u179/my_user_name/icons" .. Back in my browser, pointing to "mydomain.com/icons" still brings up the list of icon files--NOT the new, empty directory I just created .. I can "rmdir icons" with no effect on the aforementioned directory that appears from within a browser So, my question is...WTF?! What am I missing? -- FREE "Bushisms" screensavers: www.smartassproducts.com/downloads.shtml Hillary Clinton 2008 merchandise: www.cafepress.com/saproducts/228355 Bush or chimp?: www.bushorchimp.com/pics.html Dogs hate Bu$h, too: www.dogshatebush.com |
|
|||
|
In comp.os.linux.misc ScrubsFan <nospam@bogus.fake.com>:
[..] > . Back in my browser, pointing to "mydomain.com/icons" still brings up > the list of icon files--NOT the new, empty directory I just created > . I can "rmdir icons" with no effect on the aforementioned directory > that appears from within a browser > So, my question is...WTF?! What am I missing? Try the apache docu, presuming this is what powers the http server, /icons should be just some alias/etc directive in httpd.conf, pointing to somewhere outside your document directory in the chroot ftp environment. -- Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94) mail: echo zvpunry@urvzvat.qr | perl -pe 'y/a-z/n-za-m/' #bofh excuse 128: Power Company having EMP problems with their reactor |
|
|||
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 ScrubsFan wrote: > I'm an old (since the mid-'80s) *ix person, and I thought I knew just > about everything about its directory structure and rules...but I guess > not. This is a bit difficult to explain, so please bear with me. > > . When I access my domain (let's call it mydomain.com) via FTP, I'm in > "/u179/my_user_name"; this is my root directory and I cannot "cd .." > back a level; in a browser's address box, this directory is reflected as > "www.mydomain.com" > > . When checking my Urchin reports, I found references to a directory > named "/icons"; when I went to it via my browser, it displayed a list > of, you guessed it!, icon files. In the browser's address box, it shows > that I'm in "www.mydomain.com/icons". There's also a subdirectory named > "small"; when in it, my browser shows "www.mydomain.com/icons/small" > > . Back at my FTP command line, "ls -al" shows no directory named > "/icons", nor can I "cd" into it > > . In my root directory I can "mkdir icons"; "pwd" shows that I'm in > "/u179/my_user_name/icons" > > . Back in my browser, pointing to "mydomain.com/icons" still brings up > the list of icon files--NOT the new, empty directory I just created > > . I can "rmdir icons" with no effect on the aforementioned directory > that appears from within a browser > > So, my question is...WTF?! What am I missing? You are missing the fact that a URL is not a file path. It is a mapping to a path (or set of paths) performed and managed by the web server. The web server, through logic of it's own, can map URLs to different points in the directory tree, or to different paths on other directory trees, or even to non-existant ('phantom') files and directories. Assuming that you are running Apache, you'll find that there is a config file that tells apache which directory tree directory matches the base url. This is the base of the directory tree you traverse when you go to http://host/<some_path>, with http://host/ corresponding to the base of the directory tree. Now, the Apache config permits 'personal' web space. If the incoming URL is http://host/~<some_user_name>/<some_path> then it will search a /different/ directory tree for the <some_path> portion of the URL. This /different/ tree is specified in the Apache config file, in a way that the tree can be different for each user (i.e. http://host/~lew_pitcher/ maps to /home/lew_pitcher/www/ while http://host/~ScrubsFan/ maps to /home/ScrubsFan/www/ ) That's for the web URL. When you talk FTP, you talk to a different server with a different view of the directory tree. The FTP server can be (and usually is) configured such that anonymous access (which is the sort that the ftp:// url defaults to) is rooted in a /different/ directory tree than anonymous web access. And the FTP server maps logged in users to other trees as well (usually to the full directory tree of the server, but this isn't always the case). Thus ftp://host/pub/ and http://host/pub/ can be two different directories. And ftp://user:password@host/pub/ can be a different directory from either of the other two. All the mapping between virtual directory (the one named in the URL) and the real directory is done by the servicing applications. - -- Lew Pitcher, IT Specialist, Enterprise Data Systems Enterprise Technology Solutions, TD Bank Financial Group (Opinions expressed here are my own, not my employer's) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (MingW32) iD8DBQFCHNFuagVFX4UWr64RAqL5AJ4wDFCTMtvyzK4yJD66Nl NlXGCaWwCfcDPh Ql95ryec3hINm8r9H6pwpOk= =pWLq -----END PGP SIGNATURE----- |
|
|||
|
Your HTTP server and FTP server are configured differently. While it may be
confusing, presumably there's a reason. If not, change the configurations to be more similar. To clarify, the address in the browser location box indicates the request made to the server (and the protocol used). The server then translates the request into some file path. The location listed in the browser location bar has no correlation (well, need not have any) to the file name or path. For example, using Apache, the Rewrite and Alias directives (mod_rewrite and mod_alias) can, and generally do, perform various manipulations of the path portion of the URL before it's mapped to the filesystem. Hypothetically, your FTP server can do the same thing (but often they do little more than jail you to a particular subdirectory and otherwise not modify the underlying filesystem layout). ScrubsFan wrote: > I'm an old (since the mid-'80s) *ix person, and I thought I knew just > about everything about its directory structure and rules...but I guess > not. This is a bit difficult to explain, so please bear with me. > > . When I access my domain (let's call it mydomain.com) via FTP, I'm in > "/u179/my_user_name"; this is my root directory and I cannot "cd .." > back a level; in a browser's address box, this directory is reflected as > "www.mydomain.com" > > . When checking my Urchin reports, I found references to a directory > named "/icons"; when I went to it via my browser, it displayed a list > of, you guessed it!, icon files. In the browser's address box, it shows > that I'm in "www.mydomain.com/icons". There's also a subdirectory named > "small"; when in it, my browser shows "www.mydomain.com/icons/small" > > . Back at my FTP command line, "ls -al" shows no directory named > "/icons", nor can I "cd" into it > > . In my root directory I can "mkdir icons"; "pwd" shows that I'm in > "/u179/my_user_name/icons" > > . Back in my browser, pointing to "mydomain.com/icons" still brings up > the list of icon files--NOT the new, empty directory I just created > > . I can "rmdir icons" with no effect on the aforementioned directory > that appears from within a browser > > So, my question is...WTF?! What am I missing? > -- Remove '.nospam' from e-mail address to reply by e-mail |
|
|||
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 Michael Heiming skribis: > In comp.os.linux.misc ScrubsFan <nospam@bogus.fake.com>: > [..] >>. Back in my browser, pointing to "mydomain.com/icons" still brings up >>the list of icon files--NOT the new, empty directory I just created > >>. I can "rmdir icons" with no effect on the aforementioned directory >>that appears from within a browser > >>So, my question is...WTF?! What am I missing? > > > Try the apache docu, presuming this is what powers the http > server, /icons should be just some alias/etc directive in > httpd.conf, pointing to somewhere outside your document > directory in the chroot ftp environment. > - From httpd.conf: # Aliases: Add here as many aliases as you need (with no limit). The format is # Alias fakename realname # # Note that if you include a trailing / on fakename then the server will # require it to be present in the URL. So "/icons" isn't aliased in this # example, only "/icons/". If the fakename is slash-terminated, then the # realname must also be slash terminated, and if the fakename omits the # trailing slash, the realname must also omit it. # # We include the /icons/ alias for FancyIndexed directory listings. If you # do not use FancyIndexing, you may comment this out. # Alias /icons/ "/var/www/icons/" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFCHSpZx5xiAc+zp3URAqMtAKC4SxUP7//Pj0DX5gU3VWAxDBPRpgCfWVWH N+P7E2xN5bffUuBaVesEc9w= =uZc8 -----END PGP SIGNATURE----- |