Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > 23dfe8873d57cd78fdc95419f7eb0042 > files > 1255

cherokee-1.2.103-17.1.mga7.armv7hl.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Language" content="en-us" />
    <meta name="ROBOTS" content="ALL" />
    <meta http-equiv="imagetoolbar" content="no" />
    <meta name="MSSmartTagsPreventParsing" content="true" />
    <meta name="Keywords" content="cherokee web server httpd http" />
    <meta name="Description" content="Cherokee is a flexible, very fast, lightweight Web server. It is implemented entirely in C, and has no dependencies beyond a standard C library. It is embeddable and extensible with plug-ins. It supports on-the-fly configuration by reading files or strings, TLS/SSL (via GNUTLS or OpenSSL), virtual hosts, authentication, cache friendly features, PHP, custom error management, and much more." />
    <link href="media/css/cherokee_doc.css" rel="stylesheet" type="text/css" media="all" />
  </head>
<body>
<h2 id="_a_href_index_html_index_a_8594_a_href_dev_html_development_info_a"><a href="index.html">Index</a> &#8594; <a href="dev.html">Development info</a></h2>
<div class="sectionbody">
</div>
<h2 id="_development_debugging_cherokee">Development: Debugging Cherokee</h2>
<div class="sectionbody">
<h3 id="cherokee-admin">cherokee-admin</h3><div style="clear:left"></div>
<div class="paragraph"><p>Cherokee Admin is written in Python. While making changes, you can use
the <tt>-x</tt> or <tt>--debug</tt> parameter to see the Python back traces in the
active console.</p></div>
<h3 id="cherokee">cherokee</h3><div style="clear:left"></div>
<div class="paragraph"><p>If you need to debug the behavior of the web server (or an
application), there are some helpful tools available for you.</p></div>
<div class="ulist"><ul>
<li>
<p>
To start with, if you are using gcc and you want to compile Cherokee
  with debug information just execute make like this:
</p>
<div class="listingblock">
<div class="content">
<pre><tt>  make CFLAGS="-O0 -g3"</tt></pre>
</div></div>
<div class="paragraph"><p>And then you&#8217;ll be able to execute gdb, cgdb, gdbtui..</p></div>
</li>
<li>
<p>
You can use autoconf to set up Cherokee to use static modules:
</p>
<div class="listingblock">
<div class="content">
<pre><tt>  ./autogen.sh --localstatedir=/var --prefix=/usr --sysconfdir=/etc  \
  --with-wwwroot=/var/www --enable-static-module=all --enable-static \
  --enable-shared=no</tt></pre>
</div></div>
</li>
<li>
<p>
If you want a code backtrace printed each time an error message is
  generated, add the following <tt>configure</tt> parameter:
</p>
<div class="listingblock">
<div class="content">
<pre><tt>  --enable-backtraces</tt></pre>
</div></div>
</li>
<li>
<p>
You can also enable a cool feature: the CHEROKEE_TRACE environment
  variable to trace what is going on inside the server. To enable it
  you must add a special flag to your <tt>configure</tt> or <tt>autogen.sh</tt>
  statement:
</p>
<div class="listingblock">
<div class="content">
<pre><tt>  --enable-trace</tt></pre>
</div></div>
<div class="paragraph"><p>This will let you trace the behavior with a human-readable output.</p></div>
<div class="paragraph"><p>Note that by enabling tracing you will be making Cherokee a lot
slower. Keep this in mind when deploying in production environments.</p></div>
<div class="paragraph"><p>Now, when you are going to launch the web server, just add the
CHEROKEE_TRACE variable, with the desired options:</p></div>
<div class="sidebarblock">
<div class="sidebar-content">
<div class="paragraph"><p>cherokee# CHEROKEE_TRACE="common" cherokee</p></div>
<div class="paragraph"><p>Cherokee Web Server 1.0.0b5077 (May 12 2010): Listening on port ALL:80, TLS</p></div>
<div class="paragraph"><p>disabled, IPv6 enabled, using epoll, 1024 fds system limit, max. 505</p></div>
<div class="paragraph"><p>connections, caching I/O, 10 threads, 50 connections per thread, standard</p></div>
<div class="paragraph"><p>scheduling policy</p></div>
<div class="paragraph"><p>handler_common.c:0143 (                     stat_file): /var/www//images/powered_by_cherokee.png, use_iocache=0 re=0</p></div>
<div class="paragraph"><p>handler_common.c:0190 (   cherokee_handler_common_new): request: <em>/images/powered_by_cherokee.png</em>, local: <em>/var/www//images/powered_by_cherokee.png</em>, exists 1</p></div>
<div class="paragraph"><p>handler_common.c:0236 (   cherokee_handler_common_new): going for handler_file</p></div>
<div class="paragraph"><p>handler_common.c:0143 (                     stat_file): /var/www//images/default-bg.png, use_iocache=0 re=0</p></div>
<div class="paragraph"><p>handler_common.c:0190 (   cherokee_handler_common_new): request: <em>/images/default-bg.png</em>, local: <em>/var/www//images/default-bg.png</em>, exists 1</p></div>
<div class="paragraph"><p>handler_common.c:0236 (   cherokee_handler_common_new): going for handler_file</p></div>
<div class="paragraph"><p>handler_common.c:0143 (                     stat_file): /var/www//images/cherokee-logo.png, use_iocache=0 re=0</p></div>
<div class="paragraph"><p>handler_common.c:0190 (   cherokee_handler_common_new): request: <em>/images/cherokee-logo.png</em>, local: <em>/var/www//images/cherokee-logo.png</em>, exists 1</p></div>
<div class="paragraph"><p>handler_common.c:0236 (   cherokee_handler_common_new): going for handler_file</p></div>
</div></div>
<div class="paragraph"><p>Of course, you can trace all the modules (handlers, loggers..) you need:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>CHEROKEE_TRACE="common,static,io_cache" /usr/bin/cherokee
CHEROKEE_TRACE="all" /usr/bin/cherokee</tt></pre>
</div></div>
<div class="paragraph"><p>By default the environment variable contains a list of comma
separated words, that point the server which parts and actions are
interesting for your trace. Besides, there are a few special cases:</p></div>
<div class="tableblock">
<table rules="all"
width="100%"
frame="border"
cellspacing="0" cellpadding="4">
<col width="20%" />
<col width="80%" />
<thead>
<tr>
<th align="left" valign="top">Keyword    </th>
<th align="left" valign="top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top"><p class="table">all</p></td>
<td align="left" valign="top"><p class="table">Activates all the trace points</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">time</p></td>
<td align="left" valign="top"><p class="table">Prints the time at the beginning of the line</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">thread</p></td>
<td align="left" valign="top"><p class="table">Prints the thread ID</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">from=&lt;IP&gt;</p></td>
<td align="left" valign="top"><p class="table">Restrict the tracing to the information generated by certain IP or Subnet.</p></td>
</tr>
</tbody>
</table>
</div>
</li>
<li>
<p>
You can also access the functionality of CHEROKEE_TRACE through
  <tt>cherokee-tweak</tt>. Refer to the apropriate section of the
  documentation to learn more about this:
  <a href="other_bundle_cherokee-tweak.html">cherokee-tweak</a>.
</p>
</li>
<li>
<p>
Lastly a utility is provided, <tt>contrib/tracelor.py</tt>, to provide
  further help to these tracing abilities. It is a little script that
  helps to read the tracing logs by colorizing the thread references
  and highlighting the words passed through the command line.
</p>
<div class="paragraph"><p>An example of usage would be:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>CHEROKEE_TRACE=thread,all ./cherokee | ../contrib/tracelor.py iocache</tt></pre>
</div></div>
<div class="paragraph"><p>And it would yield a colorized output. Even if it is not terribly
complicated, it is a handy script to trace the server more easily.</p></div>
</li>
</ul></div>
<div class="imageblock">
<div class="content">
<img src="media/images/tracelor.png" alt="media/images/tracelor.png" />
</div>
</div>
</div>
<div id="footer">
<div id="footer-text">
</div>
</div>
</body>
</html>