CentOSThis forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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:
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 /
Last edited by robertkwild; 04-06-2015 at 03:24 PM.
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"
to:
Code:
DocumentRoot "/"
I haven't tried that before because I never wanted to use / to be used by httpd.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.