LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to set apache virtual hosts Host-Based Security? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-set-apache-virtual-hosts-host-based-security-598973/)

hocheetiong 11-12-2007 03:37 AM

how to set apache virtual hosts Host-Based Security?
 
hi, if not set as apache virtual hosts server, than just direct go to add the ip address or computer name in:

Order deny,allow
Deny from 192.168.30.8

but when now i setup as a virtual hosts apache server than how to configure Host-Based security on virtual hosts, example: i have configure 3 virtual hosts, i want one of them deny from ip 192.168.30.8


Thank you.

arub 11-12-2007 05:43 AM

try this
 
just specify this inside the virtual host tags


example

<virutalhost *:2000>
DocumentRoot "/var/www/html/abc"
<Directory>
...
...
...
Deny from 192.168.30.8
...
..
</Directory>
</virutalhost>

vickey83in 01-17-2014 04:20 AM

Just use correct order
 
Use this order

Order deny, allow
Allow from [ip of your first virtual host]
Allow from [ip of your second host]
  • If you set Order allow, deny Only those host names or IP addresses associated with allow directive are allowed access. All remaining hosts or IP address would be denied.
  • If you set Order deny, allow Only those host names or IP addresses associated with deny directive are denied access. All remaining hosts or IP address would be allowed.

Source Host based security in Apache


All times are GMT -5. The time now is 08:06 PM.