Parts of .htaccess not working anymore

wordpress

#1

I have a page on my site at /freeware, wiith .htaccess using fancy indexing to display a list of files for our clients and community. So we’re looking at a raw directory. Within the last couple weeks the icons stopped “working”. This has been working for a couple years now.

The .htaccess in our root path refers assigns icons like this (yes, with some overlaps):
AddIconByType (TXT,/icons/text.gif) text/*
AddIcon /icons/text.gif .txt
Our domain/icons path is linked via ln -s to /usr/share/apache/icons. So I’m using the DH icons rather than my own for this purpose.

The permissions on the link are lrwxrwxrwx.
From SSH I can cd to domain/icons and see all of the image files with -rw-r–r-- permissions.

If I try to browse to domain.com/icons/text.gif, I not only get an Apache 403 message that access is forbidden, but I also get this:
You don’t have permission to access /icons/text.gif on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

I’m using custom error pages and my 403 has never failed. I can force a 404 with domain.com/xyz.htm, and I see our custom 404.html page. I see 403.html and 404.html in the same directory with the same permissions.

So to recap, it seems HTTP can’t see some files as directed by .htaccess, but it can others.

I’m REALLY CONFUSED!

I’m guessing someone changed the way Apache is processing .htaccess or permissions. Were there any recent code changes, patches, upgrades, shuffling of domains…? We’re on ‘seltzer’, nothing has changed here…

TIA!


#2

I haven’t experimented with icons, and a good search of these forums for the last year for terms including: apache icons directory listing (or some combination of these) should turn up some info.

However, linking something inside your web directory to something outside your web directory seems like something that shouldn’t get found by Apache. Why not just copy the apache icons into your web directory instead of using a link?

By the way, custom error pages need their own filenames, unless you’ve specified otherwise.
http://wiki.dreamhost.com/Creating_custom_error_pages

-Scott


#3

Thanks, but you missed the part where everything has been working for at least a year and then suddenly it wasn’t. Of course my 403 and 404 and other error pages are separate. And 404’s are working but 403’s not, yet the file permissions are the same.

Now that I think about it, by the very nature of an error 403 it’s possible that those can’t be rendered when there is an error. I’ll look into that. It’s like a Server Error 500. If the server was functional to give you a custom page it would probably be functional enough to avoid throwing that particular error. (No, I don’t have a 500.html).

As to why not just copy all the icons? The short answer for the long-term is that I’m using a supported feature., and even for this small set of files, copying them is just a waste of disk and just more files for us to backup and lug around.

For a longer answer, I wish we had more opportunities to link to files so that we didn’t all need to clone the exact same data which winds up in cache on both clients and servers. It’s a major waste of resources. If just making a copy of files where a good solution, why not just create a new instance of Apache for every domain? Why not put a completely unique /etc and /var under every /home? Of course that’s ridiculous - so why should I have the exact same Wordpress vX.Y, the exact same Drupal 6.2, and the exact same Gallery2 that a hundred other sites on my server have? No, copying files when it’s not necessary is cumbersome - and very “un-green”.

As for just copying the files now - if I just work around this issue, there might be a lot of other DH users who could trip on something similar - and maybe none, who knows? Sure, I can fix “my” problem, but 1) I shouldn’t have to, and 2) that could only defer other problems that I and others won’t want to fix later.

I’ll give this a few days here but without any solutions I’ll put in a support ticket.


#4

I didn’t miss the part about it working in the past. That’s why I mentioned the part about symbolic links to outside your webspace. I’d think that would be a security risk, and perhaps they closed that hole.

Did you do the search in the forums (or Google) for directory listings with icons? I don’t recall seeing people linking outside their directory to use these. There may be a more elegant way to select specific icons for other extensions that doesn’t require you to have your own copy of them.

-Scott


#5

Yes, we made a change recently that would break what you were doing.

In this case it’s just a single file and it’s small so you should just copy it into your own web directory.

  • Dallas
  • DreamHost Head Honcho/Founder

#6

Dallas - I can’t tell you how heart warming it is to get a concise clarification of the situation. The problem is resolved - that’s the way things should work.

When you say “file” I trust you mean folder. No response required if that’s he case. For anyone else doing something similar, I did the following:

mkdir icons2
cp icons icons2
mkdir icons2/small
cp icons/small/* icons2/small
rm icons
mv icons2 icons

Sure, it’s easy to copy, but more elegant not to. :slight_smile:

I don’t know about the issue with my 403.html but I’m happy with what I’ve received here.

Thanks.


#7

Oh, I thought you only needed the icon for .txt files. If you need 'em all, copy 'em all! :sunglasses:

Here’s our list of ErrorDocument lines…

ErrorDocument 500 /internal_error.html
ErrorDocument 404 /missing.html
ErrorDocument 403 /forbidden.html
ErrorDocument 401 /failed_auth.html

Are you saying the 403 one doesn’t work?

  • Dallas
  • DreamHost Head Honcho/Founder

#8

The verbatim error from the link to icons was this:
[color=#0000CC]You don’t have permission to access /icons/text.gif on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.[/color]

I can force a 403 on my own domain and get my own error page, by trying to access a directory that has Options -Indexes and no valid directoryindex page. So I can see my own 403 and it seems the error above is telling us it can’t see your forbidden.html.

HTH


#9

That’s strange that it’d be looking for a forbidden.html other than your own. We’ll have to look into that.

  • Dallas
  • DreamHost Head Honcho/Founder