[opencms-dev] tomcat + apache with mod_jk

Marcus Popetz marcus at roundpeg.com
Fri Oct 20 15:32:28 CEST 2006


You should set up a new "site" for each directory you want to appears as root.

ie:

/sites/diamondway-teachings/
/sites/my-other-site/

You have to add a definition of the site into opencms-system.xml and
then make your dns entries for each site if you want more than one.

my example:

    <sites>
      <workplace-server>http://opencms1.academyart.edu</workplace-server>
      <default-uri>/sites/default/</default-uri>
      <site server="http://opencms1.academyart.edu" uri="/sites/default/">
        <alias server="http://10.32.69.20"/>
        <alias server="http://216.10.119.111"/>
      </site>
      <site server="http://alumni.academyart.edu" uri="/sites/alumni/">
       <alias server="http://prod-alumni.academyart.edu"/>
       <alias server="http://prod1-alumni.academyart.edu"/>
      </site>
      <site server="http://applicants.academyart.edu" uri="/sites/applicants/">
       <alias server="http://prod-applicants.academyart.edu"/>
       <alias server="http://prod1-applicants.academyart.edu"/>
      </site>
</sites>

On 10/20/06, Marc Johnen <opencms at johnen.biz> wrote:
> Hello everyone,
> I finally got opencms running together with apache, removing the
> /opencms/opencms/.
> It seems to be working fine. Now I would like to remove the name of the
> folder
> where I have the content as well. The content is in the folder
> /sites/default/diamondway-teachings/.
> The url to access the webpage looks like this at the moment
> www.diamondway-teachings.org/diamondway-teachings/.
> I'd like to remove the "diamondway-teachings" at the end.
> I've been reading a lot and haven't found a solution, so I'd be very
> glad about some help!
> Is it better to do it with a rewriterule (i tried and failed) or is
> there something in opencms which i've been missing?
> Thank you and many greetings
> Marc Johnen, Berlin
>
>
> *******************************************************************************************************
> httpd.vhost.conf:
> ----------------
> <VirtualHost *:80>
>
> # If the requested URI is located in the resources folder, do not
> forward the request
> SetEnvIfNoCase Request_URI ^/opencms/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 /opencms/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} !^/opencms/resources/.*$
>  RewriteCond %{REQUEST_URI} !^/export/.*
>  RewriteRule !^/opencms/opencms/(.*)$ /opencms/opencms/%{REQUEST_URI} [PT]
>
>  # 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 .*
> /opencms/opencms/handle404?exporturi=%{REQUEST_URI}&%{QUERY_STRING} [P]
>
>
>  # If the request starts with /opencms/resources, delete the /opencms prefix
>  RewriteCond %{REQUEST_URI} ^/opencms/resources/.*$
>  RewriteRule ^/opencms/(.*)$ /$1
>
>  JkMount /* ocms
>
> </VirtualHost>
> *******************************************************************************************************
> opencms-importexport.xml:
> ----------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE opencms SYSTEM
> "http://www.opencms.org/dtd/6.0/opencms-importexport.dtd">
>
> <opencms>
>         <importexport>
>                 <importexporthandlers>
>                         <importexporthandler
> class="com.opencms.legacy.CmsCosImportExportHandler"/>
>                         <importexporthandler
> class="org.opencms.importexport.CmsVfsImportExportHandler"/>
>                         <importexporthandler
> class="org.opencms.module.CmsModuleImportExportHandler"/>
>                 </importexporthandlers>
>                 <import>
>                         <overwrite>true</overwrite>
>                         <convert>true</convert>
>                         <importversions>
>                                 <importversion
> class="com.opencms.legacy.CmsImportVersion1"/>
>                                 <importversion
> class="org.opencms.importexport.CmsImportVersion2"/>
>                                 <importversion
> class="org.opencms.importexport.CmsImportVersion3"/>
>                                 <importversion
> class="org.opencms.importexport.CmsImportVersion4"/>
>                         </importversions>
>                         <immutables>
>                                 <resource uri="/system/"/>
>                                 <resource uri="/system/bodies/"/>
>                                 <resource uri="/system/galleries/"/>
>                                 <resource
> uri="/system/galleries/download/"/>
>                                 <resource
> uri="/system/galleries/externallinks/"/>
>                                 <resource
> uri="/system/galleries/htmlgalleries/"/>
>                                 <resource uri="/system/galleries/pics/"/>
>                                 <resource uri="/system/login/"/>
>                                 <resource uri="/system/modules/"/>
>                                 <resource uri="/system/shared/"/>
>                                 <resource uri="/system/workplace/"/>
>                                 <resource uri="/system/workplace/action/"/>
>                                 <resource
> uri="/system/workplace/administration/"/>
>                                 <resource uri="/system/workplace/admin/"/>
>                                 <resource uri="/system/workplace/help/"/>
>                                 <resource uri="/system/workplace/locales/"/>
>                                 <resource
> uri="/system/workplace/resources/"/>
>                                 <resource
> uri="/system/workplace/restypes/"/>
>                                 <resource uri="/system/workplace/scripts/"/>
>                                 <resource
> uri="/system/workplace/templates/"/>
>                                 <resource uri="/system/workplace/views/"/>
>                                 <resource uri="/channels/"/>
>                                 <resource uri="/sites/"/>
>                         </immutables>
>                         <principaltranslations/>
>                         <ignoredproperties/>
>                 </import>
>         </importexport>
>         <staticexport enabled="true">
>
> <staticexporthandler>org.opencms.staticexport.CmsOnDemandStaticExportHandler</staticexporthandler>
>                 <exportpath>export</exportpath>
>                 <defaultpropertyvalue>false</defaultpropertyvalue>
>                 <defaultsuffixes>
>                         <suffix key=".jpg"/>
>                         <suffix key=".gif"/>
>                         <suffix key=".png"/>
>                         <suffix key=".doc"/>
>                         <suffix key=".xls"/>
>                         <suffix key=".ppt"/>
>                         <suffix key=".pdf"/>
>                         <suffix key=".txt"/>
>                         <suffix key=".css"/>
>                         <suffix key=".zip"/>
>                         <suffix key=".swf"/>
>                 </defaultsuffixes>
>                 <rendersettings>
>                         <rfs-prefix>/export</rfs-prefix>
>                         <vfs-prefix></vfs-prefix>
>                         <!--rfs-prefix>${CONTEXT_NAME}$/export</rfs-prefix>
>
> <vfs-prefix>${CONTEXT_NAME}${SERVLET_NAME}</vfs-prefix-->
>
>                         <userelativelinks>false</userelativelinks>
>
> <exporturl>http://127.0.0.1:8080${CONTEXT_NAME}/handle404</exporturl>
>                         <plainoptimization>true</plainoptimization>
>                         <testresource uri="/system/shared/page.dtd"/>
>                         <resourcestorender>
>                                 <regex>/sites/.*</regex>
>                                 <regex>/system/galleries/.*</regex>
>
> <regex>/system/modules/.*/resources/.*</regex>
>                         </resourcestorender>
>                 </rendersettings>
>         </staticexport>
> </opencms>
>
> *******************************************************************************************************
> opencms-system.xml:
> ---------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE opencms SYSTEM
> "http://www.opencms.org/dtd/6.0/opencms-system.dtd">
>
> <opencms>
>   <system>
>     <internationalization>
>       <localehandler class="org.opencms.i18n.CmsDefaultLocaleHandler"/>
>       <localesconfigured>
>         <locale>en</locale>
>         <locale>de</locale>
>       </localesconfigured>
>       <localesdefault>
>         <locale>en</locale>
>         <locale>de</locale>
>       </localesdefault>
>     </internationalization>
>     <mail>
>       <mailfrom>nobody at nowhere.com</mailfrom>
>       <mailhost name="my.smtp.server" protocol="smtp" user="username"
> password="secure"/>
>       <mailhost name="alternative.smtp.server"/>
>       <mailhost name="another.alternative.smtp.server"/>
>     </mail>
>     <scheduler/>
>     <versionhistory enabled="true" count="10"/>
>     <resourceinit>
>       <resourceinithandler
> class="org.opencms.file.CmsBackupResourceHandler"/>
>     </resourceinit>
>     <requesthandlers/>
>     <passwordhandler class="org.opencms.security.CmsDefaultPasswordHandler">
>       <encoding>UTF-8</encoding>
>       <digest-type>MD5</digest-type>
>       <param name="compatibility.convert.digestencoding">false</param>
>     </passwordhandler>
>     <sites>
>
> <workplace-server>http://www.diamondway-teachings.org/diamondway-teachings</workplace-server>
>      <default-uri>/sites/default/diamondway-teachings</default-uri>
>      <site server="http://www.diamondway-teachings.org"
> uri="/sites/default/diamondway-teachings">
>      </site>
>     </sites>
>
>
>     <runtimeproperties>
>       <param name="compatibility.support.oldlocales">false</param>
>       <param
> name="compatibility.support.webAppNames">/opencms/opencms/</param>
>     </runtimeproperties>
>     <runtimeclasses>
>       <runtimeinfo class="org.opencms.db.CmsDbContextFactory"/>
>     </runtimeclasses>
>     <defaultusers>
>       <user-admin>Admin</user-admin>
>       <user-guest>Guest</user-guest>
>       <user-export>Export</user-export>
>       <group-administrators>Administrators</group-administrators>
>       <group-projectmanagers>Projectmanagers</group-projectmanagers>
>       <group-users>Users</group-users>
>       <group-guests>Guests</group-guests>
>     </defaultusers>
>     <defaultcontentencoding>UTF-8</defaultcontentencoding>
>     <memorymonitor>
>       <maxusagepercent>90</maxusagepercent>
>       <log-interval>600</log-interval>
>       <email-interval>43200</email-interval>
>       <warning-interval>43200</warning-interval>
>     </memorymonitor>
>     <flexcache>
>       <cache-enabled>true</cache-enabled>
>       <cache-offline>false</cache-offline>
>       <maxcachebytes>8000000</maxcachebytes>
>       <avgcachebytes>6000000</avgcachebytes>
>       <maxentrybytes>400000</maxentrybytes>
>       <maxkeys>2000</maxkeys>
>     </flexcache>
>     <http-authentication>
>       <browser-based>true</browser-based>
>     </http-authentication>
>     <resultcache>
>       <keygenerator>org.opencms.db.CmsCacheKey</keygenerator>
>       <size-users>64</size-users>
>       <size-groups>64</size-groups>
>       <size-usergroups>256</size-usergroups>
>       <size-projects>32</size-projects>
>       <size-resources>8192</size-resources>
>       <size-resourcelists>256</size-resourcelists>
>       <size-properties>1024</size-properties>
>       <size-accesscontrollists>1024</size-accesscontrollists>
>       <size-permissions>1024</size-permissions>
>     </resultcache>
>     <content-notification>
>       <notification-time>365</notification-time>
>       <notification-project>Offline</notification-project>
>     </content-notification>
>   </system>
> </opencms>
>
>
> _______________________________________________
> 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
>



More information about the opencms-dev mailing list