Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 26th, 2007, 09:45 PM
shardy@vt.edu
Guest
 
Posts: n/a
Default Linking to file on NFS mounted drive

Hello,

I am trying to create a code repository for myself and am having
trouble linking to files. Basically, the web server computer has
drives from several other computers nfs mounted to it -- and I want to
link to a file (just a .C file) on one of the nfs mounted drives. I'm
an html novice and have tried:

<p><a href="/home/nfs_drive_mount_point/dir/script.C">script.C</a></p>

But the link comes up as:
http://www.hostname.com/home/nfs_dri...t/dir/script.C

I also tried using href="file:///..." and still had no luck.

I know it must be something stupid that I'm missing, but if someone
could shine some light on it, that would be great.

  #2  
Old July 26th, 2007, 10:25 PM
John Hosking
Guest
 
Posts: n/a
Default Re: Linking to file on NFS mounted drive

shardy@vt.edu wrote:
Quote:
I am trying to create a code repository for myself and am having
trouble linking to files. Basically, the web server computer has
drives from several other computers nfs mounted to it -- and I want to
link to a file (just a .C file) on one of the nfs mounted drives. I'm
an html novice and have tried:
>
<p><a href="/home/nfs_drive_mount_point/dir/script.C">script.C</a></p>
>
But the link comes up as:
http://www.hostname.com/home/nfs_dri...t/dir/script.C
As it should.
Quote:
>
I also tried using href="file:///..." and still had no luck.
Some browser versions limit this kind of access deliberately.
Quote:
I know it must be something stupid that I'm missing, but if someone
could shine some light on it, that would be great.
>
The problem is that a Web server sees files differently from the way the
OS sees them, (even when they are the exact same files).

What are you using, IIS? Let's take that example:

When you install Microsoft's IIS, it creates a file structure within the
OS (some flavor of Windows) for its own purposes. By default, it creates
(i.e., it asks the OS to create) C:\Inetpub\wwwroot, with some other
subdirectories in wwwroot. Meanwhile, within the site (IIS
administration) the admin can create a structure for resources to be
served. Subfolders in the site are created in the OS with the same name
(by default, anyway; I believe they can be different).

So for www.example.com, the server machine has some files, like
default.htm and contactus.asp, which are located on its C: drive
(remember, this is configurable) in C:\Inetpub\wwwroot. Some images for
default.htm might be in C:\Inetpub\wwwroot\images\.

The Internet visitor browses to http://www.example.com/, and sees the
home page, possibly shown as http://www.example.com/default.com. The
images for the page can be seen (using the browser's View Source) to
come from http://www.example.com/images/.

The Web service (here, IIS) can be configured to map real (OS)
directories to virtual (Web) directories. How one does this depends on
the service (IIS, Apache, etc.) and version thereof. See your admin ;-)

You'll need to tell your Web server to serve these resources somehow,
and adjust your links accordingly. It may not work out as neatly as you
wish. Also, it's been a while since I've done this sort of thing, so add
salt to taste. GL.

HTH.

--
John
  #3  
Old July 27th, 2007, 04:55 AM
shardy@vt.edu
Guest
 
Posts: n/a
Default Re: Linking to file on NFS mounted drive

Quote:
What are you using, IIS? Let's take that example:
Apache -- installed on RHEL.
Quote:
>
When you install Microsoft's IIS, it creates a file structure within the
OS (some flavor of Windows) for its own purposes. By default, it creates
(i.e., it asks the OS to create) C:\Inetpub\wwwroot, with some other
subdirectories in wwwroot. Meanwhile, within the site (IIS
administration) the admin can create a structure for resources to be
served. Subfolders in the site are created in the OS with the same name
(by default, anyway; I believe they can be different).
>
So forwww.example.com, the server machine has some files, like
default.htm and contactus.asp, which are located on its C: drive
(remember, this is configurable) in C:\Inetpub\wwwroot. Some images for
default.htm might be in C:\Inetpub\wwwroot\images\.
>
The Internet visitor browses tohttp://www.example.com/, and sees the
home page, possibly shown ashttp://www.example.com/default.com. The
images for the page can be seen (using the browser's View Source) to
come fromhttp://www.example.com/images/.
>
The Web service (here, IIS) can be configured to map real (OS)
directories to virtual (Web) directories. How one does this depends on
the service (IIS, Apache, etc.) and version thereof. See your admin ;-)
>
You'll need to tell your Web server to serve these resources somehow,
and adjust your links accordingly. It may not work out as neatly as you
wish. Also, it's been a while since I've done this sort of thing, so add
salt to taste. GL.
>
HTH.
>
--
John
I see what you are saying -- I suppose that the simplest solution
probably is just to create symlinks to the nfs mounted files in the
public_html directory, or hell, just symlink the nfs mount points
directly -- why the hell didn't I think of that before I wasted your
time with that question. Sorry about that, but thanks for the help.

  #4  
Old July 28th, 2007, 02:45 AM
Jonathan N. Little
Guest
 
Posts: n/a
Default Re: Linking to file on NFS mounted drive

shardy@vt.edu wrote:
Quote:
I see what you are saying -- I suppose that the simplest solution
probably is just to create symlinks to the nfs mounted files in the
public_html directory, or hell, just symlink the nfs mount points
directly -- why the hell didn't I think of that before I wasted your
time with that question. Sorry about that, but thanks for the help.
>
Sometimes one can be too close to a problem to see the simple answers.
And sometimes just asking get you to look at the problem a different
way. No time wasted if it solves your problem!

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles