Pranesh
asked on
Setting up restrictions on Apache
Hi Group
I was wondering if there is a way to restrict access to a particular directory using apache. I know there is however I was using the <Directory> option shipped in apache but it seems like when this is enable it affects all my sites.
for example if I wanted restrict access to a particular virtual host -
So for example I have a bunch of files in /var/www/mydir and I wanted to restrict access to only localhost.
How can I accomplish this without affecting any other operations of the webserver?
I am probably missing something in my config somewhere thats making the change global or something.
Any suggestions would be highly appreciated.
Thanks
I was wondering if there is a way to restrict access to a particular directory using apache. I know there is however I was using the <Directory> option shipped in apache but it seems like when this is enable it affects all my sites.
for example if I wanted restrict access to a particular virtual host -
So for example I have a bunch of files in /var/www/mydir and I wanted to restrict access to only localhost.
How can I accomplish this without affecting any other operations of the webserver?
I am probably missing something in my config somewhere thats making the change global or something.
Any suggestions would be highly appreciated.
Thanks
You can create .htaccess per directory and it will affect only current directory and what is beneath it.
ASKER
Hi aboo_s
Thank for your feedback. I thought that .htaccess was for user access only. Suppose I wanted a particular ip range to only access that particular directory. How would I achieve that?
I thought we could use something link this :
<Directory /var/www/mydir/>
Order allow,deny
Allow from 10.0.0.
</Directory>
When I try this config, only getting the welcome page on all my websites.
Is there something I need to change in the order?
Thanks
Thank for your feedback. I thought that .htaccess was for user access only. Suppose I wanted a particular ip range to only access that particular directory. How would I achieve that?
I thought we could use something link this :
<Directory /var/www/mydir/>
Order allow,deny
Allow from 10.0.0.
</Directory>
When I try this config, only getting the welcome page on all my websites.
Is there something I need to change in the order?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you so much!!!!
Works like a charm...
:)
Works like a charm...
:)
You are very welcome, glad I could have helped!