XWiki

XWiki is an open-source enterprise-ready wiki written in Java, with a focus on extensibility.

Installation

Feel free to follow along on the XWiki Installation Guide. These instructions assume you will be using Tomcat and PostgreSQL. It should not be too difficult to apply these guidelines to other combinations.

  • Install PostgreSQL.
  • For easier PostgreSQL administration, install phpPgAdmin.
  • Install tomcat. (Do not forget tomcat-native.)
  • Download the XWiki WAR file.
  • Rename the WAR file to xwiki.
  • Move the WAR file into the /var/lib/tomcatn/webapps directory.
  • Tomcat should automatically extract the WAR file. If not, restart Tomcat.
  • At this point, you may find that a data directory has appeared in /var/lib/tomcatn/webapps. Delete it.
  • As root:
# cd /var/lib/tomcat''n''
# mkdir data
# chown tomcat''n'':tomcat''n'' data
  • Inside the /var/lib/tomcatn/webapps/xwiki/WEB-INF directory:
    • Open the xwiki.properties file and alter the environment.permanentDirectory field to read /var/lib/tomcatn/data/xwiki.
    • Open the hibernate.cfg.xml file and:
      • Comment-out the section entitled "Configuration for the default database".
      • Uncomment the section entitled "PostgreSQL Configuration".
      • Modify the database name (in connection.url), username, and password as desired.
  • Create a role and database in PostgreSQL to match the hibernate configuration.
  • Install from the Arch User Repository.
  • As root:
  • Restart .
  • Launch the XWiki application by clicking on in Tomcat Manager.
  • The XWiki is started with XWiki Wizard Guide to finish your configuration.

Nginx proxy configuration - Solution 1

The official Nginx guide for XWiki is not correct. There is an alternative solution which works for XWiki.

  • Configure nginx site xwiki configuration file.
/etc/nginx/sites-available/xwiki
server {
  listen 80 default_server;
  server_name xwiki.<domain-name>;
  return 301 https://$host$request_uri;
}

server {
  listen [::]:443 ssl;
  listen 443 ssl;

  server_name xwiki.<domain-name>;

  # SSL Certificate section
  ssl_certificate ...
  ssl_certificate_key ...

  location = / {
    return 301 https://$host/xwiki;
  }

  location /xwiki {
    proxy_set_header   X-Real-IP $remote_addr;
    proxy_set_header   Host      $host;
    proxy_http_version 1.1;
    proxy_set_header   Upgrade $http_upgrade;
    proxy_set_header   Connection 'upgrade';
    proxy_cache_bypass $http_upgrade;
    proxy_set_header   X-Forwarded-Host $host;
    proxy_set_header   X-Forwarded-Server $host;
    proxy_set_header   X-Real-IP $remote_addr;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header   X-Forwarded-Proto $scheme;
    proxy_pass         http://127.0.0.1:8080/xwiki;
  }
}
  • Activate a server block in sites-enabled directory .
  • Restart Nginx.

Nginx proxy configuration - Solution 2

I found that instructing nginx to proxy to did not work: the generated URLs were incorrect. Contrary to what is indicated in the XWiki documentation, I could not make the URLs correct through the use of HTTP headers.

The only solution I'm aware of so far is to create a new element in Tomcat's file:

  • Duplicate the existing element and alter the attribute to read xwiki.
  • Alter the attribute to read .
  • Move the xwiki application from to .
  • Restart Tomcat
  • Add xwiki as an alias to localhost in /etc/hosts (add it to the end of the 127.0.0.1 line).
  • Instruct Nginx to proxy to instead.
gollark: ```lualocal r = peripheral.wrap("back")while true do term.clear() term.setCursorPos(1, 1) local txt if r.getActive() then txt = "Aktiv" else txt = "Inaktiv" end print("Der Reaktor ist", txt) print(r.getEnergyStored(), "RF gespeichert") sleep(1)end```
gollark: Also, please use local variables and do indentation.
gollark: What you need to do is check `r.getActive` and the other stuff *in the loop*, and ensure that both branches correctly yield and print everything.
gollark: - it doesn't do anything *else*, so it just loops infinitely and will eventually crash with "too long without yielding".
gollark: Well, the problem is this:- you only set `state` once at the beginning of the program- it's probably `true` then- it goes into the `if state == true` branch, which only sets the `txt` variable
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.