XWiki Snap Published on snap Store

Hey guys,
the XWiki snap has been released on the snap store.
You can install it and test it out . It would be helpful to get your feedback. If you face any issues you can report them here.
will be updating the documentation on how to set up your database and other configuration soon until then here are some helpful alternatives :

To edit the configuration files:

  • stop the server using the command -->sudo snap stop xwiki.tomcat
  • now you can edit the files in /root/var/snap/xwiki/current/webapps/xwiki
  • start the server again using the command -->sudo snap start xwiki.tomcat

To setup your database

Note:

  • all the JDBC drivers for all supported databases have been preinstalled
  • After installing the snap wait a few seconds for the servers to start before launching localhost
  • The permanent directory is set to var/lib/xwiki (if you don’t have the directory you might have to create it manually)(will be updating to create the permanent directory automatically soon )
1 Like

I don’t have such folder on Ubuntu 21.10. All I could find is /root/snap/xwiki/current but it’s empty.

hey @tmortagne,
I uninstalled the snap and reinstalled but my snap folder does have XWiki/current. (Ubuntu 22.04)
are you in the correct directory?
The root directory meant here is denoted by (/) containing the folders such as (/var /lib /etc)
(top-level directories) .

I think the documentation should say /var/snap/xwiki/current/webapps/xwiki instead of root/var/snap/xwiki/current/webapps/xwiki .Thanks i will make the changes :slight_smile:

Much better indeed. But I’m not sure it make much sense to have so much in /var, it seems to contain the whole XWiki and not just the configuration files. For example, how will the upgrade behave ?

Unfortunately, it does not really work: as far as I can see modifications made to those files are not taken into account at all, and it keep behaving as if there was no modification at all.

hey @tmortagne ,
it seems I forgot to add the mysql-connector-java-8.0.29.jar into the script folder . Will be pushing the changes ASAP.
As far as editing the files go I tested it multiple times it is possible to edit the following files :

  • hibernate.cfg.xml
  • xwiki.properties
    It seems that one cannot delete or create new files but you can edit the existing files.
    (thus cannot add MySQL JDBC driver manually)
    Note:
    edit files with sudo privileges and stop the xwiki.tomcat service before editing
    (sudo snap stop xwiki.tomcat)
    make sure that your MySQL root@localhost password is set to 'xwiki’
    (SET PASSWORD FOR root@localhost=‘xwiki’; )

I don’t think so as the connection with MySQL works fine, my problem is that the change I made to the configuration (use a different database name) is not taken into account at all (it keeps using the database with name xwiki instead of the one I indicated).

Yes, I stopped XWiki before modifying the configuration.

Again the connection works fine, it’s just my modification which are not taken into account.

ya, the MySQL connector was already pushed so that isn’t the problem.

can you please elaborate on what exactly you changed? (like the line number and the file )
I tried changing the database password and it worked completely fine . As far as I think it might be hard-coded with the snap . (is the existing Debian package on your system causing this issue?)

I changed the name of the database for the main wiki which mean:

  • modifying it in the connection URL in hibernate.cfg.xml
  • modifying it in the property xwiki.db of the xwiki.cfg file

One thing you did not indicate is how to access the XWiki log, would make easier to understand exactly what was taken into account and what wasn’t.

There is no debian package of XWiki install, it would not work at all to have both running at the same time because they would try to listen to the same port.

After some more testing, I have the feeling that what is not taken into account is changes made to xwiki.cfg file (which is a configuration file as important as xwiki.properties, basically old stuff are in xwiki.cfg and new in xwiki.properties).

The snap replaces hibernate.cfx.xml and xwiki.properties which I guess makes them editable in some way. I would try replacing the xwiki.cfg in the snap (which might make it editable).
are there any other files a user might need to edit?

As suggested in a previous discussion, you should take inspiration from the Debian package: everything which is considered configuration files is installed in /etc/xwiki/.

published the snap with replaced xwiki.cfg . Would be looking at the Debian package again :slight_smile:

hey @tmortagne,
A humble request, would you please test if the changed files work with the newer snap that I just uploaded. (I couldn’t replicate the changes mentioned here(sorry for the inconvenience)) .If it allows edits then I would implement similar changes to all the files in /etc/xwiki/.
Also made a forum post on snapcraft about the following question (How do i edit config files - snapcraft - snapcraft.io)

hey @tmortagne,
I will try replacing all the files in the etc/xwiki to see if it works as a temporary fix.
I plan on creating a hook such that the XWiki looks for configuration files someplace else like it was implemented in the Debian package. :slight_smile:

Yes, xwiki.cfg modifications are taken into account now.

1 Like