473,698 Members | 2,411 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

placing DB outside the web root ...where? and path in ASP?

i learnt from *Ken Schaefer's* website that for security reasons, u
should put your DB outside the website root directory. this is his
webpage -
http://www.adopenstatic.com/resource.../structure.asp

1. where do i place the database outside the root directory? my
directory access from my hosting company (windows 2000 server) is like
this:

ftp.mywebsite.c om
- mywebsite.com (folder)
parent folder
documents (this is the root directory folder)
log files (folder)


2. what should be the new path in asp pages to make a DB connection,
e.g.
DSNtemp=dsntemp & "DBQ=" & server.mappath( "database.m db")
Jul 19 '05 #1
4 4808
> 1. where do i place the database outside the root directory?

You don't always have the luxury of doing this. I think in most cases, this
applies to people who have control over their servers. So, you might have
to ask your hosting company to set up a virtual FTP folder that points
off-web, so that you can upload the database there. But then it's still
exposed via FTP. And you would have to hard-code the reference to the MDB
file in your connection string, e.g. F:\protected\fi le.mdb (you can no
longer use server.mappath) . This isn't so much of a problem, except folder
structures, and even the drive letter itself, aren't guaranteed to remain
intact if the ISP upgrades servers, moves to a new data center, etc.

One way to prevent people from downloading your MDB file, even if they
*could* guess the location and filename, is to give it an ASP extension. It
will still work as a database file (your connection string would point to an
..asp file instead of an .mdb file), and users wouldn't be able to download
it by accessing it directly, because the web server will try to run it like
an ASP script.

And yes, it will still be exposed via FTP, but if you name it something
inconspicuous, a user who managed to break in would have to figure out (a)
that your database is actually in an ASP file, and (b) which one it is.
There shouldn't be any way a casual sniffer would even know you're using
Access in the first place, unless you advertise that.
Jul 19 '05 #2
I've tested using an asp extension to the databasefile (database.asp and
not database.mdb). But if you connected to database.asp (typing in the
correct path and filename), it appeared in the browser as a textfile,
with parts of the content clearly possible to read.
The site is on a webhotel (running MS Server 2003), don't know if
they've missed something.
So we use the very odd foldername + equaly odd databasename

Mats

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3
i confirmed with my web hosting company. i can place my database
outside my webroot directory (on a windows 2000 server.)

1. where do i place it 2. what should be the path in asp to make a DB
connection?
e.g. DSNtemp=dsntemp & "DBQ=" & server.mappath( "database.mdb") ?

here is the structure of webfolders that are available to me:

ftp.mywebsite.. ..com
- mywebsite....co m (folder)
parent folder
documents (this is the root directory folder)
log files (folder)

Jul 19 '05 #4
> i confirmed with my web hosting company. i can place my database
outside my webroot directory (on a windows 2000 server.)

1. where do i place it
They need to tell you that; we can't tell you where to put it, because we
don't know what "outside my webroot directory" means.
2. what should be the path in asp to make a DB connection?


That depends on the answer to 1. It will NOT involve server.mappath,
however, as I mentioned in my post yesterday.
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2783
by: cooldv | last post by:
After talking (emailing) to my webhoster, i have placed my access DB in a folder outside the root directory folder; and they gave me a *path.asp* file to put in my root directory folder. ** This webhoster is a real specimen! He/she refuses to provide further support saying it is a script debugging issue*** I need help from ya'll gurus!!!!!! 1a. The path.asp file has only 1 line code: <% = Server.MapPath(".") %>
12
828
by: Jon Maz | last post by:
Hi All, I would like to have the following folder structure for an asp.net website: MasterFolder |---\AppRoot | --- webform.aspx | --- web.config | --- global.asax
4
7852
by: Win, Pats | last post by:
I have a snippet of HTML that I inject into a number of pages throughout my Web site at runtime. My problem is that I'm not getting the image to appear in all documents into which this snippet is injected. If I specify a document-relative path (e.g., src="../someFolder/AnotherFolder/TheGraphic.gif"), then it works fine, but only for documents that exist at the level in the directory structure. I thought I could use a root-relative...
2
2301
by: Jordan Richard | last post by:
Put another way, is there any way I can tell ASP.NET to convert a path (imbedded in a string variable, "~/images/some_image.gif") to a root-relative path, that the client will understand, for the *current* page request? Here's what I'm doing: I am injecting HTML directly into ASPX pages via LiteralControl. something like this...
19
10219
by: Steve Franks | last post by:
I am using VS.NET 2005 beta 2. When I run my project locally using the default ASP.NET Development Web Server it runs using a root address like this: http://localhost:11243/testsite/ However when I deploy to a remote test server running real IIS, the real root of my application becomes: http://localhost/ What I want to do is have it so that on my local machine the asp.net dev
3
1702
by: Nalaka | last post by:
Hi, I have an asp.net web application (www.myWebSite), and a subweb application (www.myWebSite/subSite). How do I set it so that, subweb application (www.myWebSite/subSite) be the root application..... so that, when a user types www.myWebSite/subSite, it actualy, shows pages off subweb.
2
2518
by: gurnandank | last post by:
Hi, I have a web application which uses SSL on one the folders. When I developed application the set up was webroot and under that folder called 'secure'. My ISP has provided a folder called 'secure' on the server which has shared SSL and is sitting outside of the web root, hence the set up called 'secure' and then at the same level a folder called web root. Now, I have two issues:
3
2258
by: Chris | last post by:
When I go into debug mode and the web page I am working on opens in the browser via the local Cassini Web Server I get a path appended onto the full path e.g. localhost:7859/FolderName/filename_that_should_be_in_the_root.aspx this is a pain as I do my links from the root e.g. /css/site.css and the additional folder in the path stops that. Is there any way to get the site in debug mode to show
0
2130
by: deco12 | last post by:
Hi, I am new to web design and Apache, but have managed to password protect my site by putting a .htaccess file in the sites root directory. I have set it up so that a number of members have access to the site. Now, within the site I have a link to a "document" folder which I only want 2 or 3 members to have access to. I have created a second .htaccess & .ht passwd file, with the path to the new folder and a different password. This was...
0
8685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9032
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7743
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.