Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old February 13th, 2001, 03:09 PM
eduany eduany is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Location: Boston, MA
Posts: 54 eduany User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via AIM to eduany
Hello,
i have a dir in which are my *.html and *.php pages as well as my /images directory. What i want to do is, deny access to this dir. from the outside world. for example
if a request: http://mydomain.com/homedir/images/ is sent DENY it. I know this can be acomplished using .htaccessm however i dont know what goes in it.. indexing maybe... dont know.. pls help.. many thankx in advance....

-Mike

Reply With Quote
  #2  
Old February 13th, 2001, 04:28 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You don't do that. Denying /homedir/images/ would make all images on your html pages at http://mydomain.com/ to be broken. Please tell us what is your main purpose for doing it.

Reply With Quote
  #3  
Old February 13th, 2001, 10:19 PM
eduany eduany is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Location: Boston, MA
Posts: 54 eduany User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via AIM to eduany
i understant that my web server wont have access to the images... well basicaly i just dont want the visitors viewing my /images dir.. i didnt mean just the images dir.. but any dir (in general) lets say i have a dir with WORD documents in it which i only want to be avail. to the internal LAN.. how could i implement this..
thankx for your help...


Reply With Quote
  #4  
Old February 14th, 2001, 01:21 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> which i only want to be avail. to the internal LAN

Perhaps for LAN users while roaming? Then you should try the following:

# http://mydomain.com/homedir/images/.htaccess

AuthName "LAN users only"
AuthType Basic
AuthUserFile /path/to/one/common/.htpasswd
require valid-user
Order Deny,Allow
Deny from all
Allow from 192.168.0.0/24
Satisfy any

# http://mydomain.com/homedir/documents/.htaccess

AuthName "LAN users only"
AuthType Basic
AuthUserFile /path/to/one/common/.htpasswd
require valid-user
Order Deny,Allow
Deny from all
Allow from 192.168.0.0/24
Satisfy any

In doing so, your LAN users can access to documents dir and images dir without prompting for authentication. While they are roaming, their IP no longer falls under 192.168.0.x, then they will be prompted to authenticate.

Simply denying world access including yourself is pointless but to use your web space as storage.

Check out http://httpd.apache.org/docs/mod/core.html#satisfy

Also, I used /path/to/one/common/.htpasswd simply because you don't need to create a different set of .htpasswd for different directory, you can share it.

Reply With Quote
  #5  
Old February 14th, 2001, 01:27 AM
oskar oskar is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Location: Copenhagen, DK
Posts: 222 oskar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 50 m 40 sec
Reputation Power: 8
Send a message via ICQ to oskar
Try this link:

http://www.apacheweek.com/features/userauth

There you will find a solution

Reply With Quote
  #6  
Old February 14th, 2001, 02:41 PM
eduany eduany is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Location: Boston, MA
Posts: 54 eduany User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via AIM to eduany
THANKQ SO MUCH

thankx so much to both...
this is very helpful info, just what i need to get started,
i see everything can be done from a .htaccess file.. very flexible... thankx again..

Mike
apache newbie

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > .htaccess


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway