The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Deny dba command to a user group!! masquerer UNIX for Dummies Questions & Answers 3 06-20-2007 10:58 AM
Help With CGI Scripts and .htaccess crazycelicagts UNIX for Dummies Questions & Answers 6 08-01-2002 07:45 AM
htaccess _hp_ Security 1 06-24-2002 10:19 PM
.htaccess Avenger UNIX for Dummies Questions & Answers 3 04-12-2002 11:49 AM
.htaccess? Puc conDoin UNIX for Dummies Questions & Answers 1 05-28-2001 08:58 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-18-2006
stand stand is offline
Registered User
  
 

Join Date: Mar 2006
Location: aUSTIN, tEXAS
Posts: 4
.htaccess deny user

Hi,
I have installed an .htacess file on my server that includes the IP addresses of any user I have caught attempting a DDoS, unix command, file command, mysql commands or hidden perl script execution.

ErrorDocument 403 /403.html
order allow,deny
deny from xxx.xxx.xxx.xx
allow from all

The interesting thing is that the ErrorDocument statement is apparently redundent and since the IP address is denied the 403.html display is also denied!

How is this error page used? Does it only work if I put the 403.html in a higher directory than the .htaccess?

Like:
ErrorDocument 403 ../403.html

Regards,
Stan
  #2 (permalink)  
Old 03-19-2006
Neo's Avatar
Neo Neo is offline Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,686
Not sure what you mean. ErrorDocument just specifies document. Permissions are not directly related, except that a 403 (access denied) error produces a 403 ErrorDocument.


Likewisel, you don't put access directives under an ErrorDocument directive.
  #3 (permalink)  
Old 03-19-2006
stand stand is offline
Registered User
  
 

Join Date: Mar 2006
Location: aUSTIN, tEXAS
Posts: 4
Message

What I mean is I get this message; only this one is for a 404 error. I didn't want to deny myself to show the actual 403 message.
Quote:
Not Found
The requested URL /foo.html was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
I am thinking that the 403.html cannot be accessed because the IP is Denied all access even to the 403.html.

Are you also saying that the ErrorDocument directive should be under the access directives? Or are they mutually exclusive?

Thanks, by the way for responding. I know I have a lot to learn.

Stan D
  #4 (permalink)  
Old 03-19-2006
Neo's Avatar
Neo Neo is offline Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,686
No, what I am saying is that the ErrorDocument directive points to an error document, and nothing more. You are confusing assess directives with document directives, and I am not sure why.

The Apache documents are pretty clear on this, for example:

http://httpd.apache.org/docs/1.3/custom-error.html
  #5 (permalink)  
Old 03-20-2006
stand stand is offline
Registered User
  
 

Join Date: Mar 2006
Location: aUSTIN, tEXAS
Posts: 4
I think I do understand that the ErrorDocument 403 /403.html points to a html document that will be called when a 403 error is generated instead of the hard coded error message of "access denied". I have an html page for 404 errors that works when the user requests a non-existent page. It tells the user that the page is not there and provides a link to the home page.

What I'm attempting to understand is how to display my own error message for a "403" error; access denied to a certain IP address. It is my understanding that you deny access with the line: deny from xxx.xxx.xxx.xx
Where the x's are a valid IP address. In fact this works and the requesting machine with that IP addess is indeed presented with the server's hard coded message of 403, access denied.
BUT it also adds that in addition there was an error in attempting to present the 403.html page that I have custom designed with information to the user as to how to get reinstated or removed from the deny list.

So my error document statement works for the 404 error, but not the 403 error.

Sorry to keep posting here, but I'm still not clear as to how one would use a ErrorDocument 403 to replace the hard coded message and to exclude an IP address. The "deny from xxx.xxx.xxx.xx" does generate the 403 error, but the 403.html does not display.

How would you do this task? Maybe an example would be clearer. I did read the info on the link provided.

Regards,
Stan
  #6 (permalink)  
Old 03-20-2006
stand stand is offline
Registered User
  
 

Join Date: Mar 2006
Location: aUSTIN, tEXAS
Posts: 4
Never mind

Never mind I got it working. The problem was in my html, not my thinking. I do understand how it's supposed to work!

It should work as I described and in fact it does. A banned IP address now gets my 403.html message as does someone who attempts to det a directory listing.

SD
Closed Thread

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:14 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0