Scenario and Overview
Unaltered Turbine URLs look like this:
The bulk of the url is defined by the servlet api and is outside of the control of Turbine: http://www.foo.com/CONTEXT/servlet/MAPPING/template/Foo.vm [ servlet api defined ][ turbine ]This HOWTO describes how you can control the servlet part of the url in Tomcat. For other servlet environments you'll have to consult their documentation. Three parts of the url will be addresed:
The Context
You need to register the context with Tomcat. If you have given your
application a short name like 'po' and placed it correctly in the
webapps directory, then you won't need to do anything special. Tomcat
will find the directory, and add a context. If you have a long
application name like 'mywonderfulapp', add the following lines to
Tomcat's server.xml file (in the TDK you'll find this here:
<Context path="/po" docBase="webapps/mywonderfulapp" reloadable="true" debug="0" trusted="false" > </Context> Everthing after the docBase= line is obviously up to you. This tells Tomcat to add a context named 'po' with the docbase of your application. The Servlet PrefixModifying the servlet prefix also requires editing Tomcat's server.xml file. Tomcat will use this prefix to determine if a given request is for a servlet. Edit the following lines: <RequestInterceptor className="org.apache.tomcat.request.InvokerInterceptor" debug="0" prefix="/s/" /> With this modification, Tomcat recognize requests containing /s/ in the url as a servlet request and will look for the servlet in the web.xml descriptor. The Servlet Name
This is defined in web.xml (which you will find here:
<servlet-name> la </servlet-name>
If you are using Tomcat standalone, then you are done and your url is
now If you are running Apache and mod_jk... you will need to change your mod_jk.conf file to include the following: ######################################################### # Auto configuration for the /po context starts. ######################################################### # # Make Apache aware of the location of the context # Alias /po "serverroot/webapps/mywonderfulapp" <Directory "serverroot/webapps/mywonderfulapp"> Options Indexes FollowSymLinks </Directory> # # Mount all JSP files and the /servlet/ uri to Tomcat # JkMount /po/s/* ajp12 JkMount /po/*.jsp ajp12 # # Prohibit users from directly accessing WEB-INF # <Location "/mywonderfulapp/WEB-INF/"> AllowOverride None deny from all </Location> # # Prohibit users from directly accessing META-INF # <Location "/mywonderfulapp/META-INF/"> AllowOverride None deny from all </Location> ####################################################### # Auto configuration for the /po context ends. ####################################################### document created August 14, 2001 |