Return-Path: X-Original-To: apmail-httpd-users-archive@www.apache.org Delivered-To: apmail-httpd-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CA2FA6EF2 for ; Sat, 28 May 2011 18:51:44 +0000 (UTC) Received: (qmail 13861 invoked by uid 500); 28 May 2011 18:51:41 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 13834 invoked by uid 500); 28 May 2011 18:51:41 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 13826 invoked by uid 99); 28 May 2011 18:51:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 May 2011 18:51:41 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [216.240.58.140] (HELO knutejohnson.com) (216.240.58.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 May 2011 18:51:34 +0000 Received: from [192.168.3.5] (ljr-int-wan.frazmtn.com [216.240.58.138]) (authenticated bits=0) by knutejohnson.com (8.14.3/8.14.3/Debian-9.1ubuntu1) with ESMTP id p4SIpBOH009031 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 28 May 2011 11:51:11 -0700 Message-ID: <4DE14429.8060502@knutejohnson.com> Date: Sat, 28 May 2011 11:51:21 -0700 From: Knute Johnson User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 MIME-Version: 1.0 To: users@httpd.apache.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Subject: [users@httpd] Files and DirectoryIndex conflict? I'm having a problem using the Files directive to require authentication on the index.html file. It doesn't work if it is requested with the index URL but does if the URL specifies the file directly. I can't believe that I'm the only person ever to try to do this but maybe I am. So if I request http://localhost/ I get the following error and NO user name/password dialog. 401 Authorization Required Authorization Required This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required. But if I request http://localhost/index.html I get the Authentication Required dialog and can enter the user name and password and then receive the file. I've tested this with FireFox and Chrome. I'm running Ubuntu 10.10 and apache 2.2.16. Here is the access log from the first request 127.0.0.1 - - [28/May/2011:11:31:16 -0700] "GET / HTTP/1.1" 401 618 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110422 Ubuntu/10.10 (maverick) Firefox/3.6.17" and the access log from the second request 127.0.0.1 - knute [28/May/2011:11:30:12 -0700] "GET /index.html HTTP/1.1" 200 485 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110422 Ubuntu/10.10 (maverick) Firefox/3.6.17" The error.log is empty. Here is the virtual host configuration file ServerAdmin webmaster@localhost DocumentRoot /var/www Options FollowSymLinks AllowOverride None Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all # added for testing # any files require group any membership AuthType Basic AuthName "ARCLA Lookers" AuthUserFile /usr/local/apache/passwords/arcla.pwd AuthGroupFile /usr/local/apache/passwords/groups Require group lookers players honchos # this file requires group membership AuthType Basic AuthName "ARCLA Players" AuthUserFile /usr/local/apache/passwords/arcla.pwd AuthGroupFile /usr/local/apache/passwords/groups Require group players honchos ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all # added for testing AuthType Basic AuthName "test" AuthUserFile /usr/local/apache/passwords/arcla.pwd AuthGroupFile /usr/local/apache/passwords/groups Require group honchos ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined Alias /doc/ "/usr/share/doc/" Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 The DirectoryIndex directive is in dir.conf DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm Thanks, -- Knute Johnson --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org