[opencms-dev] Re name opencms servlet to /

Johnny Xue | SYSVISION johnny.xue at sysvision.com
Fri Jul 17 05:24:52 CEST 2009


Yes that's a way to remove another /opencms/ if don't use apache mod_rewrite 
(we used urlrewrite before but now we use apache mod_rewrite ;-) )
Simply..
1. Download urlrewritefilter-2.6-src.zip (or latest version...)
2. Modify ../WEB-INF/config/opencms-importexport.xml:
   ===>
   .....
   <rendersettings>
	<rfs-prefix>${CONTEXT_NAME}/export</rfs-prefix>
	<vfs-prefix>${CONTEXT_NAME}${SERVLET_NAME}</vfs-prefix>

   <===
    .....
   <rendersettings>
	<rfs-prefix>${CONTEXT_NAME}/export</rfs-prefix>
	<vfs-prefix>${CONTEXT_NAME}</vfs-prefix>


3. copy urlrewrite.xml (inside urlrewritefilter-2.6-src.zip) to
../WEB-INF/urlrewrite.xml, and change....

  ===>
  ...
    <urlrewrite>
         ......
            ....
         ......
    </urlrewrite>

  <===

   <urlrewrite>
      <rule> 
	  <condition type="request-uri" operator="notequal">
           ^(/(export|resources|opencms-errorhandler|webdav|opencms|)/.*)$
        </condition>
	<from>^/(.*)$</from>
	  <to>/opencms/$1</to>
     </rule>
   </urlrewrite>

4. Modify /WEB-INF/web.xml...

  ==>
    .....
    <listener>
        <listener-class>org.opencms.main.OpenCmsListener</listener-class>
    </listener>
   ......
   
  <===
     .....
    <listener>
        <listener-class>org.opencms.main.OpenCmsListener</listener-class>
    </listener>

    <filter>
    <filter-name>UrlRewriteFilter</filter-name>
    <filter-class>
       org.tuckey.web.filters.urlrewrite.UrlRewriteFilter
    </filter-class>
    <init-param>
        <param-name>confReloadCheckInterval</param-name>
        <param-value>-1</param-value>
    </init-param>
    <init-param>
         <param-name>logLevel</param-name>
         <param-value>ERROR</param-value>
     </init-param>
     <init-param>
         <param-name>statusEnabled</param-name>
         <param-value>false</param-value>
     </init-param>
     <init-param>
         <param-name>statusPath</param-name>
         <param-value>/status</param-value>
     </init-param>
  </filter>
  <filter-mapping>
    <filter-name>UrlRewriteFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
   .....


That's all

http://www.nabble.com/file/p24528018/urlrewritefilter-2.6.zip
urlrewritefilter-2.6.zip ....




Achim Westermann-2 wrote:
> 
> Hi Yves,
> 
> thank you for self - replying, this may be useful for the community! I 
> did neither know or think this is possible nor try to do it (always used 
> the ROOT context in Tomcat for removing the context part and mod_rewrite 
> in apache for getting rid of the servlet name).
> 
> I don't speak chinese but I'd be happy if this would be translated to 
> english and posted to opencms-wiki.org to be shared and polished by a 
> larger community.
> 
> 
> Kind Regards,
> Achim.
> 
> -------------------
> Achim Westermann
> 
> Alkacon Software GmbH  - The OpenCms Experts
> http://www.alkacon.com - http://www.opencms.org
> 
> Yves Glodt wrote:
>> I self reply again...
>> 
>> I found no way making OpenCms work with /* as path for the 
>> OpenCmsServlet. Then urlrewrite came into my mind and I found this:
>> 
>> http://www.tangmonk.com/km/removeOpencmsPrefix.html
>> 
>> and it works AFAICS
>> 
>> Best regards
>> 
>> On Wednesday 15 July 2009, Yves Glodt wrote:
>>> Hello,
>>>
>>> I have a situation where Tomcat6/win64 is in a DMZ behind an
>>> Microsoft ISA, and I can not use a front-apache httpd. I use opencms
>>> 7.5-jpa with Firebird 2.1.
>>>
>>> Now the old story: I need to remove the /opencms/opencms prefix.
>>> The first one I got rid of by installing as ROOT,war
>>>
>>> I managed to rename the second /opencms to /web, and it works as
>>> well. But as soon as I name it / I get 404 errors.
>>>
>>> What I did is:
>>> 1. Changed the <context-param> called "OpenCmsServlet" from
>>> "/opencms/*" to "/*" 2. Changed the <servlet-mapping> for
>>> "OpenCmsServlet" from "/opencms/*" to "/*" and nothing else.
>>> opencms-importexport was not touched.
>>>
>>>
>>> Are there some special steps to take to rename the opencms-servlet?
>>>
>>>
>>> Thanks in advance and best regards,
>>> Yves
>> 
>> _______________________________________________
>> This mail is sent to you from the opencms-dev mailing list
>> To change your list options, or to unsubscribe from the list, please
>> visit
>> http://lists.opencms.org/mailman/listinfo/opencms-dev
>> 
> 
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
> 
> 


-----
Johnny Xue
SYSVISION Ltd., China
http://www.sysvision.com
-- 
View this message in context: http://www.nabble.com/Rename-opencms-servlet-to---tp24497803p24528018.html
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.




More information about the opencms-dev mailing list