[opencms-dev] multi-site static export

Christian Steinert Christian at Christian-steinert.de
Sat Apr 27 09:43:53 CEST 2013


Diese Dave

As far as I understand it you are right that the export names for the two 
sites must be different. This means that you have to export the sites into 
different subfolders. These subfolders will then also be needed on the 
weebserver itself - at least if you use absolute paths. So site 2 would 
live in a folder called "2" and you would have to put an alternative index 
file onto the server that redirects from /index.html to /2/index.html
Probably you also have to export site 1 into a subfolder to make sure that 
the two experts don't get mixed up.

This kind of setup definitely works.

In addition you can try to configure opencms to use relative links and see 
if that allows you to put the second site into the httproot folder despite 
exporting it into a subfolder. Last time I tried relative links I went into 
some sort of trouble but this was several years ago. Sadly I don't recall 
what exactly the trouble was.

This is all that I can think of.

Good look
Christian


Gesendet mit AquaMail für Android
http://www.aqua-mail.com


Am 27. April 2013 00:53:50 schrieb Dave Clark <daveclark at utah.gov>:
> Is it possible to use opencms as a content management system for multiple
> completely static sites? We are running v8.5.1 in Tomcat7 as the root
> context.  All content from multiple sites is static and should be exported
> (i.e., not ever served directly from opencms except by the 404 handler when
> appropriate). There is a web server in front of tomcat that maps root
> directories to /path/to/site1 and /path/to/site2 respectively and forwards
> 404 errors to the opencms handler.  However, even if I call the 404 handler
> directly using http://site1:8080/opencms/handle404?exporturi=/index.html or
> http://site2:8081/opencms/handle404?exporturi=/sites/2/index.html, the
> files in site2 always get written as /path/to/site2/sites/2/[filename] and
> the links inside that file include the /sites/2/[filename]  in the href
> which makes the url http://site2:8081/sites/2/[filename]
>
> The site1 files seem to behave correctly. Is there a configuration element
> that isn't being set that could be causing this?  The two folders
> (/sites/default and /sites/2) cannot have the same exportname property "/"
> so I can't see how this would ever work.  The document at
> http://www.algoa.ch/opencms/export/sites/default/alkacon-documentation/documentation_staticexport/advanced/tutorial.html
> seems
> to indicate this is possible but I just can't make it work.
>
> Below is a snippet of opencms-importexport.xml:
>
>   <staticexport enabled="true">
>
> <staticexporthandler>org.opencms.staticexport.CmsOnDemandStaticExportHandler</staticexporthandler>
>
> <linksubstitutionhandler>org.opencms.staticexport.CmsDefaultLinkSubstitutionHandler</linksubstitutionhandler>
>     <exportpath>/path/to/site1</exportpath>
>     <exportworkpath>temp</exportworkpath>
>     <exportbackups>2</exportbackups>
>     <defaultpropertyvalue>true</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></rfs-prefix>
>       <vfs-prefix>${SERVLET_NAME}</vfs-prefix>
>       <vfs-prefix>${SERVLET_NAME}</vfs-prefix>-->
>       <userelativelinks>true</userelativelinks>
>       <exporturl>http://site1:8080${SERVLET_NAME}/handle404</exporturl>
>       <plainoptimization>true</plainoptimization>
>       <testresource uri="/system/shared/page.dtd"/>
>       <resourcestorender>
>         <regex>/sites/.*</regex>
>         <regex>/system/workplace/commons/style/.*</regex>
>         <regex>/system/galleries/.*</regex>
>         <regex>/system/modules/.*/resources/.*</regex>
>       </resourcestorender>
>       <rfs-rules>
>         <rfs-rule>
>           <name>site2</name>
>           <description>site2 rfs location</description>
>           <source>/sites/2/.*</source>
>           <rfs-prefix></rfs-prefix>
>           <exportpath>/path/to/site2</exportpath>
>           <userelativelinks>false</userelativelinks>
>           <related-system-res/>
>         </rfs-rule>
>       </rfs-rules>
>     </rendersettings>
>   </staticexport>
>
> I have also changed the above so that /sites/default (site1) has its own
> rfs-rule but the result is the same. Here is the site config from
> opencms-system.xml:
>
>         <sites>
>             <workplace-server>http://site1:8080</workplace-server>
>             <default-uri>/sites/default/</default-uri>
>             <site server="http://site1:8080" uri="/sites/default/"/>
>             <site server="http://site2:8081" uri="/sites/hmis/"/>
>         </sites>
>
> --
> Dave Clark
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20130427/b7c99f36/attachment.htm>


More information about the opencms-dev mailing list