我试图configurationawstats的方式,我有一个未经过身份validation的网站,另一个经过身份validation的网站。 进一步来说
domain / awstats / awstats.pl?config = X 不应该被authentication
domain / awstats / awstats.pl?config = Y 应该被authentication
经过大量的search,我还没有find任何解决scheme,因为这是查询string相关的事实。
关于我的头顶,这里有一个方法可以做到。 首先将awstats放在只监听本地主机的虚拟主机上。
<VirtualHost 127.0.0.1:8080> ... </VirtualHost>
在该虚拟主机中,包含将基于path的URL转换为适当的查询string的RewriteRules :
RewriteRule /awstats/config/(.*) /awstats/awstats.pl?config=$1
有了这个,你可以访问:
/awstats/awstats.pl?config=X
使用:
/awstats/config/X
但请注意,目前只有通过localhost才可以使用。 我们还没有build立外部连接。 为此,我们要把<Location>块放在你的主服务器configuration中:
喜欢这个:
<Location /awstats/config/X> ProxyPass http://localhost:8080/awstats/config/X </Location> <Location /awstats/config/Y> AuthType Basic AuthName "awstats X" AuthBasicProvider file AuthUserFile /path/to/htpasswd require valid-user ProxyPass http://localhost:8080/awstats/config/Y </Location>
这一切都是无庸置疑的,所以这里完全有可能存在一些错误,但基本的想法是合理的。