|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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] |
|
#2
|
|||
|
|||
|
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] |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
>> ErrorDocument 401 /public/index.shtml
Oh yeah, I didn't notice that. That supposed to point to a file. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > Location access control: document contained no data |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|