httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@gmail.com>
Subject Re: mod_fcgid: different instances of the same program
Date Mon, 09 Nov 2009 22:53:47 GMT
On Mon, Nov 9, 2009 at 5:16 PM, Danny Sadinoff <danny.sadinoff@gmail.com> wrote:
> Here are two details of mod_fcgid process management that I've just
> learned after a long debug session and squinting at the mod_fcgid
> code.
>
> 1) symlinks & you.
> It seems that mod_fcgid identifies fcgid programs by inode and device,
> not by filename.  So two fcgid programs invoked by the webserver
> along different paths will be counted as the same if the two paths are
> hardlinks or softlinks to each other.

Mostly yes.

The path to the file doesn't matter; it is the file itself that matters.

There are different requirements for how programs are distinguished.
One possibility is changing from stat() to lstat() (i.e., distinguish
symlinks but not hard links).  Another possibility is looking only at
the basename.  This was discussed in this thread:
http://www.mail-archive.com/dev@httpd.apache.org/msg45516.html

What are you trying to accomplish which is hindered by the current
implementation?

>
> 2) Virtual hosts
> The above item holds true even across virtual hosts.   So while
> it's possible to adjust the FcgidInitialEnv items on a per-vhost
> basis, this is a recipe for disaster if two vhosts point at the same
> fcgi executable, because the resulting processes with potentially
> different Environments will be inserted into the same pool.  Once that
> occurs, we may expect that a server spawned with config defined in
> vhost A will be parcelled out to vhost B.

Where does this occur?  Entries in the process table are distinguished
by virtual host.  (I think the implementation of this check is broken,
in that it requires that ServerName is set in the virtual hosts.  Are
you using a simple test config that doesn't have ServerName set?)

>
>
> The Apache httpd 2.3 docs do not address the symlink issue at all, and
> the virtual host issue only indirectly.
> http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html

FWIW, this isn't part of "Apache httpd 2.3".  mod_fcgid is released
separately from the web server and only by coincidence has the same
version number (2.3.x) as development levels of the web server.

>
>
> I'd appreciate it if someone could confirm or deny the above.  If I'm
> right, can we add it to the docs?  None of it seems obvious to me.
> Apologies in advance if this is the sort of thing that belongs on the
> dev list.  I'm happy to throw together a doc patch.

Let's see what needs to be fixed in the code first ;)

Mime
View raw message