Interesting 403 issue.

Place to discuss Fedora and/or Red Hat
Post Reply
ZiaTioN
administrator
administrator
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm
Contact:

Interesting 403 issue.

Post by ZiaTioN » Thu Jun 29, 2006 9:34 pm

I have setup a .htaccess file for my website and symlinked to it from my scriptalias directory. Now when I ban my ip address and access the main page I get a 403 but I also get a 404 document not found when trying to show one of my custom error pages. When I try and access any script in my script alias directory I get the proper error page.

I looked in my log files and saw that when I access the main page, apache looks for a "noindex.html" file saying that it can not find an index page? Of course I did not have one in my custom error file directory so I got the 404 error. Why would this happen when I try and access the index file on the docroot and not when I access any script in my script alias dir?

I know the redirect to the custom error files work properly, I just do n ot know why apache thinks there is noindex file when I try to access the docroot and not the script alias.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5712
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Thu Jun 29, 2006 10:38 pm

Hmmmm, I'm not sure I completely understand your issue, but it is late and I'm tired. Maybe you can give some more specifics and I'll look at it tomorrow if you don't already have it figured out.

ZiaTioN
administrator
administrator
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm
Contact:

Post by ZiaTioN » Fri Jun 30, 2006 5:53 am

Sure,

with my ip address banned, when I access the main website page it does restrict my access because of the ban and tries to show the 403 error page. The error page it tries to show is "noindex.html" which is weird because I have the 403 error showing a page called 403.html.

When I access any other part of the site (not the main index page) I still get banned but nowe I see the proper 403.html page. I just want to know why apache tries to show the noindex.html page when I try and access the main page of the site but shows the proper error page when I access any other part of the site.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5712
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Fri Jun 30, 2006 8:18 am

Could you post your apache config and htaccess file (or ftp them to my server)?

moto526
scripter
scripter
Posts: 99
Joined: Tue Jun 13, 2006 11:59 pm
Location: California
Contact:

Post by moto526 » Fri Jun 30, 2006 8:21 am

Maybe that is the default page the server sends to banned IP's. That way you can make that the noindex.html page say what you want so the banned member can see they are banned.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5712
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Fri Jun 30, 2006 8:34 am

moto526 wrote:Maybe that is the default page the server sends to banned IP's. That way you can make that the noindex.html page say what you want so the banned member can see they are banned.
That's the entire point of the 403 error message and associated 403 error page (of which custom error pages can be defined in the apache config). The default 403 error page in my Apache config is "/error/noindex.html":
http://voidmain.is-a-geek.net/error/noindex.html

This is defined in /etc/httpd/conf.d/welcome.conf:

Code: Select all

#
# This configuration file enables the default "Welcome"
# page if there is no default index page present for
# the root URL.  To disable the Welcome page, comment
# out all the lines below.
#
<LocationMatch "^/+$">
    Options -Indexes
    ErrorDocument 403 /error/noindex.html
</LocationMatch>
So, maybe this file is the one tripping you up. You could remove it or point it to your custom 403 file.

ZiaTioN
administrator
administrator
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm
Contact:

Post by ZiaTioN » Fri Jun 30, 2006 7:32 pm

Void Main wrote:Could you post your apache config and htaccess file (or ftp them to my server)?
Sure pm me the ftp server info...

User avatar
Void Main
Site Admin
Site Admin
Posts: 5712
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Fri Jun 30, 2006 7:43 pm

Just ftp to voidmain.is-a-geek.net and log in anonymously. Upload to /uploads which can only be written to (can not read/list files in there).

ZiaTioN
administrator
administrator
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm
Contact:

Post by ZiaTioN » Fri Jun 30, 2006 7:51 pm

Void Main wrote:Just ftp to voidmain.is-a-geek.net and log in anonymously. Upload to /uploads which can only be written to (can not read/list files in there).
Yeah sorry, I figured that out. They are already there.

ZiaTioN
administrator
administrator
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm
Contact:

Post by ZiaTioN » Sun Jul 02, 2006 6:52 pm

Let me know if these files came through or not. I am not sure if they were sent since I could not view the directory. The session said successful but who knows.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5712
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Sun Jul 02, 2006 8:00 pm

Yeah I got them and I looked at them a little, then I went to your site and had to turn off JavaScript to prevent all the popups from smacking me in the face. :) Every time I start looking at your situation I keep getting side tracked.

ZiaTioN
administrator
administrator
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm
Contact:

Post by ZiaTioN » Sun Jul 02, 2006 10:00 pm

Yeah don't worry about it. I have had it working since before I posted the issue here. I can always come up with work arounds, was just curious as to why the problem existed in the first place.

Besides visting the site is not going to tell you anything unless I ban your IP.

Post Reply