LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Making Hidden Filed Visible under Directory Indexing in Apache? (https://www.linuxquestions.org/questions/linux-newbie-8/making-hidden-filed-visible-under-directory-indexing-in-apache-763639/)

your_shadow03 10-22-2009 02:22 AM

Making Hidden Filed Visible under Directory Indexing in Apache?
 
Whenever I browse through http://localhost/publish
it shows:

Index of /publish
[ICO] Name Last modified Size Description
[DIR] Parent Directory -
[DIR] Fedora-9/ 22-Oct-2009 18:11 -
[DIR] Fedora-11/ 22-Oct-2009 18:01 -
Apache/2.2.11 (Fedora) Server at localhost Port 80

Now I have created a hidden file .htaccess under Fedora-11.
How can I make it visible under Fedora-11.

lutusp 10-22-2009 04:17 AM

Quote:

Originally Posted by your_shadow03 (Post 3728169)
Whenever I browse through http://localhost/publish
it shows:

Index of /publish
[ICO] Name Last modified Size Description
[DIR] Parent Directory -
[DIR] Fedora-9/ 22-Oct-2009 18:11 -
[DIR] Fedora-11/ 22-Oct-2009 18:01 -
Apache/2.2.11 (Fedora) Server at localhost Port 80

Now I have created a hidden file .htaccess under Fedora-11.
How can I make it visible under Fedora-11.

Why do you want to make this file visible? There is a reason dotted files aren't visible to casual visitors, in particular this one.

It's one thing to make it visible to the site maintainer, it is quite another to make it visible to the world.

vijay_babu1981 10-22-2009 04:21 AM

Either remove the . from .htacess or create a symbolic link to this file.

I am not sure about the later part of above comment but you can try.

Wim Sturkenboom 10-22-2009 04:40 AM

Quote:

How can I make it visible under Fedora-11.
I think OP wants to see it locally in the file browser, not in a web browser; but I might be wrong. ls -al should show it (in terminal)

your_shadow03 10-22-2009 04:45 AM

All I want is to let a friend of mine provide with the overall files contained in the directory?

vijay_babu1981 10-22-2009 04:59 AM

Quote:

Originally Posted by your_shadow03 (Post 3728296)
All I want is to let a friend of mine provide with the overall files contained in the directory?

Then create a tarball of the directory and compress it and place it somewhere visible to him. This way he will only have to download only 1 compressed file.

your_shadow03 10-22-2009 05:04 AM

What if I want a user acess the certain portion of directory through username/password?
Is that possible?

vijay_babu1981 10-22-2009 06:07 AM

Quote:

Originally Posted by your_shadow03 (Post 3728314)
What if I want a user acess the certain portion of directory through username/password?
Is that possible?

You can use html forms and PHP for password authentication. There are good tutorials on PHP/HTML present on the web.

your_shadow03 10-22-2009 06:22 AM

I had the following Directory Structure which I want to open with authentication:
Code:

Index of /publish
[ICO]        Name        Last modified        Size        Description
[DIR]        Parent Directory                -
[DIR]        Fedora-9/        22-Oct-2009 18:11        -
[DIR]        Fedora-11/        22-Oct-2009 18:01        -
Apache/2.2.11 (Fedora) Server at localhost Port 80

What I did is :
Code:

<Directory /usr/web/www/publish>
Options Indexes FollowSymlinks
AllowOverride None
#<Files /usr/web/www/publish/Fedora-9/SOURCES/index>
#Order deny,Allow
#Satisfy Any
#</Files>
</Directory>
<Directory /usr/web/www/publish/>
AuthType Basic
AuthName 'Restricted Stuff"
AuthUserFile /usr/web/www/auth.user
Require valid-user
</Directory>

And It did work.
This seems ok but the QUESTION IS:

How Can I allow users to browse the page above publically accessible.But SOURCES under FEdora-9 to ask for username/passwd?

vijay_babu1981 10-22-2009 06:43 AM

It seems that you do not have any html/php page being displayed when people visit your website. Why dont you create a simple webpage in php and name it as index.php. Dont present a direct listing of the directory which you want to password protect. Place that index.php with password forms in that directory and challenge the visitors for authentication.

There may be other simpler ways, it may be possible to do this directly as you are doing it currently, but this is how i did it.

your_shadow03 10-22-2009 08:31 AM

Buddy..I understand what you mean.
I know index.php should have forms to accept username/password.
But that is totally different and not what I mean to ask.
I want to put Authentication for particular directory in Directory Indexes?
What I want is Whenever Someone click on Fedora 9 it shud ask for password?

What you say is PHP form which accept username/passwd?

Tinkster 10-23-2009 03:51 PM

Closed ... one of serverl (>5 dupes/closely related threads)


All times are GMT -5. The time now is 09:59 AM.