我正在尝试使用Apache http配置Mercurial访问。它需要认证。我的/etc/apache2/sites-enabled/mercurial
样子是这样的:
NameVirtualHost *:8080
<VirtualHost *:8080>
UseCanonicalName Off
ServerAdmin webmaster@localhost
AddHandler cgi-script .cgi
ScriptAliasMatch ^(.*) /usr/lib/cgi-bin/hgwebdir.cgi/$1
</VirtualHost>
我在互联网上阅读的每个教程都告诉我插入以下几行:
AuthType Basic
AuthUserFile /usr/local/etc/httpd/users
但是当我这样做时,出现以下错误:
# /etc/init.d/apache2 reload
Syntax error on line 8 of /etc/apache2/sites-enabled/mercurial:
AuthType not allowed here
我的发行版是一个定制的Ubuntu,名为Turnkey Linux Redmine
<Location /opt/mcmap/shapefiles.php> AuthType Kerberos AuthName KerberosLogin KrbServiceName HTTP/intranet.spectrumasa.com KrbMethodNegotiate On KrbMethodK5Passwd On KrbAuthRealms DOMAIN.COM Krb5KeyTab /etc/httpd/conf/intranet.keytab require valid-user Options Indexes MultiViews FollowSymLinks AllowOverride All Order allow,deny Allow from all SetOutputFilter DEFLATE </Location>