Skip to end of metadata
Go to start of metadata

Guide to cyklotron2 to produce short, nicely looking URLs.

Configure a virtual server in apache2:

<VirtualHost *:80>
  ServerName DOMAIN
  DocumentRoot DATA_DIR_PATH
  CustomLog /var/log/apache2/DOMAIN-access.log combined
  ErrorLog /var/log/apache2/DOMAIN-error.log

  RewriteEngine on

  RewriteRule ^/$               /ledge [P,L]
  RewriteRule ^/view/(.*)       /ledge/view/$1 [P,L]
  RewriteRule ^/doc/(.*)        /ledge/doc/$1 [P,L]

  JkMount /ledge*               tomcat

  ProxyRequests on
  <Proxy http://DOMAIN/ledge*>
    Order Allow,Deny
    Allow from all
  </Proxy>
</VirtualHost>

Configure cyklotron2 application as the root context of the domain in tomcat:

TOMCAT_HOME/conf/server.xml should contain the following section:

<Host name="DOMAIN" appBase="webapps_DOMAIN" unpackWARs="false" />

TOMCAT_HOME/conf/Catalina/DOMAIN/ROOT.xml file should be created with the following contents:

<Context path="" docBase="WAR_PATH" reloadable="false">
  <Parameter name="ledge.root" value="DATA_DIR_PATH"/>
</Context>

Configure Cyklotron2 to generate short URLs (without context and servlet tokens - gets rid of the '/ledge/' token in this case).

create file DATA_DIR_PATH/config/org.objectledge.web.mvc.tools.LinkToolFactory.xml with the following contents:

<config>
  <rewrite>true</rewrite>
</config>

and DATA_DIR_PATH/config/org.cyklotron.commons.BrowseLinkToolFactory.xml with the following contents:

<config>
  <rewrite>true</rewrite>
  <pathinfo>
    <key>doc</key>
  </pathinfo>
</config>

Finally, make sure that you configure a domain alias (virtual site) for your primary Cyklotron2 site - only then DOMAIN/doc/a/b/c URLs will be used instead of DOMAIN/view/Browse?docId=89766.

Labels: