[opencms-dev] OpenCMS9 and Tomcat7 - Configuration no ROOT

Andrea Lasi - ConsulMedia srl alasi at consulmedia.it
Mon Jul 25 12:25:58 CEST 2016

I have this server configuration:
  - Tomcat7
  - Apache 2.4
  - OpenCMS 9.5.4

I need to remove {CONTEXT_NAME}/opencms from URL.

With Tomcat6 Apache OpenCMS 9.5.x I use this configuration

//    <rfs-prefix>/export</rfs-prefix>//
//    <vfs-prefix></vfs-prefix>//
//    ...//

//    <default-uri>/sites/default/</default-uri>//
//    <site server="//http://{DOMAIN}//" uri="/sites/default/"/>//
//    ...//

//    ServerAdmin info@{MY-DOMAIN-NAME}.com//
//    ServerName www.{MY-DOMAIN-NAME}.com//
//    ServerAlias {MY-DOMAIN-NAME}.com//
//    ErrorLog ${APACHE_LOG_DIR}/{MY-DOMAIN-NAME}.com-error_log//
//    CustomLog ${APACHE_LOG_DIR}/{MY-DOMAIN-NAME}AWS.com-access_log 
//    DirectoryIndex index.html//
//    # If the requested URI is located in the resources folder, do not 
forward the request//
//    SetEnvIfNoCase Request_URI ^/{MY-CONTEXT-NAME}/resources/.*$ no-jk//
//    # If the requested URI is static content do not forward the request//
//    SetEnvIfNoCase Request_URI ^/export/.*$ no-jk//
//    RewriteEngine on//
//    # If the requested URI is NOT located in the resources folder.//
//    # Prepend an /isgas/opencms to everything that does not already 
starts with it//
//    # and force the result to be handled by the next URI-handler 
([PT]) (JkMount in this case)//
//    RewriteCond %{REQUEST_URI} !^/{MY-CONTEXT-NAME}/resources/.*$//
//    RewriteCond %{REQUEST_URI} !^/export/.*$//
//    RewriteRule !^/{MY-CONTEXT-NAME}/opencms/(.*)$ 
//    # These are the settings for static export. If the requested 
resource is not already//
//    # statically exported create a new request to the opencms404 
handler. This has to be//
//    # a new request, because the current would net get through mod_jk 
because of the "no-jk" var.//
//    RewriteCond %{REQUEST_URI} ^/export/.*$//
//    RewriteCond "%{DOCUMENT_ROOT}%{REQUEST_FILENAME}" !-f//
//    RewriteCond 
"%{DOCUMENT_ROOT}%{REQUEST_FILENAME}/index_export.html" !-f//
//    RewriteRule .* 
//    # If the request starts with /{MY-CONTEXT-NAME}/resources, delete 
the /{MY-CONTEXT-NAME} prefix//
//    RewriteCond %{REQUEST_URI} ^/{MY-CONTEXT-NAME}/resources/.*$//
//    RewriteRule ^/{MY-CONTEXT-NAME}/(.*)$ /$1//
     DocumentRoot /MY/DOCUMENT/ROOT//
//    JkMount /* ajpconnector//

If I use this configuration in Tomcat7 I see the site in online view but 
if I do the login in http://www.{MY-DOMAIN-NAME}.com/system/login I have 
no error in logs but I'm not redirect in Workplace (or in the home 
editable) but I have redirect always in online view. Is it correctable?
Can I use OpenCMS9.5.x with Tomcat7 (or 8) anche Apache configuring all 
as I did with Tomcat6?

So I follow this documentation but I have the problem that my OpenCMS 
can't be the ROOT (I have some OpenCMS instances and I can't put a 
Tomcat installation for each)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20160725/c6b3133d/attachment.htm>

More information about the opencms-dev mailing list