I'm trying to configure mercurial access using Apache http.
It requires authentication. My /etc/apache2/sites-enabled/mercurial looks like this:
NameVirtualHost *:8080
<VirtualHost *:8080>
UseCanonicalName Off
ServerAdmin webmaster@localhost
AddHandler cgi-script .cgi
ScriptAliasMatch ^(.*) /usr/lib/cgi-bin/hgwebdir.cgi/$1
</VirtualHost>
Every tutorial I read on the internet tells me to insert these lines:
AuthType Basic
AuthUserFile /usr/local/etc/httpd/users
But when I do it I get the following error:
# /etc/init.d/apache2 reload
Syntax error on line 8 of /etc/apache2/sites-enabled/mercurial:
AuthType not allowed here
My distro is a customized Ubuntu called 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>– shorif2000 May 20 '13 at 14:26require valid-userportion. A complete example can be a wonderful thing. Thanks. – Buttle Butkus Jul 16 '13 at 08:19<Location />in any case to not get a syntax error when loading the config file. – Perseids Sep 28 '16 at 09:06<Location />edited to<Location>with an internal log message of "fixed ... to avoid a lot of trouble", but telling nothing about the real reason in the answer itself? There is no such thing as a<Location>directive (i.e. one without a location) in Apache. That definitely causes trouble now. ;) (See e.g. above.) – Sz. Feb 19 '17 at 23:26Deny from allandSatisfy Anyand disable the modulemod_access_compatfor a cleaner solution. – Colin 't Hart Feb 28 '22 at 12:09