General
cancel
Showing results for 
Search instead for 
Did you mean: 

apache directory restriction

Fadia Almarei
Super Advisor

apache directory restriction

Dear All

I have apache running on RHEL v.4 , i want to add a directory on htdocs which can be acceseed from a certain IP's , how should i do this , i think on a way to make this directory works on a certain port (add another port to apache) and this who have the write to use this port will see it , kindly your help in how to do this or any new idea.

BR;
Fadia
fadia.marei
7 REPLIES
Ivan Ferreira
Honored Contributor

Re: apache directory restriction

Hi Fadia, please see:

http://home.golden.net/htaccess.html
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Steven E. Protter
Exalted Contributor

Re: apache directory restriction

Shalom,

Putty the server on another port hides it, it does not prevent access.

You might try password control into the site.

Here is a guide.

http://bignosebird.com/apache/a10.shtml

Creating private access. Managing this password file can get to be a pain if there are a lot of users.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Alexander Chuzhoy
Honored Contributor

Re: apache directory restriction

Look at the following example for how to block IP

AllowOverride AuthConfig
order allow,deny
Allow from 10.0



This will allow the access to the directory from 10.0.0.0/16, but will block all others.

As for running on a different port:
If you want to create a specific virtual host - then:
:80>
where instead of 80 can be any port - that's not in use.
or

locate the line
Listen 80
and change the number to any unused port.
Fadia Almarei
Super Advisor

Re: apache directory restriction

if i want to do it to a list of IPs
fadia.marei
Alexander Chuzhoy
Honored Contributor

Re: apache directory restriction

then it would be several "deny from " or "Allow from " lines, within the directory section.
Fadia Almarei
Super Advisor

Re: apache directory restriction

if i want it to a certain range of IP's
fadia.marei
Alexander Chuzhoy
Honored Contributor

Re: apache directory restriction