Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Server Admin - Apache aliases and cases



Whoa -

Just discovered that when you create an apache alias in Server Admin | Web | Sites | Settings | Aliases, then hit Save, it gets converted to lowercase regardless what case letters you type or paste in. So /Library/WebServer/Documents... becomes /library/ webserver/documents... The result is that some aliases return 403 Forbidden errors to the browser. Editing the site's config file manually and restarting apache leaves the case intact, and the alias works fine.

Here's the punchline: Not only does Server Admin change the case of the alias you're currently creating, but it lowercases ALL aliases in ALL config files in /etc/httpd/sites/* . So the fact that I created an alias on one site last night resulted in the webmaster of another site running off my server being woken up at 5am to hear that his site was broken.

I don't recall this happening before - is this a new bug in 10.4.6 or 10.4.7 (or did I just never hit a problem with this before)? For now I'm going to steer clear of Server Admin for this task and just create them manually when needed.

What I don't understand is why this should break sites - isn't HFS + case-respecting but case-insensitive? Is case sensitivity a separate apache option somewhere?

This is a really annoying problem that i have filed a bug report on. It has happened for as long as I can remember in 10.4.x since we have lots of aliases and some very detailed Apache configuration changes that are not exposed in the GUI. Here is why the problem this problem is likely occurring for you and others:


The 403 error is occurring because the "indexes" directive is not turned on for that particular folder. Basically this occurs when you load a folder, but there is no default file (like index.html, etc). If indexes is turned on it will show a directory listing, if it is not then it will 403. This is the default behavior because there is a directive in the httpd.conf file that looks like this:

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

This basically turns off all options (including directory listing etc.) for all folders. It is a good safety net and basically makes sure that you turn on options explicitly for necessary folders

THEN, you'll see a listing for the default root of the website. In the case of a virgin install it looks something like this:

<Directory "/Library/WebServer/Documents">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

I've filtered out the comments for brevity. Notice that it has turned on indexes for all subsequent folders from this root. And also MultiViews

The rub is that when you have something like this:

Alias foo /library/webserver/documents/abcd

Which creates the alias, Server admin (As you stated) uses all lower case regardless of what you typed in. HOWEVER this does not match up with the <Directory> directive shown earlier. This also CAN happen when you change the DocumentRoot.

The real issue is that though HFS is case-insensitive, so it will FIND the folder /library/webserver/documents and thus be able to load the file, Apache IS case sensitive when it comes to <Directory> directives. So in short, the <Directory "/Library/WebServer/ Documents"> directive never gets "processed" for that alias because it does not match the case "/library/webserver/documents"

This of course applies to any sort of <Directory> matching and options that you may include in that section, like indexes, directoryindex and other apache directives.

A solution (this would require changes to Apache) would be to have a directive that turns off case sensitivity for directory matching. Until then, you have to fix those things by hand and NEVER EVER touch the web panel of server admin. Bummer eh? I am unaware of such an option.

This issue makes using any apache install with Xsan require hand editing since Xsan volumes are case sensitive. OR always use lower case (which stinks if you have an existing mixed case deployment).

Hope this clears things up. Please file an additional bug report on this so it gets the attention it deserves!

-Pete-

Peter Akins
Applications Analyst & Adjunct Instructor
College of Design, Architecture, Art & Planning
University of Cincinnati

4425D Aronoff
[v] 513.556.0947
email@hidden


On Aug 30, 2006, at 2:25 PM, Scot Hacker wrote:


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/email@hidden

This email sent to email@hidden

References: 
 >Server Admin - Apache aliases and cases (From: Scot Hacker <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.