Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache monitoring

Status
Not open for further replies.

marcolino88

Programmer
Apr 30, 2011
6
Hi all,
I'm new in this forum.
I ask you if it is possible to monitoring the function calls that Apache makes when it must satisfy a request. For example, suppose we have a LAMP architecture (this is my architecture) and I want to display all the users in a database table(it exists). Is it possible to trace all the call functions that Apache makes to achieve this goal?I am not interested to log errors, but the call functions that belong to the apache library.

Thanks
 
Yes, it is possible, using a tool called strace. You will need to attach strace to the apache process and there may be a couple of other wrinkles associated with the fact that Apache launches as as root and then drops root and spawns multiple daemon processes. Strace is capable of handling this sort of thing, but will require a little deeper understanding of how to use it.

There are boatloads of tutorials, and books, etc, on using it and any good material on debugging Linux applications should have information on it.
 
Hi, i tried to use strace but it traces the Unix system calls and not the php functions that Apache does when a request must to be served.
I want to know what are the function libraries that Apache calls when it serves an http request(for example).

Thanks a lot for your fast answer!

Bye
 
Apache doesn't use ANY PHP functions when it serves a request. The Apache web server is written in C. When a PHP page is being server Apache starts an instance of the php interpreter if and when it encounters a "<?php" tag and passes the source code to the instance, then streams the output from it into the outgoing data stream, until it reaches a "?>" tage (the End Of File) Apache then stops the instance running and continues serving out the page source

If you want to display the users in a database table USING PHP you would write a query and use PHP to query the data and display it.

Forum434 would be a better place for your question

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Hi chris,
thanks a lot for your answer!!!
So I explain you my problem: I want to find the module(as you told me it is written in C) that manage http request for modify it for my goals.
It is possible? Do you know what is this module?

Thanks

Bye
 
Ok so is your question more about C programming than Apache? Because handling HTTP request IS Apaches core function.

You can download the source code for Apache from the repository and browse the various modules.


Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top