LinHES Forums
http://forum.linhes.org/

Allow APACHE subdirectory access using Digest Authentication
http://forum.linhes.org/viewtopic.php?f=5&t=17889
Page 1 of 1

Author:  tzoom84 [ Wed Feb 13, 2008 12:17 pm ]
Post subject:  Allow APACHE subdirectory access using Digest Authentication

I am using Knoppmyth R5F27 which by default provides preset Digest authentication (htdigest) for the Apache webserver (lets call it "http://mythbox/"). All was great when I wanted to create one or more users with access to the entire Apache webserver. And this was described in SecuringMythWebHowTo.

Now I'd like to create a seperate user who ONLY has access to a specific subdirectory, say http://mythbox/limitedaccess/. I thought I'd be able to do this by adding a <directory> section in /etc/apache2/apache2.conf. And then creating a new user, in a new realm, with a new htdigest file. (ex. "htdigest -c /etc/htdigest_limited_access limitedRealm newuser"). But, I couldn't get it to work right as it always seems to ask for username/pw in the MythTV realm, regardless of directory.

First, is what I am trying to do possible? Or is there a better way of creating an isolated subdirectory?

Second, if it is possible, am I approaching it the right way? (edit apache2.conf and use htdigest)?

Author:  tzoom84 [ Wed Feb 13, 2008 1:55 pm ]
Post subject: 

I found this link on apache describing how to have diverent virtual hosts running on seperate ports, or from different DNS entries. Maybe I'll just try that to keep them isolated complete. Does that seem to make better sense?

Author:  tzoom84 [ Wed Feb 13, 2008 9:08 pm ]
Post subject: 

Ok I played around more this evening and got it working. So to close it out (for reference to others) this is what I did:

Following: this tutorial, and this tutorial

1. Modified /etc/apache2/sites-available/default to only serve on port 80 (NameVirtualHost *:80, <VirtualHost *:80>

2. Moved the htdigest authentication block within <directory /> of /etc/apache2/apache2.conf into /etc/apache2/sites-available/default.

(This allows Apache to default to the main website when on port 80)

3. Create a new file /etc/apache2/sites-available/newsite, running only on port 81. (Following tutorials)

4. Used 'a2ensite newsite' to enable the site, and restarted apache

(+ some other tweaks)

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/