You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jim Byrne <ji...@glasgowwestend.co.uk> on 2003/12/10 23:03:18 UTC

Re: [users@httpd] apache on raq4 .htaccess and standard erorr behaviour not working.

on 12/10/03 8:40 AM, Boyle Owen at Owen.Boyle@swx.com wrote:
 
> So that's a Sun server with a Linux kernel, right? What apache is it
> running? 

Hi Owen,

Yes Sun server running Linux Kernel - I'm running Apache 1.3.20.

> 
>> - and the first time I tried to use
>> .htaccess to protect a
>> directory on my server, it did not work.
> 
> First, you *do* know that you can password-protect a directory without
> .htaccess? You can simply put the Auth directives directly into
> httpd.conf inside a <Directory> container. This is a good debug step
> since it eliminates problems with reading the .htaccess file. Try that -
> what happens?

I haven't tried that - because I wasn't exactly sure where to put the
directives in the http.conf file. I read many times I could do that - but I
haven't seen any examples.

> 
>> When trying to 
>> access the directory
>> via the browser I was getting an error dialog saying,
>> 'document contains no
>> data' (Netscape), or attempt to load accessing URL http... failed
>> (Explorer).
> 
> What do you get in the access log and error log?

Here are the logs.

Asking for a file that doesn't exist:

access log
www.glasgowwestend.co.uk 62.252.128.10 - - [10/Dec/2003:20:37:11 +0000] "GET
/asdf HTTP/1.1" 404 - "-" "Mozilla/5.0 (Macintosh; U; PPC; en-US; rv:1.0.2)
Gecko/20021120 Netscape/7.01"

error log:
[Wed Dec 10 20:37:11 2003] [error] [client 62.252.128.10] File does not
exist: /home/sites/site4/web/asdf

Asking for a file in a directory with .htaccess:
www.glasgowwestend.co.uk 62.252.128.10 - - [10/Dec/2003:20:43:11 +0000] "GET
/mymail/admin/ HTTP/1.1" 401 - "-" "Mozilla/5.0 (Macintosh; U; PPC; en-US;
rv:1$

There is no entry in the error log related to the .htaccess failure, that I
can find.

> 
>> 
>> After spending time on the Yahoo Raq forum I confirmed that
>> the .htaccess
>> file itself was not the problem (it was created correctly and had the
>> correct priveleges and so on) - it seems to be a problem with
>> apache itself.
> 
> There's a lot more to getting .htaccess to work than setting the file
> privileges and so on. The main difficulty people usually have is in
> configuring apache correctly to allow it to read the .htaccess file. Did
> you achieve this? In what way did you "confirm" that the problem was
> with apache?
> 
>> When the browser tries to access a file that does not exist,
>> I do not get
>> the standard 404 response - but get the same error messages as when
>> accessing a directory containing a .htaccess file (either
>> 'document contains
>> no data, or attempt to load accessing URL failed' depending
>> on browser)
> 
> Why do you think this message has something to do with the .htaccess
> mechanism? It seems it is more like a network error in a complex setup
> (one server proxying another and getting no response).
> 
> What happens when you request a non-existent file from a directory
> *without* .htaccess?

That is what I am saying above - when I try to access a non-existent file
from a directory without .htacces, I get the same error message.

> 
>> 
>> The following report back when trying to access a
>> non-existent file on my
>> server using links may be of use to an expert Apache debugger:
>> 
>> lynx -source -dump http://www.glasgowwestend.co.uk/fdj
>> Looking up www.glasgowwestend.co.uk.
>> Making HTTP connection to www.glasgowwestend.co.uk.
>> Sending HTTP request.
>> HTTP request sent; waiting for response.
>> Alert!: Unexpected network read error; connection aborted.
> 
> I'm not an expert Apache debugger but this looks like a network read
> error to me. Can you telnet on port 80 to the machine (command-line
> HTTP)? Can you ping it?
> 
>> Can't Access `http://www.glasgowwestend.co.uk/fdj'
>> Alert!: Unable to access document.
>> lynx: Can't access startfil
>> 
>> I have looked at the Apache configuration file to see if I
>> could notice any
>> obvious mistakes, but I didn't see anything - though I'm not
>> experienced
>> enough to know what to look for.
>> 
>> Any help with this problem would be much appreciated as it has been
>> unresoved for quite some time.
> 
> PS: Is your pub correspondent *really* called Roy Beers?

Yes, that's his real name :-)

Thanks,
Jim


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] apache on raq4 .htaccess and standard erorrbehaviour not working.

Posted by Jim Byrne <ji...@glasgowwestend.co.uk>.
Hi, Thanks for your reply. I did add the my Authentication message to the
httpd.conf file (I assume I was not to put the info in the Virtual Site
part?) - but it made not difference  - I still get 'Document contains no
data'.

I looked up this phrase in Google but I didn't see anythign that seemmed to
relate to the problems I have been having.

All the best,
Jim

on 12/11/03 6:50 AM, Robert Andersson at robert@profundis.nu wrote:

> Jim Byrne wrote:
>> I haven't tried that - because I wasn't exactly sure where to put the
>> directives in the http.conf file. I read many times I could do that - but
> I
>> haven't seen any examples.
> 
> Simple, just do it like this:
> 
> <Directory /home/sites/site4/web>
> AuthType Basic
> AuthName "Super Secret Stuff"
> AuthUserFile /wherever/you/might/have/userpasswd
> Require valid-user
> </Directory>
> 
> About your original problem, I seem to recall previous discussions regarding
> Netscape's "document contains no data" error. Have you googled that phrase,
> or searched the archives for it?
> 
> Regards,
> Robert Andersson
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

-- 
My recommended eBook: 'Accessible Web Typography - an introduction for web
designers' at http://www.scotconnect.com/webtype.php


Pat's Guide to Glasgow West End: http://www.glasgowwestend.co.uk
Flathunting: http://www.glasgowwestend.co.uk/flathunting/



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] apache on raq4 .htaccess and standard erorrbehaviour not working.

Posted by Robert Andersson <ro...@profundis.nu>.
Jim Byrne wrote:
> I haven't tried that - because I wasn't exactly sure where to put the
> directives in the http.conf file. I read many times I could do that - but
I
> haven't seen any examples.

Simple, just do it like this:

    <Directory /home/sites/site4/web>
        AuthType Basic
        AuthName "Super Secret Stuff"
        AuthUserFile /wherever/you/might/have/userpasswd
        Require valid-user
    </Directory>

About your original problem, I seem to recall previous discussions regarding
Netscape's "document contains no data" error. Have you googled that phrase,
or searched the archives for it?

Regards,
Robert Andersson


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org