OM2 Posted February 25, 2009 Share Posted February 25, 2009 I need advice on securing directories I have a Linux server If the directory is empty or doesn't contain an index file, then the contents are displayed How do I stop people from looking at the contents if the directory doesn't have an index? I'm a complete newbie in relation to this! Is there a security setting that I can make in Cpanel for example? What if I only wanted to protect a sub set of directories - and leave all other directories outside with the existing settings? Thanks OM Quote Link to comment https://forums.phpfreaks.com/topic/146927-need-advice-on-securing-directories/ Share on other sites More sharing options...
premiso Posted February 25, 2009 Share Posted February 25, 2009 You can .htaccess it or if your own server you should modify the apache http.conf file. I would look into the .htaccess tutorial and how to use it to get what you want. Preventing Directory Listing Quote Link to comment https://forums.phpfreaks.com/topic/146927-need-advice-on-securing-directories/#findComment-771372 Share on other sites More sharing options...
OM2 Posted February 25, 2009 Author Share Posted February 25, 2009 You can .htaccess it or if your own server you should modify the apache http.conf file. you said "or if your own server" i do own my own server is using the http.conf a better way? i need to get others to develop on my server if they run the command to give all environment variables, will there be a danger of them getting access to the user/pass using the http.conf way? (apologies: i ask without looking up what http.conf involves! looking this up now. would be great to get an answer regardless though!) i've just read about .htaccess - it seems pretty good and what i need but if http.conf is the better way, maybe i should use that? thanks Quote Link to comment https://forums.phpfreaks.com/topic/146927-need-advice-on-securing-directories/#findComment-771377 Share on other sites More sharing options...
premiso Posted February 25, 2009 Share Posted February 25, 2009 It is not necessarily the better way. But you should have that option set in there by default. You can add the Options +Indexes parameter in the http.conf file under the <directory></directory> declaration to prevent this, then users can allow a certain directory to display contents by using .htaccess if they so choose. Quote Link to comment https://forums.phpfreaks.com/topic/146927-need-advice-on-securing-directories/#findComment-771381 Share on other sites More sharing options...
OM2 Posted February 25, 2009 Author Share Posted February 25, 2009 thanks for the lightning quick answer - i haven't even had time to google http.conf yet doing this now thanks for the advice Quote Link to comment https://forums.phpfreaks.com/topic/146927-need-advice-on-securing-directories/#findComment-771382 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.