Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-09-2012, 05:17 AM   PM User | #1
JudgementDay
Banned

 
Join Date: Jan 2012
Posts: 93
Thanks: 8
Thanked 0 Times in 0 Posts
JudgementDay is an unknown quantity at this point
Ways to prevent Apache from serving a folder?

What are some ways to prevent Apache from serving a folder in the root directory?

I have raw data in there containing PHP with passwords for my SQL database, and I don't want it being served up.

I'm thinking just .htaccess with a password.

Is it possible to do within my servers configuration file?

I want to hear what other people would do.
JudgementDay is offline   Reply With Quote
Old 02-09-2012, 01:41 PM   PM User | #2
KuriosJon
Regular Coder

 
Join Date: Jan 2012
Posts: 134
Thanks: 0
Thanked 32 Times in 32 Posts
KuriosJon is on a distinguished road
I wouldn't put any passwords in any web accessible directory, period. Move them outside your web root; php can still access those files where a random web user can't.
__________________
Roundabout Time Tracking
KuriosJon is offline   Reply With Quote
Old 02-09-2012, 02:34 PM   PM User | #3
primefalcon
Regular Coder

 
primefalcon's Avatar
 
Join Date: Aug 2008
Location: /home/primefalcon/
Posts: 679
Thanks: 8
Thanked 39 Times in 39 Posts
primefalcon is an unknown quantity at this point
I agree with above post fully, but if you really want to use .htaccess you can create a .htaccess file in the folder you don't want entry past that contains the following only

Code:
deny from all
primefalcon is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:55 PM.


Advertisement
Log in to turn off these ads.