Installation
This is a summary of how this instance of XWiki was installed...
Install Oracle Linux 8
Install Oracle Linux 8 from boot ISO. Configure:
- Configure network by setting hostname and checking "connect automatically"
- Set the installation source: https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64
- Select Minimal Install for Software selection
- For Installation Destination, select "custom configuration" and delete SWAP and /home partitions
- Configure Date & Time timezone location
- Set root password
- Add user with administrator privileges.
Once installed, disable the firewall.
sudo systemctl stop firewalld
sudo systemctl disable firewalld
Create an 'xwiki' user.
sudo useradd xwiki
Install MySQL
To add the MySQL 8.0 repository, import the necessary GPG keys.
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Add the MySQL 8.0 repository.
sudo dnf config-manager --add-repo https://yum.oracle.com/repo/OracleLinux/OL8/MySQL80/community/x86_64
Install and start the server.
sudo dnf -y install mysql-server
sudo systemctl enable mysqld
Configure MySQL.
mysql_secure_installation
Answer with the following responses:
Create the 'xwiki' MySQL user.
mysql -u root -p
mysql> create database xwiki;
mysql> create user 'xwiki'@'localhost' identified by '*******';
mysql> grant all privileges on *.* to xwiki@localhost;
Install Apache Tomcat
XWiki works with Java 11.
sudo dnf -y install java-11-openjdk-devel.x86_64
Tomcat 9 also works with Java 11.
sudo dnf -y install wget
sudo dnf -y install tar
wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.53/bin/apache-tomcat-9.0.53.tar.gz
sudo chmod ugo+rwx /opt
tar -xf apache-tomcat-9.0.53.tar.gz --directory /opt
Add MySQL driver to Tomcat.
Download & install the JDBC driver:
https://dev.mysql.com/downloads/connector/j/
Place in tomcat 'lib' folder.
sudo yum install java-headless
sudo rpm -ivh mysql-connector-java-8.0.26-1.el8.noarch.rpm
cp /usr/share/java/mysql-connector-java.jar /opt/apache-tomcat-9.0.53/lib/
Configure XWiki
Download and extract XWiki.
sudo yum -y install zip unzip
wget https://nexus.xwiki.org/nexus/content/groups/public/org/xwiki/platform/xwiki-platform-distribution-war/12.10.9/xwiki-platform-distribution-war-12.10.9.war
sudo su xwiki
unzip xwiki-platform-distribution-war-12.10.9.war -d /opt/xwiki-platform-distribution-war-12.10.9
Rename ROOT web app.
cd /opt/apache-tomcat-9.0.53/webapps
mv ROOT tomcat
Install XWiki at the ROOT app.
ln -s /opt/xwiki-platform-distribution-war-12.10.9 ROOT
Configure the Hibernate settings.
Modify WEB-INF/hibernate.cfg.xml
Comment out default database, uncomment MySQL, modify these properties:
<property name="hibernate.connection.url">jdbc:mysql://localhost/xwiki?useSSL=false&serverTimezone=America/Chicago</property>
<property name="hibernate.connection.username">xwiki</property>
<property name="hibernate.connection.password">*******</property>
Create a startup script 'xwiki' in /etc/init.d
#!/bin/bash
# chkconfig: 345 85 60
# description: Xwiki running under Tomcat 9
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk
export PATH=$JAVA_HOME/bin:$PATH
DOMAIN="/opt/apache-tomcat-9.0.45"
OWNER="xwiki"
LOG="/dev/null"
export CATALINA_OPTS="-Xms4G -Xmx4G -XX:+UseG1GC -Dxwiki.data.dir=/var/lib/xwiki/data"
export JAVA_OPTS="${JAVA_OPTS} -Djava.awt.headless=true"
case "$1" in
'start')
su $OWNER -c "nohup $DOMAIN/bin/startup.sh > $LOG 2>&1 &"
;;
'stop')
su $OWNER -c "nohup $DOMAIN/bin/shutdown.sh > $LOG 2>&1 &"
;;
esac
Create the data directory.
mkdir -p /var/lib/xwiki/data
chown xwiki /var/lib/xwiki/data
Start XWiki
cd /etc/init.d
sudo chkconfig --add xwiki
sudo ./xwiki start
Reverse Proxy
Tips for configuring NGINX can be found here:
https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationTomcat/