Hi list, In order to ease XWiki installation for those who don't want to deal with tomcat/mysql, Ludovic asked me to work on a standalone installation of XWiki based on jetty and hsqldb. I think I get to a point where I have something useful, so I wanted to describe what I have done, and if Ludo agrees to create an account for me, I will be able to commit some files in the next few days ;-) So, I have added a 'standalone' target into the build.xml file (see below). This target expands a jetty.5.1.5 archive, removes the sample applications, inserts the xwiki release (exploded war) into the webapps directory, copies some configuration files in order to make xwiki use an in-process hsqldb database. hsqldb database files are also copied into the package. The database data have been taken from the mysql export (xwiki-db-0.9.2.sql). At the root of this package, 4 scripts are eventually copied in order to help user to start/stop the application server (start_xwiki.bat|sh, stop_xwiki.bat|sh). The produced package is usable 'as-is' simply by copying the files somewhere on your disk. And yes, it works on a USB key also. It weights a total of 37 MB. With this target, I have also written a basic Nullsoft Installer script, in order to help Windows users in installing the package. Basically this installer installs all the files produced by the standalone target in a user specified directory, then create 3 shortcuts in the Windows start menu: start, stop (à la tomcat) and uninstall. Before doing this the installer checks if a jre 1.4 or newer is installed (I'm not sure that 1.4 is required for xwiki, this can be changed easily), if not the user is redirected to the download section of the Java web site. This installer weight a total of 30 MB. On the todo list of this installer : - add the possibility to specify a port number for the jetty server ; - install a bundled jre if needed (have to check the sun license in order to be sure this is possible) - add a final window explaining what to do after the installation (use the start/stop shortcuts, start a browser...) On the todo list of this standalone installation : - add an installer for Mac OS X platforms - add an installer for Linux platforms (autopackage ?), may be not so useful, since Linux users are more acquainted to tomcat/mysql installation ... Any question, comment, idea would be greatly appreciated. Seb. here is the standalone target code : <!-- Standalone package properties --> <property name="standalone.base.dir" value="${basedir}/standalone"/> <property name="standalone.jetty.archive.dir" value="jetty-5.1.5"/> <property name="standalone.jetty.archive" value="${standalone.base.dir}/${standalone.jetty.archive.dir}.zip"/> <property name="standalone.package.name" value="xwikionjetty"/> <property name="standalone.release.dir" value="${release.dir}/${standalone.package.name}"/> <fileset id="standalone.db.bootstrap" dir="${standalone.base.dir}/db" includes="xwiki_db.*"/> <fileset id="standalone.config" dir="${standalone.base.dir}/config" includes="xwiki.cfg, hibernate.cfg.hsql.xml"/> <fileset id="standalone.scripts" dir="${standalone.base.dir}/scripts" includes="*"/> <target name="standalone" depends="release"> <!-- unzip jetty archive into standalone release dir --> <!-- exclude some jetty provided jar files in order to avoid clashes --> <!-- these jars are provided by xwiki --> <unzip src="${standalone.jetty.archive}" dest="${release.dir}"> <patternset> <exclude name="**/ext/xercesImpl.jar"/> <exclude name="**/ext/xml-apis.jar"/> <exclude name="**/ext/xmlParserAPIs-2.5.jar"/> </patternset> </unzip> <move todir="${standalone.release.dir}"> <fileset dir="${release.dir}/${standalone.jetty.archive.dir}"/> </move> <!-- remove example webapps --> <delete file="${standalone.release.dir}/webapps/javadoc.war"/> <delete dir="${standalone.release.dir}/webapps/template"/> <!-- explode xwiki war file into jetty/webapps --> <mkdir dir="${standalone.release.dir}/webapps/xwiki"/> <unwar src="${release.warfile}" dest="${standalone.release.dir}/webapps/xwiki"/> <!-- replace configuration files with standalone version --> <copy todir="${standalone.release.dir}/webapps/xwiki/WEB-INF" overwrite="true"> <fileset refid="standalone.config"/> </copy> <!-- install db bootstrap --> <mkdir dir="${standalone.release.dir}/db"/> <copy todir="${standalone.release.dir}/db"> <fileset refid="standalone.db.bootstrap" /> </copy> <!-- install start/stop scripts --> <copy todir="${standalone.release.dir}"> <fileset refid="standalone.scripts"/> </copy> </target>
Great initiative !!!! this will facilitate the life of many interested people,even technical people, who just don't have time to fool around with installation problems. For linux, I would like a standard .deb, .rpm system. -- Luis Arias http://www.xwiki.com http://www.innover-entreprendre.net skype : kaaloo +33 6 14 20 87 93 mobile
Great Sebastien, That looks good to me.. My main comment, would be considering upgrades. Suppose you want to upgrade your USB key or local install and not your database. Would it be possible to have the installer ask wether or not to override the existing database. Maybe add script to the menu to allow to import/export the database to XML could be useful also if we want to import a database coming from another wiki. We have somewhere an ant task which could allow to make the import in HSQLDB from XML files instead of from sql. This could be done by the ant script and the default database commited as XML files in the tree. The ant task calls a groovy script making the import in an empty database. This looks really cool and I think one great next step will be adding the P2P XWiki plugin which would allow syncrhonizing your local wiki with a distant wiki. This would allow to have an offline Wiki on your USB key which can be synchronized online.. You can put a alpha-package on xwiki.org so we can test on USB keys and see how it goes. Ludovic Sébastien Gaïde a écrit :
Hi list,
In order to ease XWiki installation for those who don't want to deal with tomcat/mysql, Ludovic asked me to work on a standalone installation of XWiki based on jetty and hsqldb.
I think I get to a point where I have something useful, so I wanted to describe what I have done, and if Ludo agrees to create an account for me, I will be able to commit some files in the next few days ;-)
So, I have added a 'standalone' target into the build.xml file (see below). This target expands a jetty.5.1.5 archive, removes the sample applications, inserts the xwiki release (exploded war) into the webapps directory, copies some configuration files in order to make xwiki use an in-process hsqldb database. hsqldb database files are also copied into the package. The database data have been taken from the mysql export (xwiki-db-0.9.2.sql).
At the root of this package, 4 scripts are eventually copied in order to help user to start/stop the application server (start_xwiki.bat|sh, stop_xwiki.bat|sh).
The produced package is usable 'as-is' simply by copying the files somewhere on your disk. And yes, it works on a USB key also. It weights a total of 37 MB.
With this target, I have also written a basic Nullsoft Installer script, in order to help Windows users in installing the package. Basically this installer installs all the files produced by the standalone target in a user specified directory, then create 3 shortcuts in the Windows start menu: start, stop (à la tomcat) and uninstall. Before doing this the installer checks if a jre 1.4 or newer is installed (I'm not sure that 1.4 is required for xwiki, this can be changed easily), if not the user is redirected to the download section of the Java web site. This installer weight a total of 30 MB.
On the todo list of this installer :
- add the possibility to specify a port number for the jetty server ; - install a bundled jre if needed (have to check the sun license in order to be sure this is possible) - add a final window explaining what to do after the installation (use the start/stop shortcuts, start a browser...)
On the todo list of this standalone installation :
- add an installer for Mac OS X platforms - add an installer for Linux platforms (autopackage ?), may be not so useful, since Linux users are more acquainted to tomcat/mysql installation ...
Any question, comment, idea would be greatly appreciated.
Seb.
here is the standalone target code :
<!-- Standalone package properties --> <property name="standalone.base.dir" value="${basedir}/standalone"/> <property name="standalone.jetty.archive.dir" value="jetty-5.1.5"/> <property name="standalone.jetty.archive" value="${standalone.base.dir}/${standalone.jetty.archive.dir}.zip"/> <property name="standalone.package.name" value="xwikionjetty"/> <property name="standalone.release.dir" value="${release.dir}/${standalone.package.name}"/>
<fileset id="standalone.db.bootstrap" dir="${standalone.base.dir}/db" includes="xwiki_db.*"/> <fileset id="standalone.config" dir="${standalone.base.dir}/config" includes="xwiki.cfg, hibernate.cfg.hsql.xml"/> <fileset id="standalone.scripts" dir="${standalone.base.dir}/scripts" includes="*"/>
<target name="standalone" depends="release"> <!-- unzip jetty archive into standalone release dir --> <!-- exclude some jetty provided jar files in order to avoid clashes --> <!-- these jars are provided by xwiki -->
<unzip src="${standalone.jetty.archive}" dest="${release.dir}"> <patternset> <exclude name="**/ext/xercesImpl.jar"/> <exclude name="**/ext/xml-apis.jar"/> <exclude name="**/ext/xmlParserAPIs-2.5.jar"/> </patternset> </unzip> <move todir="${standalone.release.dir}"> <fileset dir="${release.dir}/${standalone.jetty.archive.dir}"/> </move>
<!-- remove example webapps --> <delete file="${standalone.release.dir}/webapps/javadoc.war"/> <delete dir="${standalone.release.dir}/webapps/template"/>
<!-- explode xwiki war file into jetty/webapps --> <mkdir dir="${standalone.release.dir}/webapps/xwiki"/> <unwar src="${release.warfile}" dest="${standalone.release.dir}/webapps/xwiki"/>
<!-- replace configuration files with standalone version --> <copy todir="${standalone.release.dir}/webapps/xwiki/WEB-INF" overwrite="true"> <fileset refid="standalone.config"/> </copy>
<!-- install db bootstrap --> <mkdir dir="${standalone.release.dir}/db"/> <copy todir="${standalone.release.dir}/db"> <fileset refid="standalone.db.bootstrap" /> </copy>
<!-- install start/stop scripts --> <copy todir="${standalone.release.dir}"> <fileset refid="standalone.scripts"/> </copy> </target>
------------------------------------------------------------------------
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Ludovic Dubost a écrit :
Great Sebastien,
That looks good to me..
My main comment, would be considering upgrades. Suppose you want to upgrade your USB key or local install and not your database. Would it be possible to have the installer ask wether or not to override the existing database.
yes, this is possible. I will add this and the possibility to change the jetty server port, asap.
Maybe add script to the menu to allow to import/export the database to XML could be useful also if we want to import a database coming from another wiki.
that would be great.
We have somewhere an ant task which could allow to make the import in HSQLDB from XML files instead of from sql. This could be done by the ant script and the default database commited as XML files in the tree. The ant task calls a groovy script making the import in an empty database.
in fact, the hsqldb files used to bootstrap the xwiki standalone version have been created using the import script found in the backup package, so the data used as source are already XML files. These xml files have been generated using the export script found in the same backup package, using a mysql database as source. So if the backup package can be found somewhere in the source tree, along with the xml files, it won't be difficult to generate the hsqldb files during the standalone target.
This looks really cool and I think one great next step will be adding the P2P XWiki plugin which would allow syncrhonizing your local wiki with a distant wiki. This would allow to have an offline Wiki on your USB key which can be synchronized online..
that sounds great, indeed.
You can put a alpha-package on xwiki.org so we can test on USB keys and see how it goes.
ok, I propose to put that in the Dev/ProposedFeatures section. The package weights about 30 MB, you confirm me that's it's not a problem to create such a big attachment ? Seb.
Sebastien Gaïde a écrit :
Maybe add script to the menu to allow to import/export the database to XML could be useful also if we want to import a database coming from another wiki.
that would be great.
We have somewhere an ant task which could allow to make the import in HSQLDB from XML files instead of from sql. This could be done by the ant script and the default database commited as XML files in the tree. The ant task calls a groovy script making the import in an empty database.
in fact, the hsqldb files used to bootstrap the xwiki standalone version have been created using the import script found in the backup package, so the data used as source are already XML files. These xml files have been generated using the export script found in the same backup package, using a mysql database as source.
So if the backup package can be found somewhere in the source tree, along with the xml files, it won't be difficult to generate the hsqldb files during the standalone target.
Cool.. I've put the code I have for an ant based version of the import/export package. http://www.xwiki.org/xwiki/bin/view/AdminGuide/BackupAntTask It still needs some work to integrate with the ant build. We kind of need a standalone version of import/export but it needs quite a lot of jars from xwiki.
This looks really cool and I think one great next step will be adding the P2P XWiki plugin which would allow syncrhonizing your local wiki with a distant wiki. This would allow to have an offline Wiki on your USB key which can be synchronized online..
that sounds great, indeed.
You can put a alpha-package on xwiki.org so we can test on USB keys and see how it goes.
ok, I propose to put that in the Dev/ProposedFeatures section. The package weights about 30 MB, you confirm me that's it's not a problem to create such a big attachment ?
It's a little big.. We can put it on ObjectWeb but we should add 'alpha' and 'svn' in the name to make sure people realize it's not perfect yet and the xwiki version comes from svn (it should not be used on older data yet). You should create an account on http://forge.objectweb.org and we can give you rights for this. Ludovic
Seb.
------------------------------------------------------------------------
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Ludovic Dubost a écrit :
You should create an account on http://forge.objectweb.org and we can give you rights for this.
it's created (sgaide). S.
Sébastien Gaïde wrote:
Hi list,
In order to ease XWiki installation for those who don't want to deal with tomcat/mysql, Ludovic asked me to work on a standalone installation of XWiki based on jetty and hsqldb.
Mikhail and I have been working on a topic that may be of interest in this context. Our approach consists in creating an Eclipse "product" embedding XWiki as a plugin: we created a product that uses following plugins: - XWiki src tree with very few added files for making a plugin of it - org.eclipse.tomcat plugin - org.eclipse.help plugin - a plugin that is used to launch the web applications - org.eclipse.osgi plugin A hsqldb plugin could be added easily. We then export the plugins using the Eclipse product export tool, and then launch an XWiki server issuing "xwiki" on the command line. Eclipse "products" are described there: http://help.eclipse.org/help30/index.jsp?topic=/org.eclipse.platform.doc.isv... "An Eclipse based product is a stand-alone program built with the Eclipse platform. A product may optionally be packaged and delivered as one or more features, which are simply groupings of plug-ins that are managed as a single entity by the Eclipse update mechanisms." Eclipse products can embed a JRE. See also this URL also about cross platform product export: http://download.eclipse.org/eclipse/downloads/drops/R-3.1-200506271435/eclip... With this approach: - the launcher is available on any platform supported by Eclipse -> you don't have to maintain one launching script for each targeted platform - the Eclipse update plugin can be used for proposing local installations to get updated with the latest XWiki release... - Eclipse help app can be embedded as a webapp, which is nice for browsing the documentation -> we could have XWiki doc available in it We can publish some code to the repository, in xwiki-sandbox/eclipse-product for instance? Stéphane -- Stéphane Laurière [email protected] http://club.mandriva.com
Hi Stéphane and Mikhail, We discussed this with Sebastien and where looking for this to be the next step. Adding Eclipse RCP as an embedder for this. Some admin tools like import/export and replication could be built in the Eclipse Interface It seemed Jetty is a lighter solution than tomcat for this, which is why I directed him to jetty+hsqldb+xwiki. The launcher with an embedded JRE packaged with Eclipse standards seems like a great idea to give us some advanced features like updating.. Ludovic Stéphane Laurière a écrit :
Sébastien Gaïde wrote:
Hi list,
In order to ease XWiki installation for those who don't want to deal with tomcat/mysql, Ludovic asked me to work on a standalone installation of XWiki based on jetty and hsqldb.
Mikhail and I have been working on a topic that may be of interest in this context. Our approach consists in creating an Eclipse "product" embedding XWiki as a plugin: we created a product that uses following plugins: - XWiki src tree with very few added files for making a plugin of it - org.eclipse.tomcat plugin - org.eclipse.help plugin - a plugin that is used to launch the web applications - org.eclipse.osgi plugin
A hsqldb plugin could be added easily. We then export the plugins using the Eclipse product export tool, and then launch an XWiki server issuing "xwiki" on the command line.
Eclipse "products" are described there: http://help.eclipse.org/help30/index.jsp?topic=/org.eclipse.platform.doc.isv...
"An Eclipse based product is a stand-alone program built with the Eclipse platform. A product may optionally be packaged and delivered as one or more features, which are simply groupings of plug-ins that are managed as a single entity by the Eclipse update mechanisms."
Eclipse products can embed a JRE. See also this URL also about cross platform product export: http://download.eclipse.org/eclipse/downloads/drops/R-3.1-200506271435/eclip...
With this approach: - the launcher is available on any platform supported by Eclipse -> you don't have to maintain one launching script for each targeted platform - the Eclipse update plugin can be used for proposing local installations to get updated with the latest XWiki release... - Eclipse help app can be embedded as a webapp, which is nice for browsing the documentation -> we could have XWiki doc available in it
We can publish some code to the repository, in xwiki-sandbox/eclipse-product for instance?
Stéphane
------------------------------------------------------------------------
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
participants (5)
-
Ludovic Dubost -
Luis Arias -
Sebastien Gaïde -
Stéphane Laurière -
Sébastien Gaïde