file name too long error on OpenBSD
最近在OpenBSD自带的Apache1.3上总是碰到类似下面这样的错误。
[Wed Dec 28 14:15:51 2011] [error] [client 10.249.70.50] (63)File name too long: Cannot map GET /media/ajax/component/boxList/filter/featured/limit/all/layout/thumbBig/vars/a%253A25%253A%257Bs%253A3%253A%2522act%2522%253Bs%253A7%253A%2522boxList%2522%253Bs%253A3%253A%2522mod%2522%253Bs%253A5%253A%2522media%2522%253Bs%253A4%253A%2522mode%2522%253Bs%253A3%253A%2522all%2522%253Bs%253A6%253A%2522filter%2522%253Bs%253A8%253A%2522featured%2522%253Bs%253A5%253A%2522limit%2522%253Bs%253A3%253A%2522all%2522%253Bs%253A6%253A%2522layout%2522%253Bs%253A8%253A%2522thumbBig%2522%253Bs%253A6%253A%2522search%2522%253Bs%253A0%253A%2522%2522%253Bs%253A8%253A%2522per_page%2522%253Ba%253A3%253A%257Bs%253A8%253A%2522thumbBig%2522%253Bi%253A6%253Bs%253A5%253A%2522thumb%2522%253Bi%253A10%253Bs%253A4%253A%2522list%2522%253Bi%253A4%253B%257Ds%253A11%253A%2522show_filter%2522%253Bb%253A1%253Bs%253A10%253A%2522show_limit%2522%253Bb%253A0%253Bs%253A11%253A%2522show_layout%2522%253Bb%253A1%253Bs%253A11%253A%2522show_search%2522%253Bb%253A0%253Bs%253A10%253A%2522show_pager%2522%253Bb%253A0%253Bs%253A9%253A%2522show_more%2522%253Bb%253A1%253Bs%253A9%253A%2522save_page%2522%253Bb%253A1%253Bs%253A10%253A%2522pager_name%2522%253Bs%253A4%253A%2522page%2522%253Bs%253A9%253A%2522thumbsize%2522%253Bs%253A7%253A%2522160×120%2522%253Bs%253A9%253A%2522more_link%2522%253Bs%253A10%253A%2522media%252Flist%2522%253Bs%253A2%253A%2522id%2522%253Bs%253A9%253A%2522media-box%2522%253Bs%253A9%253A%2522component%2522%253Bs%253A7%253A%2522boxList%2522%253Bs%253A4%253A%2522type%2522%253BN%253Bs%253A4%253A%2522text%2522%253BN%253Bs%253A13%253A%2522captionParams%2522%253Ba%253A0%253A%257B%257Ds%253A7%253A%2522caption%2522%253Bs%253A9%253A%2522New%2Bmedia%2522%253Bs%253A4%253A%2522page%2522%253Bi%253A1%253B%257D HTTP/1.1 to file, referer: http://host
折腾了两周时间,最后发现是OpenBSD上的最长路径参数引起的。OpenBSD上路径最长默认为1024字节。Linux上则是4096。所以同样的web应用在Ubuntu+Apache2上没有问题,但在OpenBSD上就不行。
最后修改了下面两个文件,将PATH_MAX从原来的1024改为2048,然后重新编译内核后解决问题。
./sys/sys/syslimits.h:46:#define PATH_MAX 2048 /* max bytes in pathname */
./include/stdio.h:187:#define FILENAME_MAX 2048 /* must be <= PATH_MAX <sys/syslimits.h> */
./include/stdio.h:193:#define L_tmpnam 2048 /* XXX must be == PATH_MAX */
可参看http://jiarun.org/newpostinthread3083.html来了解整个过程
No comments yet.