Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem with Apache-2.2.10 in chroot and cURL [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Sun Jan 18, 2009 8:59 pm    Post subject: Problem with Apache-2.2.10 in chroot and cURL [SOLVED] Reply with quote

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
View user's profile Send private message
Thaidog
Veteran
Veteran


Joined: 19 May 2004
Posts: 1053

PostPosted: Mon Jan 19, 2009 2:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Mon Jan 19, 2009 3:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
Thaidog
Veteran
Veteran


Joined: 19 May 2004
Posts: 1053

PostPosted: Tue Jan 20, 2009 5:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Tue Jan 20, 2009 5:50 pm    Post subject: Reply with quote

Thaidog wrote:

no I have never set up a chroot apache... but I would be interested in knowing how on Gentoo.


Here are some articles I put together. Problem is that it only works (still having problems w/cURL) with < apache-2.2.10

How to create Chrooted Apache with mod_chroot
Apache-2.2.10 + Mod_chroot-0.5 causes startup problems.
php's mail() in apache chroot

I posted on the cURL mailing list, but not getting any replies.

hanji
_________________
Server Admin Blog - Uno-Code.com
Back to top
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Sun Jan 25, 2009 7:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Tue Jan 27, 2009 3:10 am    Post subject: Reply with quote

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
View user's profile Send private message
Thaidog
Veteran
Veteran


Joined: 19 May 2004
Posts: 1053

PostPosted: Tue Jan 27, 2009 8:34 pm    Post subject: Reply with quote

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! 8)
_________________
Registered Linux User: 437619
"I'm a big believer in technology over politics" - Linus Torvalds
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum