Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i've been trying to some time to do this, but either i'm missing something... or something's just plain broken. :-) i'm trying to protect directories in apache, i've read the how-tos and several tutorials, but haven't been able to get it working.
my .htaccess file in the dir i want to protect looks like this:
i still can't get it to work... this is really driving me crazy, cause as far as i can tell i'm doing everything right. anyway, here's what i have in my httpd.conf file now:<BR><BR>
<Directory /mp3sync>
AllowOverride All
</Directory>
Originally posted by Syncrm i still can't get it to work... this is really driving me crazy, cause as far as i can tell i'm doing everything right. anyway, here's what i have in my httpd.conf file now:<BR><BR>
<Directory /mp3sync>
AllowOverride All
</Directory>
Is the "mp3sync" directory path on the file system actually "/"? The "Directory" directive needs the exact filesystem path for the directory, not the path relative to DocumentRoot. I would assume it's something more like "/blah/blah/mp3sync", of course I could be wrong
you know what? you're right... i actually figured that out last night. :-)
so now i have another question... is it possible to protect the directory based on the client's IP?
the situation is that i have this directory that i use mostly from my internal network (IPs are 192.168.1.x) which i would like to be able to access from my internal clients without hastle. however, on the rare occassion that i do access it from anywhere else on the inet, i'd like to be prompted for a passwd. i know it's possible using PHP in the index.php file, however i'd like to protect the entire directory and not just the index file. is this possible?
<LIMIT ...>
order deny, allow
deny from all
allow from 192.168.1
[more "allow from"s, if needed]
AuthType Basic
AuthUserFile ...
AuthGroupFile ...(if needed)
AuthName Whatever
require valid-user
satisfy any
</LIMIT>
If the user's IP is in one of the "allow from" lines they won't need a passwd. If not, they get the prompt (the "satisfy any" line).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.