473,387 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

storing database fileson server and protecting the directory

Hi,
I need some information on where to store db connection details in php on my server. Currently all the files are in the httpdocs folder. Is it safe to have the db conn file in there? I was thinking of putting the files into another directory with a htaccess file that denies from all users except my scripts. However i have tried
[code]
#Deny access for all users (all IPs), except the same domain IP
Order allow,deny
deny from all
allow from xxx.xxx.xxx.xxx
ErrorDocument 403 /403.html
[\code]
and all i get is 403 errors. Is it possible to deny access when the url is directly typed in but still allow my own scripts to get through?

Thanks matt.
Jan 17 '11 #1
1 1142
dlite922
1,584 Expert 1GB
your script is accessing the file locally. It is not call it on port 80 through apache. That "allow from xxx.xxx.xxx" is for clients that connect to the webserver.

Just don't serve the file. Put it outside the webroot directory. Your script can access it, but apache won't serve it.

If you must leave it, you can hide it in PHP code (i.e. if someone types that page in it will just show nothing or whatever message you choose to echo). This means the file MUST be processed. It cannot be a text or .inc file.

Hope that answers your questions,

DM
Jan 17 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Rob | last post by:
Hi, In the server explorer in Visual Studio.Net I'm able to design tables, create stored procedures, etc for the SQL 2000 database running locally on my computer. If I add a connection to a remove...
7
by: Mike Malter | last post by:
Visual Studio is giving me errors when trying to connect to a database server on my LAN. This has been working for years. Then this morning when I opened VS I went to the server explorer before...
2
by: Szaki | last post by:
Hello, I have a some xml file and database. How import this file to database? I must do aplication in VB .NET whose show imports some xml file to database SQL SERVER 2000? Do you have any idea?...
2
by: chandana Devabhaktuni | last post by:
Hello and Hi to everyone, This is chandana, i have a doubt which i am mentioning here. We can retrive or bind data to datagrid from database(sql server) and also we can...
0
by: Scott | last post by:
I need to compact the backend database on server regularly using Jetcomp utility. Can this utility support commandline so I can do it with Windows scheduler. Your advice on the syntax is...
2
by: Luzuko | last post by:
HI, Im doing a project and the basic requirements of the project is that my Front-end application (VB 2005) and Web application(VB Scripting and ASP) should write and retrieve from the SAME...
2
by: Wendi Turner | last post by:
ASP.NET 2.0 C# WebService Connect to Database: Sql Server 2005 --------------------------------------------------------------------------------------------------- I have successfully created a...
4
by: sujatha k | last post by:
I want to create one window service to synchronice my local database with server database.i've done the synchronization process in .net application it is working fine. i copied tat code and put it in...
3
by: tvnaidu | last post by:
any open source LDAP server (active directory) for Windows/Linux?
2
by: berilker | last post by:
I have a project. I have to build a client server application and i have to access(and run some queries) to ms sql database which is at server side, from client application. How can i build this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.