我最近进入了Apache,我试图做一些我不知道该怎么做。 我有两个网站:siteA和siteB。 SiteA可以访问他的网站和SiteB。 另一方面,SiteB只能访问他的网站。 接下来我要做的是允许siteB访问siteA,但是他只能访问test. *文件,而不是别的。
这是我迄今为止。
<Directory "/var/www/htdocs/siteA"> options indexes order allow,deny allow from 10.50.19 </Directory> <Directory "/var/www/htdocs/siteB"> options indexes order allow,deny allow from 10.50.19 allow from 10.51.19 </Directory>
感谢您的帮助!
根据http://docstore.mik.ua/orelly/linux/apache/ch05_06.htm这应该工作
<Directory "/var/www/htdocs/siteB"> options indexes Order deny,allow allow from 10.50.19.0/24 10.51.19.0/24 Deny from all </Directory>
要么
<Directory "/var/www/htdocs/siteB"> options indexes Order deny,allow allow from 10.50.19 10.51.19 Deny from all </Directory>
假设你使用apache 2.4,你可能想读这个: https : //httpd.apache.org/docs/2.4/howto/access.html
你的问题包括来自apache-2.2语法和来自apache-2.4标记,有点令人困惑,但是:
以下是你所需要的:
密切关注订单领域。 你需要有:
order deny,allow
不
order allow,deny
您还需要添加
Deny from all