472,127 Members | 1,855 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

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.

Jul 26 '07 #1
3 3265
sh****@vt.edu wrote:
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.
>
I also tried using href="file:///..." and still had no luck.
Some browser versions limit this kind of access deliberately.
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
Jul 26 '07 #2
What are you using, IIS? Let's take that example:
Apache -- installed on RHEL.
>
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.

Jul 27 '07 #3
sh****@vt.edu wrote:
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
Jul 28 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by jayjay | last post: by
1 post views Thread by Daveyk0 | last post: by
6 posts views Thread by Kiran | last post: by
4 posts views Thread by Alan Samet | last post: by
1 post views Thread by deiopajw | last post: by
5 posts views Thread by Yuri Shtil | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.