Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 09-20-2004, 01:07 PM   #1
Member (12 bit)
 
Join Date: Oct 2003
Location: Manchester, UK
Posts: 2,374
Restrict apache access

I have an Apache webserver running, but there are some important files and folders I have on there that I want to restrict access to, so they can only be accessed by me on my own computer. I know there must be some way to do it with allow 10.0.0.15(my local IP) and deny all, but where? Also, I would prefer to do it via httpd.conf than .htaccess.
ric449 is offline   Reply With Quote
Old 09-20-2004, 03:05 PM   #2
Staff
Premium Member
 
mairving's Avatar
 
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
It would be easier if at all possible to have these files in the same directory. That way you could password protect the directory with a username/password. You could combine that with the allowing access to only your IP address. I would do both since an IP address can be spoofed.

You can do it using either .htaccess or through httpd.conf. .htaccess just overrides the settings in httpd.conf if overrides are allowed. Keep in mind that .htaccess is read every time that a page is accessed so it can slow down your site a bit. httpd.conf is read once but remember that anytime you make changes in it, you have to restart the server.

Apache Auth How To.
__________________

Want to Make $$$$ with your Computer? No Risk! Simply press shift-4 four times in a row
mairving is offline   Reply With Quote
Old 09-20-2004, 03:55 PM   #3
Member (12 bit)
 
Join Date: Oct 2003
Location: Manchester, UK
Posts: 2,374
Well I'm halfway there . The good thing is the folder is now restricted, you try it and you just get forbidden. The bad thing is I get locked out too, so I would have to remove it from httpd if I want to access it. I used:

Code:
{Directory htdocs/phpmyadmin}
        order allow,deny
        deny from All
        Allow from 10.0.0.15
{/Directory}
Under controls who can get stuff from this server.
ric449 is offline   Reply With Quote
Old 09-21-2004, 06:51 AM   #4
Staff
Premium Member
 
mairving's Avatar
 
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
You need to change the order to get it to work properly.

Code:
{Directory htdocs/phpmyadmin}
        order deny, allow
        deny from All
        Allow from 10.0.0.15
{/Directory}
mairving is offline   Reply With Quote
Old 09-21-2004, 07:29 AM   #5
Member (12 bit)
 
Join Date: Oct 2003
Location: Manchester, UK
Posts: 2,374
Edited: Put myself at risk

Last edited by ric449; 09-21-2004 at 09:07 AM.
ric449 is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes 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 On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 06:53 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2