Uncategorized

Apache-2.2.10 / Chroot and cURL is giving me some grief (SOLVED)

So my woes with Apache-2.2.10 and chroot is continuing. Now I can start Apache in the chroot environment, and I thought all was well, but after additional testing, I found out that cURL does not work. Basically, cURL will return a empty string while it’s chroot’d. This is very weird to me, since the jail is EXACTLY the same as it was when mod_chroot was set up initially. This would mean the libraries should all be good still. I tested with the apache out of the jail and cURL works great. I’ve seen multiple mention of this problems, but usually related to https requests while in the jail. I’ve encountered those in the past (usually related to certs, urandom, etc missing from the jail). This problem is with straight http requests. I did find one very similar post here: http://kerneltrap.org/mailarchive/openbsd-misc/2007/3/21/146482/thread.

So my woes with Apache-2.2.10 and chroot is continuing. Now I can start Apache in the chroot environment, and I thought all was well, but after additional testing, I found out that cURL does not work. Basically, cURL will return a empty string while it’s chroot’d. This is very weird to me, since the jail is EXACTLY the same as it was when mod_chroot was set up initially. This would mean the libraries should all be good still. I tested with the apache out of the jail and cURL works great. I’ve seen multiple mention of this problems, but usually related to https requests while in the jail. I’ve encountered those in the past (usually related to certs, urandom, etc missing from the jail). This problem is with straight http requests. I did find one very similar post here: http://kerneltrap.org/mailarchive/openbsd-misc/2007/3/21/146482/thread. Of course, the thread died out without any resolution.

I went ahead and posted a thread on the Gentoo forums (http://forums.gentoo.org/viewtopic-p-5401286.html. Not expecting much, since this is more specific than the apache/chroot problem initially, which got zero follow ups. I also posted on the curl mailing list, I’m expecting some good replies here. I’ll add any follow-ups as they come. I’m sure there are a few people like me that are dealing with these problems.

—- UPDATE —–
Okay, I was able to figure out the problem. mod_chroot was calling a file load on the ifdefine

LoadFile /lib/libnss_dns.so.2

I added this to the main httpd.conf, and cURL works again. Talk about a pain in the ass.