|
Home > Archive > Unix questions > December 2005 > mapping an httpd PID with a domain name
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
mapping an httpd PID with a domain name
|
|
| jean-francois 2005-12-24, 5:56 pm |
| Hi
Is there any way to map the PIDs that ps show (the ones with httpd are
of a greater interest) with a domain name if a server host several
dfferent domains? Actually I have several PIDs, CPU, memory information
but I don't know which domain among 4 or 5 possible domains are
associated with each PID.
| |
|
| Begin <1135468230.709243.309000@z14g2000cwz.googlegroups.com>
On 2005-12-24, jean-francois <jfbeaulieu2003@yahoo.com> wrote:
> Is there any way to map the PIDs that ps show (the ones with httpd are
> of a greater interest) with a domain name if a server host several
> dfferent domains? Actually I have several PIDs, CPU, memory information
> but I don't know which domain among 4 or 5 possible domains are
> associated with each PID.
You don't specify which httpd you are talking about. However, I do
not think there is a general requirement that a single httpd process
serves only a single domain. This means that the relation will not be
discernible unless you make it clear in some way. I can think of several
ways to do this.
For example: configuring a series of role-uids for each domain and
running httpds with differentiated configs for each domain under a
matching domain-uid. Another would be to again force httpds to only
serve one domain given on the command line, and as long as ps shows the
running httpds with command line you can use the standard text parsing
tools to filter out only the domain(s) you want to see.
However, probably the most efficient way to do this is to use the httpd
itself, possibly through custom plugins or modules, to do per domain
accounting.
--
j p d (at) d s b (dot) t u d e l f t (dot) n l .
This message was originally posted on Usenet in plain text.
Any other representation, additions, or changes do not have my
consent and may be a violation of international copyright law.
| |
| jean-francois 2005-12-25, 2:48 am |
|
jpd wrote:
> Begin <1135468230.709243.309000@z14g2000cwz.googlegroups.com>
> On 2005-12-24, jean-francois <jfbeaulieu2003@yahoo.com> wrote:
>
> You don't specify which httpd you are talking about. However, I do
> not think there is a general requirement that a single httpd process
> serves only a single domain. This means that the relation will not be
> discernible unless you make it clear in some way. I can think of several
> ways to do this.
There is obviously a false assumption that I made; I thought that
each time a use visit a website, it start a new httpd process, and it
seems it's not true. Do you know an URL that could give me some
relevant documentation on how this work? Well, I mean the role of each
httpd process that are displayed by "ps -aux" for exemple, why there is
sometimes 4 processes, some other times 15, etc...
>
> For example: configuring a series of role-uids for each domain and
> running httpds with differentiated configs for each domain under a
> matching domain-uid.
Same thing, I don't understand those 3 lines, I figure I'll have to
find the proper documentation with some keywords if you don't know by
heart what I'm better to read...
I did change occasionally the httpd.conf file but I don't know if this
can be done by changing it.
>Another would be to again force httpds to only
> serve one domain given on the command line, and as long as ps shows the
> running httpds with command line you can use the standard text parsing
> tools to filter out only the domain(s) you want to see.
>
> However, probably the most efficient way to do this is to use the httpd
> itself, possibly through custom plugins or modules, to do per domain
> accounting.
>
Hum, I can code in C but I figure this task require an extensive
knowledge of how httpd works internally. Not as easy than I thought...
>
> --
> j p d (at) d s b (dot) t u d e l f t (dot) n l .
> This message was originally posted on Usenet in plain text.
> Any other representation, additions, or changes do not have my
> consent and may be a violation of international copyright law.
| |
| jean-francois 2005-12-25, 2:48 am |
| I just found an URL which refer to the httpd.conf (which I already knew
but not every aspects of it) andit seems I can use the SetHandler
directive to refer to a PERL script when a user logon to a site; but
without the PID at that time it's useless. But I'm still searching what
can trigger the parent process to launch a child process if it's not a
new visitor that reach a site; that's what I meant when I asked if you
knew some documentation about this.
| |
|
| Begin <1135482866.768338.185500@g47g2000cwa.googlegroups.com>
On 2005-12-25, jean-francois <jfbeaulieu2003@yahoo.com> wrote:
[snip]
> There is obviously a false assumption that I made;
You made a lot of assumptions, but didn't specify them. For one, you did
not tell us what webserver you're talking about.
> I thought that each time a use visit a website, it start a new httpd
> process, and it seems it's not true.
Some httpds do, and some don't. Note that with pre-forking httpds (IIRC
apache 1.* does this by default) there is a process before there is a
request. You won't know which website it will serve until the actual
request. To complicate matters further, it is possible for any child
to serve more than one connection, and even more than one request per
connection. Each of those may in turn be for different websites.
> Do you know an URL that could give me some relevant documentation
> on how this work? Well, I mean the role of each httpd process that
> are displayed by "ps -aux" for exemple, why there is sometimes 4
> processes, some other times 15, etc...
The documentation of the specific webserver you're talking about can
tell you in detail the algorithms it uses to decide how many processes
to run.
>
> Same thing, I don't understand those 3 lines, I figure I'll have to
> find the proper documentation with some keywords if you don't know by
> heart what I'm better to read...
I gave you a system-level, not an application-level example. If you
don't understand it, you should grab an introduction on unix and unix
administration and spend some quality time with it.
>
> Hum, I can code in C but I figure this task require an extensive
> knowledge of how httpd works internally. Not as easy than I thought...
You could see if someone has (tried to) solve(d) the problem before.
Google is your friend.
--
j p d (at) d s b (dot) t u d e l f t (dot) n l .
This message was originally posted on Usenet in plain text.
Any other representation, additions, or changes do not have my
consent and may be a violation of international copyright law.
|
|
|
|
|