Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    ServerName www.krypton.com
    ServerAlias www.krypton.com

    DocumentRoot /home/www.krypton.com/www

    # This restrictive a precedence for ALL directory blocks.
    <Directory />
        Options FollowSymLinks
        # This prevents use of .htaccess
        AllowOverride None
    </Directory>

    # Main location of static content for the websites.
    <Directory /home/www.krypton.com/www/>
        Options +MultiViews
        Order Allow,Deny
        Allow from all
    </Directory>

    Alias /shared.private "/home/www.krypton.com/shared.private"
    <Directory /home/www.krypton.com/shared.private>
        # Allow website admin to use .htaccess - http://httpd.apache.org/docs/2.2/mod/core.html,
        #     AuthConfig - Authentication
        #     Indexes - Makes directory browseable

        # Specifically Indexes does NOT work and may be a bug with Ubuntu or Apache. Need to investigate further.
        AllowOverride AuthConfig Indexes

        # This DOES allow Indexes to work but I want things to be more secure.
        #AllowOverride All
    </Directory>

    ErrorLog /var/log/apache2/www.krypton.com.error.log

    # Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
    LogLevel debug
    CustomLog /var/log/apache2/www.krypton.com.access.log combined
</VirtualHost>

Here are the contents of /home/www.krypton.com/shared.private/.htaccess,

Code Block
# Enables directory listing BUT does not appear to work with AllowOverride Indexes
Options +Indexes

# Enable authentication, see http://httpd.apache.org/docs/2.0/howto/auth.html
AuthType Basic
AuthName "Password Required"
AuthUserFile /home/www.tin.homeip.net/keys/tinpham-www.tin.homeip.net.shared.private
Require valid-user

The strange thing is that if I comment out in .htaccess Options + Indexes, the authentication directives work fine. This is the exact example given in the Apache Docs.

Here are the error logs again when running LogLevel debug.