Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Logic behind display of .www folder ?? Post 302102410 by BOFH on Wednesday 10th of January 2007 08:52:05 AM
Old 01-10-2007
Quote:
Originally Posted by srinivasan_85
Hi,
Thank you for ur response. My problem is not related to webserver. Actually i am in an intranet, where in i have my own disk space of a shared network drive. In this case, i am the person who gives access to the .www dir of my home drive. Now I wanna put the index.htm in my .www dir, so that others type "http://www/~srini" to access my homepage. This home page is now the dir structure of my home directory. When i place index.htm in the .www dir, it will display the contents of index.htm. I just want to provide users a link on index.htm, which will lead them to the plain old dir structure display.
What you suggested is to rename index.htm to some other file say "random.htm", so that users would by default get the dir structure, from where they can click random.htm. But i just want to do the reverse !! I wanna make users click on a link on index.htm so that they would go back to the directory structure (which cannot be done thro a link to www/~srini, because it is overridden by the placing of index.htm) ! Smilie

It is really difficult to express my problem verbally ! Smilie

Thanks
Srini
I'm pretty sure I understood what you're asking. I have to deal with users on a day to day basis so interpreting requests is one of my skills Smilie

1. You have an HTTP accessible directory: http://www/~srini
2. When someone reaches that directory now, they get a directory list.
3. When you put index.htm into that directory, the browser loads index.htm
4. You'd like a link on your index.htm page to be able to direct the browser to http://www/~srini and present a directory listing.

One question would be, how to people get to your directory in the first place? Are you giving them the URL (via e-mail or verbally) or is it a link off a Student or Office Directory (for example). If it's either of those methods, my suggestion will still work.

1. Modify your individual directory configuration in the web server configuration file to exclude index.htm from the DirectoryIndex variable (for Apache).
2. Modify the Student/Office Directory listing to include index.htm and the listing now says:
Code:
<a href="http://www/~srini/index.htm">Srini's Home</a>

3. When you give out your home directory listing, make sure you include the trailing /index.htm in the URL.
4. In the index.htm, have a link that points to just your home directory:
Code:
<a href="http://www/~srini/">Directory Listing</a>

And that should take care of it.

If you want to eliminate a few steps or are unable to modify your DirectoryIndex variable, you can simply use an alternate html file (like random.htm). Just make the same changes to the Directory listing and the URLs you provide to friends.

Another option works if you have php or perl installed. I did a quick google search and found this:

http://www.evoluted.net/community/co...orylisting.php

With this, you can provide a very nice looking configurable directory listing through php. I haven't reviewed the code for vulnerabilities or anything so I'm not recommending that you use it, just providing it as an example of code that's already on the 'net and ready to use. (If you do decide to try it, make sure you go though the script and understand what the script is doing first so you don't leave your system open to attack.)

Oh, and there certainly is a web server on your system. If you
Code:
$ telnet [yourservername] 80

you might get a server signature string which will identify the server, assuming the admins haven't obfuscated it for security reasons (unlikely if they allow directory listings since that's generally considered a minor security issue). Type
Code:
GET / HTTP/1.0<enter><enter>

to exit out of the session.

Hope that helps.

Carl
 

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

display the files in a folder which are older than 1 hour

Hi, I have some files in a folder with different time stamps and I want to display the files which are older than 1 hour. i tried with find. need urgent help. (3 Replies)
Discussion started by: vgs
3 Replies

2. Shell Programming and Scripting

display the files in a folder which are older than 1 hour

Hi, I have some files in a folder with different time stamps and I want to display the files which are older than 1 hour. i tried with find. need urgent help. (7 Replies)
Discussion started by: vgs
7 Replies

3. UNIX for Dummies Questions & Answers

How to display contents of folder when 'cd' is used

Hi, I am a new learner of Unix. I am currently working on a Solaris 8 machine. Earlier, when I use 'cd <folder name>' command, I am not only able to change the folder but also able to see the contents of the folder as if a 'ls -lt' command was executed. However, since a week, suddenly this... (3 Replies)
Discussion started by: mumashankar
3 Replies

4. UNIX for Dummies Questions & Answers

Permissions of the folder var/www

what should be the permissions of the folder var/www in my ubuntu ? I need it to be safe and at the same time I need ftp users to be able to edit it. I was wondering if I should create a group with all permissions and add ftp users to this group in unix. what's the standard way to do it ?... (4 Replies)
Discussion started by: aneuryzma
4 Replies

5. UNIX for Advanced & Expert Users

chroot openssh access www folder

here is the setup<br/> sshd_config: <pre> Match User sftp ChrootDirectory /chroot/sftp </pre> I connect just fine to the folder <pre>/chroot/sftp</pre> However I cannot access the website developer folder due to it being outside the scope of the defined chrootdirectory... (2 Replies)
Discussion started by: dunpealslyr
2 Replies
All times are GMT -4. The time now is 03:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy