Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error "Mis-cased URI or unacceptable Unicode in URI" in mod_hfs_apple after updating mac os x from 10.8.3 to 10.8.4

Tags:

macos

apache

I have set up a local development machine on my laptop with Apache/2.2.22 (Unix) DAV/2 PHP/5.3.15. Everything was working fine until I upgraded OS X. I kept getting a 403 error whenever I tried accessing my localhost server. I checked my apache error_log and found these entries.

[Mon Jun 24 14:48:30 2013] [error] [client ::1] mod_hfs_apple: Mis-cased URI or unacceptable Unicode in URI: /Users/Eugene/Sites/index.html, wants: /\xe2\x80\x9c/Users/Eugene/Sites/\xe2\x80\x9d/
[Mon Jun 24 14:48:30 2013] [error] [client ::1] mod_hfs_apple: Mis-cased URI or unacceptable Unicode in URI: /Users/Eugene/Sites/index.php, wants: /\xe2\x80\x9c/Users/Eugene/Sites/\xe2\x80\x9d/
[Mon Jun 24 14:48:31 2013] [error] [client ::1] mod_hfs_apple: Mis-cased URI or unacceptable Unicode in URI: /Users/Eugene/Sites/index.html, wants: /\xe2\x80\x9c/Users/Eugene/Sites/\xe2\x80\x9d/
[Mon Jun 24 14:48:31 2013] [error] [client ::1] mod_hfs_apple: Mis-cased URI or unacceptable Unicode in URI: /Users/Eugene/Sites/index.html, wants: /\xe2\x80\x9c/Users/Eugene/Sites/\xe2\x80\x9d/
[Mon Jun 24 14:48:31 2013] [error] [client ::1] mod_hfs_apple: Mis-cased URI or unacceptable Unicode in URI: /Users/Eugene/Sites/index.php, wants: /\xe2\x80\x9c/Users/Eugene/Sites/\xe2\x80\x9d/
[Mon Jun 24 14:48:31 2013] [error] [client ::1] mod_hfs_apple: Mis-cased URI or unacceptable Unicode in URI: /Users/Eugene/Sites/favicon.ico, wants: /\xe2\x80\x9c/Users/Eugene/Sites/\xe2\x80\x9d/

I managed to find a way around this by commenting out this line in httpd.conf

#LoadModule hfs_apple_module libexec/apache2/mod_hfs_apple.so

However, I realise that this is just a temporary hack and need to find a solution for this problem. Can someone help me out?

It seems like the mod_hfs_apple2.c file is adding \xe2\x80\x9c (“) and \xe2\x80\x9d (”) around the file names. Unicode characters got from here. This makes the request different from the DocumentRoot directory.

For example in my httpd.conf I have this

DocumentRoot "/Users/Username/Sites"

and this is the error I find after running tail error_log

[Mon Nov 18 19:51:35 2013] [error] [client ::1] mod_hfs_apple: Mis-cased URI or unacceptable Unicode in URI: /Users/Username/Sites/index.php, wants: /\xe2\x80\x9c/Users/Username/Sites/\xe2\x80\x9d/

The mod_hfs_apple2.c can be found here. Am not sure which version ships with maverick my current OS.

For now I keep the hack.

like image 592
Eugene Avatar asked Oct 04 '22 18:10

Eugene


1 Answers

I had this error too and found this:

http://software.techassistbox.com/error-mis-cased-uri-or-unacceptable-unicode-in-uri-in-modhfsapple-after-updating-mac-os-x-from-1083-to-1084_52942.html

In sum, comment out this line in httpd.conf:

#LoadModule hfs_apple_module libexec/apache2/mod_hfs_apple.so

It's a hack but it works.

like image 145
JLouback Avatar answered Oct 13 '22 00:10

JLouback