Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > .htaccess redirection for specific users

.htaccess redirection for specific users
Thread Tools
Junior Member
Join Date: Jul 2002
Location: Australia
Status: Offline
Reply With Quote
Jul 29, 2003, 07:21 PM
 
Hey all,
I'm using apache 2.x and I've set up my DocumentRoot as my home directory (/Users/syphor) and I have setup .htaccess so only I can access this directory, which in turn will only allow me to access the site.

I have set my httpd.conf file like this:

Code:
<Directory "/Users/syphor"> AuthUserFile /Users/syphor/.passwd AuthGroupFile /dev/null AuthName "Restricted Area" AuthType Basic require user matheos </Directory>
I was wondering if there is any way of making additional users with different doucment roots, something like this:

Code:
require user matheos if login=failed then redirect to www.apple.com require user nick if login=failed then redirect to www.apple.com
Has anyone got any ideas about how to implement this?
     
Senior User
Join Date: Aug 2002
Location: Oxford, England
Status: Offline
Reply With Quote
Jul 30, 2003, 06:36 AM
 
You might get a reply in a more suitable forum, Networking perhaps.
Luke
     
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status: Offline
Reply With Quote
Jul 30, 2003, 07:41 AM
 
First of all, is that actually working for you? The files in the Documents and Library subfolders should NOT be readable by all users, and hence not be readable by the Apache 'www' user.

Two ideas:

1. Run several instances of Apache, one as each user. (i.e. change httpd.conf to run not as 'www' but as syphor, matheos, nick, etc.) Each one would need to run on its own port.

That way you can read (and write to) all those documents.

You should consider implementing SSL, though, since as of now your password --and your files-- are sent in cleartext. It's trivial for anyone on the same network as your remote machine - a school, workplace, or internet cafe - to intercept your password and your files.

2. If for some reason you've granted Apache access to your Documents folders, then just use Virtual Hosts to set up several virtual servers, each with a different DocumentRoot.

A little googling will find you nice tutorials on virtual hosts.

good luck!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:15 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2