Sophie

Sophie

distrib > Mandriva > 2010.1 > i586 > media > contrib-updates > by-pkgid > 02e45b2cd6a4a47c88f15dd2f64cf46c > files > 703

cherokee-1.0.8-1mdv2010.1.i586.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_cookbook_html_cookbook_a"><a href="index.html">Index</a> &#8594; <a href="cookbook.html">Cookbook</a></h2>
<div class="sectionbody">
</div>
<h2 id="_cookbook_setting_up_joomla">Cookbook: Setting up Joomla</h2>
<div class="sectionbody">
<div class="paragraph"><p>Setting up <a href="http://www.joomla.org/">Joomla</a> with Cherokee is really
easy. A configuration wizard is provided that can either be used to
install Joomla as a new dedicated Virtual Server, or to set it up
inside a Directory.</p></div>
<div class="paragraph"><p>This recipe contains three sections detailing how to:
. Configure Cherokee for either installation mode using the Wizard.
. Install Joomla v1.5.14 which is the last one available at the time
of writing.
. Configure Cherokee manually.</p></div>
<div class="paragraph"><p>You don&#8217;t need to worry about the manual installation. It is legacy
documentation from the time when the wizards weren&#8217;t available. Every
step described there is taken care of by the wizard.</p></div>
<h3 id="wizard_configuration">Configure Cherokee using the Wizard</h3><div style="clear:left"></div>
<div class="paragraph"><p>Two common scenarios are contemplated: installation on a dedicated
virtual server (<a href="http://joomla.example.net/">http://joomla.example.net/</a>, for instance) or under a
subdirectory on an existing virtual server (as could be
<a href="http://example.net/joomla/">http://example.net/joomla/</a>).</p></div>
<h4 id="cherokee_vserver">Setting up Joomla as a new Virtual Server</h4>
<div class="paragraph"><p>The first step would be visiting the virtual server list page and
clicking on the <tt>Add</tt> button at the top of the panel to show the list
of available wizards.</p></div>
<div class="imageblock">
<div class="content">
<img src="media/images/admin_vservers_wizard.png" alt="media/images/admin_vservers_wizard.png" />
</div>
</div>
<div class="paragraph"><p>Now, you will have to select the <tt>CMS</tt> category, and run the Joomla
wizard.  At this stage the Joomla wizard will ask you for some basic
parameters about the installation. It will try to auto-fill as many
entries of the form as possible.  For instance, if it finds Joomla
installed in a standard location it will use that path as the default
directory.</p></div>
<div class="paragraph"><p>The new virtual server will be created after this form is submitted.
The virtual server configuration will cover the vast majority of the
cases. Most probably it will cover your needs, although you are free
to modify it as you will.</p></div>
<h4 id="cherokee_dir">Setting up Joomla inside a Directory</h4>
<div class="paragraph"><p>Joomla can also be configured inside a directory. Let&#8217;s suppose we
want to set up Joomla inside the <tt>/blog</tt> directory of one of our
virtual servers.</p></div>
<div class="paragraph"><p>In this case, the first thing you will have to do is to enter the
virtual server configuration you&#8217;d like to configure Joomla in. Once
in there, visit the <tt>Behavior</tt> tab and trigger the <tt>Rule panel</tt> by
clicking on the <tt>Rule Management</tt> button. Then, use the <tt>Add</tt> button
at the top of the panel to see the available wizards:</p></div>
<div class="imageblock">
<div class="content">
<img src="media/images/admin_vserver_wizard.png" alt="media/images/admin_vserver_wizard.png" />
</div>
</div>
<div class="paragraph"><p>As in the previous case, this wizard will ask some very basic
information, including the public web directory where Joomla will be
set up and the local Joomla source directory.</p></div>
<h3 id="package_installation">Installing Joomla</h3><div style="clear:left"></div>
<div class="paragraph"><p>Once Cherokee is ready, only the database issue remains to be able to
install Joomla. Log in to MySQL:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>mysql -u root -p</tt></pre>
</div></div>
<div class="paragraph"><p>And create the database for Joomla. We will be using the name
<em>joomla</em>, the user <em>joomlauser</em> and the password <em>joomlapassword</em>, but
you should set up your own.</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>CREATE DATABASE joomla;
GRANT ALL PRIVILEGES ON joomla.* TO joomlauser@localhost IDENTIFIED BY 'joomlapassword';
GRANT ALL PRIVILEGES ON joomla.* TO joomlauser@localhost.localdomain IDENTIFIED BY 'joomlapassword';
FLUSH PRIVILEGES;
quit;</tt></pre>
</div></div>
<div class="paragraph"><p>Then point your web browser to <tt>http://localhost/joomla</tt> and follow
the instructions provided by the Joomla installer.</p></div>
<div class="paragraph"><p>There is not much else you must do for Cherokee to work with
Joomla. If you follow the Joomla installer&#8217;s instructions -providing
valid database information in most cases will suffice-, you will go
thorough every step swiftly. Once you are done you will have to
eliminate the <tt>installation</tt> subdirectory, as Joomla does not allow
going any further until you do so as a security precaution. It is also
a good idea to make the <tt>cache</tt> directory world writable.</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>rm -rf /var/www/joomla/installation
chmod 777 /var/www/joomla/cache</tt></pre>
</div></div>
<div class="imageblock">
<div class="content">
<img src="media/images/cookbook_joomla.png" alt="media/images/cookbook_joomla.png" />
</div>
</div>
<div class="paragraph"><p>Now to set up Joomla. Visit
<a href="http://localhost/administration">http://localhost/administration</a>
and log in. Go to the <tt>Global Configuration</tt> option and enable all the
<strong>SEO Settings</strong>, including the ones for Apache mod_rewrite.</p></div>
<div class="paragraph"><p>Mission accomplished. You can skip the rest of the document unless you
want some more insight on what exactly has been done by the
Cherokee-Admin Joomla Wizard.</p></div>
<h3 id="manual_configuration">Configuring Cherokee manually</h3><div style="clear:left"></div>
<div class="paragraph"><p>The wizard handles both series of Joomla, 1.5.x and 1.6.x. This manual
process was documented for 1.5.x and does not work for 1.6.x.</p></div>
<div class="paragraph"><p>You will need PHP support correctly configured in Cherokee, and PHP
with the MySQL module installed. For this you will require php-cgi
installed on your system, and to run the PHP wizard, so in case it is
not configured yet you an follow the appropriate recipe about
<a href="cookbook_php.html">setting up PHP</a>. You will also need an FTP
server if the Joomla files are owned by a user other than the one
running the web server.</p></div>
<div class="paragraph"><p>Under these conditions, you could start Joomla&#8217;s installation and you
would already be able to have your site up and running.</p></div>
<div class="paragraph"><p>However, we can add several refinements. In this recipe we will be
dedicating a virtual server entirely to Joomla, so either create a new
one or adjust <tt>default</tt> accordingly. Of course, you can also set it up
under a directory in an existing virtual server, but we will take the
first approach for clarity and simplicity.</p></div>
<div class="paragraph"><p>For our purposes, we will make the modifications in our <tt>default</tt>
virtual server. This will only affect the URLs we&#8217;ll be accessing to
log in to Joomla. First download and uncompress the distributed Joomla
release into <tt>/var/www/joomla</tt>, and set that path as the <tt>Document
Root</tt> in your virtual host&#8217;s <tt>Basics</tt> tab.</p></div>
<div class="paragraph"><p>We will also be making changes in the <tt>Error Handler</tt> tab, selecting
the <tt>Custom redirections</tt> option and adding an option to send errors
to Joomla.</p></div>
<div class="tableblock">
<table rules="all"
width="100%"
frame="border"
cellspacing="0" cellpadding="4">
<col width="50%" />
<col width="50%" />
<thead>
<tr>
<th align="left" valign="top">Error         </th>
<th align="left" valign="top">URL</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top"><p class="table">403 Forbidden</p></td>
<td align="left" valign="top"><p class="table">/index.php</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">404 Not Found</p></td>
<td align="left" valign="top"><p class="table">/index.php</p></td>
</tr>
</tbody>
</table>
</div>
<div class="paragraph"><p>Finally, set up the rewrite rules recommended by Joomla to block out
the most common type of exploit attempts. To do so, simply create
<tt>Regular Expression</tt> rules for the following expressions:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>mosConfig_[a-zA-Z_]{1,21}(=|\%3D)
base64_encode.*\(.*\)
(\&lt;|%3C).*script.*(\&gt;|%3E)
GLOBALS(=|\[|\%[0-9A-Z]{0,2})
_REQUEST(=|\[|\%[0-9A-Z]{0,2})</tt></pre>
</div></div>
<div class="paragraph"><p>Each should be managed by a handler that returns an error:</p></div>
<div class="tableblock">
<table rules="all"
width="100%"
frame="border"
cellspacing="0" cellpadding="4">
<col width="50%" />
<col width="50%" />
<thead>
<tr>
<th align="left" valign="top">Handler    </th>
<th align="left" valign="top">Error</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top"><p class="table">HTTP error</p></td>
<td align="left" valign="top"><p class="table">403 Forbidden</p></td>
</tr>
</tbody>
</table>
</div>
<div class="paragraph"><p>After this you are done! Remember that all these settings are
refinements not really needed by Joomla to perform its basic
functions.</p></div>
</div>
<div id="footer">
<div id="footer-text">
</div>
</div>
</body>
</html>