View previous topic :: View next topic |
Author |
Message |
hanj Veteran
Joined: 19 Aug 2003 Posts: 1500
|
Posted: Sun Jan 18, 2009 8:59 pm Post subject: Problem with Apache-2.2.10 in chroot and cURL [SOLVED] |
|
|
Hello All
After my recent issue chroot'ing apache-2.2.10 with mod_chroot (explained in detail here: https://forums.gentoo.org/viewtopic-t-725855-highlight-apache+chroot.html), I'm running into another problem related. This problem is related to cURL in the chroot'd environment. I'd like to clarify a few things..
- This was working perfectly with apache-2.2.9-r1 and mod_chroot-0.5
- My cURL request is NOT using SSL, eventhough I do have other examples there, and have included various ssl/cert packages in my jail
Basically, the result is this. When making a cURL via PHP request, nothing happens. No errors in the logs, no errors generated from PHP, but I get a empty return from curl_exec(). If I take Apache out of the jail, then it works. I also ran strace on this process, and did not see anything unusual regarding cURL. I do see it loading the so though..
Code: | 13860 open("/usr/lib/libcurl.so.4", O_RDONLY) = 5
13860 open("/usr/lib/libcurl.so.4", O_RDONLY) = 7 |
Here is a snip of my cURL call:
Code: | $ch = curl_init();
$timeout = 5;
curl_setopt ($ch, CURLOPT_URL, $rest);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch); |
So $file_contents is always empty within the chroot jail. Again, this was working perfectly with mod_chroot, and mod_security before that in chroot jail. Not sure what I need to do to get this working.
Thanks in advance!
hanji _________________ Server Admin Blog - Uno-Code.com
Last edited by hanj on Tue Jan 27, 2009 3:11 am; edited 1 time in total |
|
Back to top |
|
|
Thaidog Veteran
Joined: 19 May 2004 Posts: 1053
|
Posted: Mon Jan 19, 2009 2:42 pm Post subject: |
|
|
Bumped bc URGENT (you did have a backup right? - I use VMware snapshots when I am trying upgrades out... works perfectly) _________________ Registered Linux User: 437619
"I'm a big believer in technology over politics" - Linus Torvalds |
|
Back to top |
|
|
hanj Veteran
Joined: 19 Aug 2003 Posts: 1500
|
Posted: Mon Jan 19, 2009 3:13 pm Post subject: |
|
|
Thaidog wrote: | Bumped bc URGENT (you did have a backup right? - I use VMware snapshots when I am trying upgrades out... works perfectly) |
Hello
If need be I can roll back to apache-2.2.9-r1 and get it back to where it needs to be. For the immediate moment, I'm running 2.2.10, but not chroot'd.
So are you having the same problem?
Thanks!
hanji _________________ Server Admin Blog - Uno-Code.com |
|
Back to top |
|
|
Thaidog Veteran
Joined: 19 May 2004 Posts: 1053
|
Posted: Tue Jan 20, 2009 5:30 pm Post subject: |
|
|
hanj wrote: | Thaidog wrote: | Bumped bc URGENT (you did have a backup right? - I use VMware snapshots when I am trying upgrades out... works perfectly) |
Hello
If need be I can roll back to apache-2.2.9-r1 and get it back to where it needs to be. For the immediate moment, I'm running 2.2.10, but not chroot'd.
So are you having the same problem?
Thanks!
hanji |
no I have never set up a chroot apache... but I would be interested in knowing how on Gentoo. _________________ Registered Linux User: 437619
"I'm a big believer in technology over politics" - Linus Torvalds |
|
Back to top |
|
|
hanj Veteran
Joined: 19 Aug 2003 Posts: 1500
|
|
Back to top |
|
|
hanj Veteran
Joined: 19 Aug 2003 Posts: 1500
|
Posted: Sun Jan 25, 2009 7:04 pm Post subject: |
|
|
Hello
The problem persists. Emailing the cURL mailing list and getting a response from Daniel Stenberg is leading to a dead end. Here was his response to my problem:
Quote: | I sounds like some sort of problem with PHP and its CURL module. |
Very helpful.... I think it's related to missing libraries or apache hooks out/in from the jail regarding libcurl. I posted a bug as well.
https://bugs.gentoo.org/show_bug.cgi?id=256275
I'll see if I can find some support at a Apache list some where. Seriously, am I the only person running Apache in chroot in this forum?
hanji _________________ Server Admin Blog - Uno-Code.com |
|
Back to top |
|
|
hanj Veteran
Joined: 19 Aug 2003 Posts: 1500
|
Posted: Tue Jan 27, 2009 3:10 am Post subject: |
|
|
This is now fixed. Looking at the mod_chroot, I saw that it was loading a file on start up. I added this to httpd.conf, and all is good again.
Code: |
LoadFile /lib/libnss_dns.so.2 |
hanji _________________ Server Admin Blog - Uno-Code.com |
|
Back to top |
|
|
Thaidog Veteran
Joined: 19 May 2004 Posts: 1053
|
Posted: Tue Jan 27, 2009 8:34 pm Post subject: |
|
|
hanj wrote: | This is now fixed. Looking at the mod_chroot, I saw that it was loading a file on start up. I added this to httpd.conf, and all is good again.
Code: |
LoadFile /lib/libnss_dns.so.2 |
hanji |
Ah Good to see you got that fixed! _________________ Registered Linux User: 437619
"I'm a big believer in technology over politics" - Linus Torvalds |
|
Back to top |
|
|
|