apache - show directory content
hi all,
i want to view my directory content using apache , so when i go to http://apache-server/folder_name, i will see the content of that directory on the website can anyone help please many thanks, rob |
To enable that you have to make sure that your /etc/httpd/conf/httpd.conf which includes the section for your website have Indexes option enabled as follows:
Code:
Options Indexes FollowSymLinks |
i have created this paragraph -
<Directory /apache_test/> Options Indexes FollowSymLinks Order allow,deny allow from all </Directory> will this work |
Yes, it should work. Make sure to restart httpd after making changes to httpd.conf file.
|
mmmm, i have restarted httpd, i get The requested URL /apache_test/ was not found on this server.
http://10.10.1.1/apache_test/ i have created that directory on my apache server and some sub folders underneath the root folder |
What is the output of the following:
Code:
ls -al /var/www/html |
output of the var/www/html is -
. .. but my apache_test is in the base directory |
Which base directory? Did you try putting it in /var/www/html and then give it a try?
|
no i put the apache_test dir in the /, i havnt put apache_test in var/www/html
EDIT - so i have made a apache_test dir under the /var/www/html and i can browse the dir but what if i dont want to put it under that dir and want to put it under / |
First of all it is not a good idea to use / as the root directory for apache. If you really want to use it then you have to make the change to the following parameter in /etc/httpd/conf/httpd.conf:
From: Code:
DocumentRoot "/var/www/html" Code:
DocumentRoot "/" |
great thanks,
i want to be able to browse my directory list but when i click on a document file i dont want the end users to see the contents of that file so i want them to see the actual file name and NOT the contents of that file is this possible |
To be honest that doesn't make sense at all. I mean if you don't want them to see the contents then why you are putting it there on the first place. I mean why you want them to see just the filename and not able to download it.
It is possible but as I said doesn't make sense at all. To make it possible you have to make sure that the file is owned by root and it has got 600 permission, that is only readable and writable by root. By making this change users will be able to see the file name but won't be able to see the contents or won't be able to download it. |
ok great thanks terminator, i will mess about and see if its what im looking for.
thanks very much for your help rob |
You're welcome!
Please mark the thread as solved if you think your queries have been answered. Enjoy Linux!!! |
All times are GMT -5. The time now is 05:45 AM. |