We need Java to be installed on our system because XWiki is written in it. Java can be installed with the following command:<\/p>\n
apt-get install default-jdk gnupg2 -y<\/pre>\nOnce, Java is installed you can check the version with the following command:<\/p>\n
java --version<\/pre>\nThe following output should be returned.<\/p>\n
root@vps:~# java --version\nopenjdk 11.0.11 2021-04-20\nOpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)\nOpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)<\/pre>\n<\/span>Step 3. XWiki GPG public key and repository<\/span><\/h2>\nThe signing GPG key can be added with the following command:<\/p>\n
wget https:\/\/maven.xwiki.org\/xwiki-keyring.gpg -P \/usr\/share\/keyrings\/<\/pre>\nUbuntu 20.04 does not contain the XWiki repo and that is why this step is important for adding it.<\/p>\n
wget \"https:\/\/maven.xwiki.org\/stable\/xwiki-stable.list\" -P \/etc\/apt\/sources.list.d\/<\/pre>\nUpdate the repository with the following command:<\/p>\n
sudo apt update -y<\/pre>\n<\/span>Step 4. Install the XWiki along with Tomcat and MySQL<\/span><\/h2>\nBefore installing XWiki there is an option to list the available XWiki packets:<\/p>\n
apt-cache search xwiki<\/pre>\nIn this tutorial we need to install the xwiki-tomcat9-common and xwiki-tomcat9-mariadb with the following command:<\/p>\n
sudo apt install xwiki-tomcat9-common xwiki-tomcat9-mariadb -y<\/pre>\nWhile installing the required packets, the prompt will ask you to enter the MySQL root password for your XWiki installation.<\/p>\n
Hit Yes, on the first window.<\/p>\n\n\n <\/figure>\n\n\n\nEnter the MySQL root password and hit Yes.<\/p>\n\n\n\n <\/figure>\n\n\n\nConfirm the MySQL root password and hit Yes.<\/p>\n\n\n\n <\/figure>\n\n\n\nWhile the installation is in progress it is a good practice to save the MySQL root password in your notes for later configuration.<\/p>\n\n\n\n
Now, when the packets are installed we can verify if the tomcat and MariaDB services are up and running.<\/p>\n\n\n\n
Execute the following command to see if the tomcat service is running properly:<\/p>\n\n\n\n
systemctl status tomcat9<\/pre>\n\n\n\nYou should see the following output:<\/p>\n\n\n\n
root@vps:\/# systemctl status tomcat9\n\u25cf tomcat9.service - Apache Tomcat 9 Web Application Server\n Loaded: loaded (\/lib\/systemd\/system\/tomcat9.service; enabled; vendor preset: enabled)\n Drop-In: \/etc\/systemd\/system\/tomcat9.service.d\n \u2514\u2500xwiki-tomcat9-systemd.conf\n Active: active (running) since Mon 2021-10-11 23:32:55 UTC; 7min ago\n Docs: https:\/\/tomcat.apache.org\/tomcat-9.0-doc\/index.html\n Main PID: 91633 (java)\n Tasks: 67 (limit: 4617)\n Memory: 690.8M\n CGroup: \/system.slice\/tomcat9.servic<\/pre>\n\n\n\nTo check if the MariaDB service is up and running, execute the following command:<\/p>\n\n\n\n
sudo systemctl status mariadb<\/pre>\n\n\n\nYou should see the following output:<\/p>\n\n\n\n
root@vps:\/# sudo systemctl status mariadb\n\u25cf mariadb.service - MariaDB 10.3.31 database server\n Loaded: loaded (\/lib\/systemd\/system\/mariadb.service; enabled; vendor preset: enabled)\n Active: active (running) since Mon 2021-10-11 23:30:46 UTC; 10min ago\n Docs: man:mysqld(8)\n https:\/\/mariadb.com\/kb\/en\/library\/systemd\/\n Main PID: 90670 (mysqld)\n Status: \"Taking your SQL requests now...\"\n Tasks: 30 (limit: 4617)\n Memory: 69.9M\n CGroup: \/system.slice\/mariadb.service\n \u2514\u250090670 \/usr\/sbin\/mysqld<\/pre>\n\n\n\n<\/span>Step 5. Install Nginx as a web server<\/span><\/h2>\n\n\n\nWe need a web server so we can set up the reverse proxy for accessing the XWiki installation.<\/p>\n\n\n\n
Execute the following command to install the Nginx webserver:<\/p>\n\n\n\n
sudo apt install nginx -y<\/pre>\n\n\n\nOnce, Nginx is installed, start it with the following command:<\/p>\n\n\n\n
sudo systemctl start nginx<\/pre>\n\n\n\nCheck the service if is up and running:<\/p>\n\n\n\n
sudo systemctl status nginx<\/pre>\n\n\n\nYou should see the following output:<\/p>\n\n\n\n
root@vps:\/# sudo systemctl status nginx\n\u25cf nginx.service - A high performance web server and a reverse proxy server\n Loaded: loaded (\/lib\/systemd\/system\/nginx.service; enabled; vendor preset: enabled)\n Active: active (running) since Mon 2021-10-11 23:44:40 UTC; 5s ago\n Docs: man:nginx(8)\n Process: 93791 ExecStartPre=\/usr\/sbin\/nginx -t -q -g daemon on; master_process on; (code=exited, status=0\/SUCCESS)\n Process: 93798 ExecStart=\/usr\/sbin\/nginx -g daemon on; master_process on; (code=exited, status=0\/SUCCESS)\n Main PID: 93799 (nginx)\n Tasks: 5 (limit: 4617)\n Memory: 5.0M\n CGroup: \/system.slice\/nginx.service\n<\/pre>\n\n\n\n