<!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> → <a href="cookbook.html">Cookbook</a></h2> <div class="sectionbody"> </div> <h2 id="_cookbook_setting_up_alfresco">Cookbook: Setting up Alfresco</h2> <div class="sectionbody"> <div class="paragraph"><p>For this recipe we will be using <a href="http://wiki.alfresco.com/wiki/Download_Alfresco_Community_Network">Alfresco Labs 3c</a>, the community supported release.</p></div> <div class="paragraph"><p>You can use the full blown installer or simply download the <em>WAR file only</em> version. We will be using the former method, but you could choose the latter and just deploy the application in your favorite application server. For this you could refer to the <a href="cookbook_glassfish.html">Glassfish</a> recipe and the rest of this document would be of no more concern to you.</p></div> <div class="paragraph"><p>Before we proceed with the installation of Alfresco Lab 3c on Linux, you must know that it uses JDK 1.5+, MySQL and Tomcat as application server.</p></div> <div class="paragraph"><p>We will be installing the package and then setting up Cherokee as a reverse proxy to access this Enterprise Content Management solution.</p></div> <h3 id="alfresco">Phase one: Alfresco</h3><div style="clear:left"></div> <div class="paragraph"><p>Once you’ve downloaded the full installer, the process is as simple as running it and follow the easy step by step assistant.</p></div> <div class="imageblock"> <div class="content"> <img src="media/images/cookbook_alfresco_assistant.png" alt="media/images/cookbook_alfresco_assistant.png" /> </div> </div> <div class="paragraph"><p>If you choose to run it as root, it will be installed in <tt>/opt/Alfresco</tt> by default and will be available system-wide. If not, your home directory will be chosen.</p></div> <div class="imageblock"> <div class="content"> <img src="media/images/cookbook_alfresco_path.png" alt="media/images/cookbook_alfresco_path.png" /> </div> </div> <div class="paragraph"><p>The process is fairly straight forward.</p></div> <div class="imageblock"> <div class="content"> <img src="media/images/cookbook_alfresco_install.png" alt="media/images/cookbook_alfresco_install.png" /> </div> </div> <div class="paragraph"><p>When you are asked for an OpenOffice location, you can select the Alfresco directory if you don’t want to use it for Office document conversions. If you can’t seem to find a path that lets the installer proceed, it could be that the installer is trying to look for the file <tt>soffice.exe</tt>. There is information about this problem in their <a href="http://wiki.alfresco.com">wiki</a>, but you could try copying or making a symbolic link to <tt>/usr/bin/soffice</tt> while the installer gets fixed. We will simply be ignoring this step.</p></div> <div class="imageblock"> <div class="content"> <img src="media/images/cookbook_alfresco_soffice.png" alt="media/images/cookbook_alfresco_soffice.png" /> </div> </div> <div class="paragraph"><p>This should do for now. Now you have to launch Alfresco.</p></div> <div class="listingblock"> <div class="content"> <pre><tt># /opt/Alfresco/alfresco.sh start</tt></pre> </div></div> <div class="paragraph"><p>If you experience problems or notice a wrong JRE path, you should edit the script and modify the <tt>JRE_HOME</tt> variable to whatever Java version you have on your system.</p></div> <div class="paragraph"><p>For instance, it could show:</p></div> <div class="listingblock"> <div class="content"> <pre><tt>Using JRE_HOME: /usr</tt></pre> </div></div> <div class="paragraph"><p>By simply looking to your files you could find out the correct version you have in your system.</p></div> <div class="listingblock"> <div class="content"> <pre><tt># ls -l /usr/lib/jvm total 8 lrwxrwxrwx 1 root root 14 2008-11-12 11:13 default-java -> java-6-openjdk drwxr-xr-x 7 root root 4096 2008-11-12 11:13 java-6-openjdk lrwxrwxrwx 1 root root 19 2008-11-19 01:25 java-6-sun -> java-6-sun-1.6.0.10 drwxr-xr-x 6 root root 4096 2008-11-19 01:25 java-6-sun-1.6.0.10</tt></pre> </div></div> <div class="paragraph"><p>In this case, we would be setting JRE_HOME to <tt>/usr/lib/jvm/java-6-sun-1.6.0.10</tt></p></div> <div class="paragraph"><p>After giving the script some seconds to launch the application server, you can now access Alfresco by visiting <a href="http://localhost:8080/share">http://localhost:8080/share</a></p></div> <div class="tableblock"> <table rules="all" width="100%" frame="border" cellspacing="0" cellpadding="4"> <caption class="title">Initial access information</caption> <col width="50%" /> <col width="50%" /> <thead> <tr> <th align="left" valign="top">Field </th> <th align="left" valign="top">Value</th> </tr> </thead> <tbody> <tr> <td align="left" valign="top"><p class="table">user</p></td> <td align="left" valign="top"><p class="table">admin</p></td> </tr> <tr> <td align="left" valign="top"><p class="table">password</p></td> <td align="left" valign="top"><p class="table">admin</p></td> </tr> </tbody> </table> </div> <div class="imageblock"> <div class="content"> <img src="media/images/cookbook_alfresco_share.png" alt="media/images/cookbook_alfresco_share.png" /> </div> <div class="image-title">Accessing Alfresco</div> </div> <div class="imageblock"> <div class="content"> <img src="media/images/cookbook_alfresco_alfresco.png" alt="media/images/cookbook_alfresco_alfresco.png" /> </div> <div class="image-title">Accessing Alfresco</div> </div> <h3 id="Cherokee">Phase two: Cherokee</h3><div style="clear:left"></div> <div class="paragraph"><p>Now to set up Cherokee. To do this, use the provided <tt>Wizard</tt>. Launch Cherokee-Admin on your proxy machine and then you will find this assistant under the <tt>Platforms</tt> category of the Wizards. Simply go to the virtual server list page and click on the <tt>Add</tt> button at the top of the panel to show the list of available wizards. Click on the one for Alfresco, answer a few questions and you are done. You can then skip the rest of this document.</p></div> <div class="paragraph"><p>Should you have any problem with the assistant, you can perform the same tasks manually. Simply set up Cherokee as reverse proxy. You can either create a new virtual server with a matching rule (be it <tt>default</tt> or anything else) if you are sharing the proxy machine, or dedicate another machine to the Proxy Handler. This will be our choice, since typically you will be wanting to get the best possible performance, the Java application server is heavy by definition, and you could be using the proxy machine also to serve other contents. We are only going to set Cherokee’s HTTP reverse proxy handler to hit the server running Alfresco at port 8080.</p></div> <div class="paragraph"><p>Launch Cherokee-Admin on your proxy machine, create a rule that matches the desired path on your web server hierarchy -<tt>/share</tt> for instance- in your virtual server of choice, and define the <tt>HTTP reverse proxy</tt> handler from within the <tt>Handler</tt> tab.</p></div> <div class="paragraph"><p>Remember to configure an URL rewriting rule in the handler’s configuration. Alfresco’s application server doesn’t provide content directly in the document root, so we’ll have to add the required subnode.</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">Regular Expression </th> <th align="left" valign="top">Substitution</th> </tr> </thead> <tbody> <tr> <td align="left" valign="top"><p class="table"></p></td> <td align="left" valign="top"><p class="table">/share/$1</p></td> </tr> </tbody> </table> </div> <div class="paragraph"><p>You will need to assign it an information source you define for the server running Alfresco. We will assume the IP is <tt>192.168.1.100</tt> in your firewalled local network, and your reverse proxy is accessible as <tt>http://example.com/</tt></p></div> <div class="paragraph"><p>This information source is to be defined as external sources, like the following example:</p></div> <div class="tableblock"> <table rules="all" width="100%" frame="border" cellspacing="0" cellpadding="4"> <col width="33%" /> <col width="33%" /> <col width="33%" /> <thead> <tr> <th align="left" valign="top">Type </th> <th align="left" valign="top">Nick </th> <th align="left" valign="top">Connection</th> </tr> </thead> <tbody> <tr> <td align="left" valign="top"><p class="table">Remote host</p></td> <td align="left" valign="top"><p class="table">alfresco</p></td> <td align="left" valign="top"><p class="table">192.168.1.100:8080</p></td> </tr> </tbody> </table> </div> <div class="paragraph"><p>Refer to the <a href="modules_handlers_proxy.html">HTTP reverse proxy</a> documentation if you need any further help with this.</p></div> <div class="paragraph"><p>Once you launch Cherokee and access <tt>http://example.com/share</tt>, you should be presented with the login screen from before, since you will be receiving whatever is at <tt>http://192.168.1.100:8080/share</tt>.</p></div> </div> <div id="footer"> <div id="footer-text"> </div> </div> </body> </html>