SunQuest
           Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old February 27th, 2001, 10:12 PM
Greg Bryant Greg Bryant is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: Wellington
Posts: 14 Greg Bryant User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Location access control: document contained no data

Hi I'm having trouble setting up authorisation on a virtual name host. I have an alias which is above the document root which i want to be open to the public, and the rest of the site to be password protected. However with the configuration below the http://name.company.co.nz/public/ area is public but when i point my browser at http://name.company.co.nz/ the browser returns "document contained no data" and the access_log shows a 401 error.

If i remove the <Location /public/> ... </Location> section from the configuration the password protected part of the site works as expected, but of course you still require a password to access the /public/ area, which is not what i want.

Can anyone please give me a hint as to what i am doing wrong?


<VirtualHost 123.456.789.10>
ServerName name.company.co.nz
ServerAdmin greg.bryant@company.co.nz
DocumentRoot /www/html

Alias /perl-scripts/ /www/html/perl-scripts/
Alias /public/perl-scripts/ /www/public/perl-scripts/
Alias /public/ /www/public/
Alias /incl/ /www/html/incl/

<Location />
Options IncludesNOEXEC
AllowOverride None
Order allow,deny
Deny from all
AuthName "Extranet"
AuthType Basic
AuthUserFile /www/auth/allusers
Require valid-user
Satisfy any
</Location>

<Location /mgmt/>
Options IncludesNOEXEC
Order allow,deny
Deny from all
AuthName "Management Area"
AuthType Basic
AuthUserFile /www/auth/allusers
AuthGroupFile /www/auth/allgroups
Require group mgmt
Satisfy any
</Location>

<Location /public/>
Options IncludesNOEXEC
AllowOverride None
Order deny,allow
Allow from all
</Location>

<Location /perl-scripts/>
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
</Location>

<Location /public/perl-scripts/>
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
</Location>

ErrorDocument 401 /public/

</VirtualHost>

[Edited by Greg Bryant on 02-27-2001 at 09:36 PM]

Reply With Quote
  #2  
Old February 28th, 2001, 06:20 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
First off, you are using Satisfy incorrectly. Start here -> http://httpd.apache.org/docs/mod/core.html#satisfy

To use Satisfy directive, you need to check the following lines in bold:

<Location />
Options IncludesNOEXEC
AllowOverride None
Order deny,allow
Deny from all
Allow from 111.222.333.444 # replace it with your IP, the value of REMOTE_ADDR.
AuthName "Extranet"
AuthType Basic
AuthUserFile /www/auth/allusers
Require valid-user
Satisfy any
</Location>

Since you have multiple <Location> blocks, you must use <LocationMatch> with regex instead.

i.e.

<LocationMatch ^/public/perl-scripts/$>
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
</LocationMatch>

Also, <Location> or <LocationMatch> will slow down Apache significantly. You probably want to reduce the number of that by removing perl-scripts from your Location block. BTW, mod_perl doesn't need to be executed within a directory, you can enable it globally so to reduce the number of <LocationMatch> to speed things up:

<LocationMatch ^/>
Options IncludesNOEXEC +ExecCGI
AddHandler perl-script .pl
PerlHandler Apache::Registry
..
</LocationMatch>

With this, <LocationMatch ^/perl-scripts/$> and <LocationMatch ^/public/perl-scripts/$> are no longer needed. The downside is to enable ExecCGI globally.

Also be sure to remove .pl from AddHandler cgi-script .cgi .pl if you use AddHandler perl-script .pl.

[Edited by freebsd on 02-28-2001 at 07:05 PM]

Reply With Quote
  #3  
Old February 28th, 2001, 08:12 PM
Greg Bryant Greg Bryant is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: Wellington
Posts: 14 Greg Bryant User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for that,
I managed to get it going last night (before i had your reply) by reordering the Location sections and changing the
ErrorDocument 401 /public/
to
ErrorDocument 401 /public/index.shtml

But it seemed pretty dodgy, so i will change to the LocationMatch directives.

Thanks for the advice.

Reply With Quote
  #4  
Old February 28th, 2001, 08:24 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> ErrorDocument 401 /public/index.shtml

Oh yeah, I didn't notice that. That supposed to point to a file.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Location access control: document contained no data


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway