Re: Rather complex question about chroot and suexec

Ben Chabot <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
Well, I have mod_fascgi using an suexec wrapper and chroot'ing setting 
UID.  They are both working, but when I run scripts with FastCgiWrapper 
set to suexec, I get "No input file specified".. when I strace the 
running php-fcgi process, I see it's still looking for the full path, 
even though the environment variable is rewritten in my suexec wrapper...

So... can anyone PLEASE shed some light on what you have to do to 
chroot() dynamic processes... I'm so close, but missing somewhere in the 
code where I need to set the correct paths to everything works right.  
I'm certain one of the developers could at least give me an idea of the 
flow of a request through apache, the module, the process manager, the 
wrapper and the php binary.  So perhaps I could figure out what I need 
to fix to get this to work right.

Thank you very much,
Ben


Ben Chabot wrote:
> Hello!
>
> I'm not really sure how, or if, I could get this to work.  I've tried 
> installing mod_fastcgi, but I have a feeling, it won't work like that 
> with my setup.  Basically, I have lots of virtualhosts, in a structure 
> like /www/h/o/host.com/ and through suexec and sshd.. etc they are 
> chrooted there.  They just see their own /html /etc /bin... etc.
>
> They all have their own copy of php, which as I'm sure you can 
> imagine, is very slow when it's hit very quickly.  FastCGI appears to 
> me to be a good solution, ostensibly I could keep my current setup, 
> but I'm not quite sure how to do it.  I don't think mod_fastcgi 
> handles the requests for .php files after it goes through suexec (it 
> doesn't appear to, I've run scripts through php CGI/FastCGI and it 
> doesn't make requests back to the server I have setup in httpd.conf 
> and listening on port 9000)
>
> Hopefully that's enough background, I have two questions :
>
> 1) Is there any way I can run a local copy of php (and perl) listening 
> on a local port for FastCGI requests and some kind of wrapper in the 
> chroot, so that all my vhosts use the same installation of php?  (I do 
> this for sendmail, as you can't have a sendmail in every chroot, so 
> there is a wrapper, that takes sendmail command line and in turn sends 
> it to 127.0.0.1:25.)
>
> 2) If #1 is plausible (hints or examples would be _greatly_ 
> appreciated!) then how do I maintain the chroot?  Is that even 
> possible?  Would I have to run a separate process for each vhost?  How 
> could I still chroot the scripts to their home directory while reaping 
> the benefits of using FastCGI?
> I'm really at a loss, I'm not really sure how all these separate 
> elements tie together, I'd be very grateful if someone could 
> illuminate my understanding of how this might (or might not) work.
>
> Thank you very much!!
> Ben
>
>
> p.s. if this isn't what I need, or anyone has an opinion of how I can 
> speed up my setup, besides the obvious of going to mod_php or 
> something similar, feel free to tell me!  I'm running Apache2, suexec 
> + chroot patch, php 4.4.1... the performance problem is that php eats 
> up CPU, and when a script is requested X times very quickly, it means 
> to a LOT of CPU time being consumed, it's horribly inefficient right now.
>
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.