如何在Ubuntu 18.04上安装XWiki

时间:2020-03-05 15:28:18  来源:igfitidea点击:

XWIKI是一款免费的和OpenSource Advanced Wiki软件,它用Java编写。
它在像JBoss,Tomcat等这样的Servlet容器上运行。

它使用诸如MySQL或者PostgreSQL等数据库来存储其信息。

在本教程中,我将解释如何在Ubuntu 18.04上安装XWiki软件,使用其独立分发,这是最快和最简单的方法,因为XWiki所需的所有组件都会自动安装在服务器上。

此XWIKI软件提供内置的XWIKI,具有便携式数据库(HSQLDB)和轻量级Java容器(Docker)。

XWIKI安装步骤

在开始任何安装之前,我建议使用"APT-UPDATE"更新系统软件。
如果此之前未安装,则可以安装WGET和"屏幕"包。

#apt-get update -y
#apt install wget screen

第1步:安装Java

如前所述,XWIKI是基于Java的应用程序,因此我们需要安装"Java 8"或者以上以满足其软件要求。
默认情况下,默认的Ubuntu存储库中不可用Java 8.
因此,我们可以通过向系统添加Webupd8team PPA存储库来安装支持的Java。

#add-apt-repository ppa:webupd8team/java
#apt-get update -y

添加PPA存储库后,我们需要更新存储库包。
一旦完成,我们可以通过在下面运行此命令来安装所需的java 8:

#apt-get install oracle-java8-installer -y
You can confirm the Java version installed.
~# java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

第2步:下载并安装XWIKI

首先,我们需要为此XWiki安装开始新的屏幕会话。
现在我们需要下载所有平台上工作的通用安装程序。
它只需要在系统上安装Java。
我们可以使用以下命令下载XWiki Generic Installer文件:

#screen -U -S xwiki
#wget http://download.forge.ow2.org/xwiki/xwiki-enterprise-installer-generic-8.1-standard.jar

下载此安装程序后,我们可以使用Java安装此下载的包。
安装程序将我们带到各种交互式部分,如下所示,它要求输出,如输入1(接受或者继续)/2(退出)/3(REDISPLAY)从我们继续进行安装。
大多数提示都可以用`1(接受或者继续)回答。
安装程序非常自我解释,因此我们只需按照说明操作。

# java -jar xwiki-enterprise-installer-generic-8.1-standard.jar
Aug 7, 2016 10:08:33 AM INFO: Logging initialized at level 'INFO'
Aug 7, 2016 10:08:33 AM INFO: Commandline arguments:
Aug 7, 2016 10:08:33 AM INFO: Detected platform: ubuntu_linux,version=4.15.0-29-generic,arch=x64,symbolicName=null,javaVersion=1.8.0_181
Welcome to the installation of XWiki Enterprise 8.1!
The homepage is at: http://xwiki.org/
Press 1 to continue, 2 to quit, 3 to redisplay

在按下"1"以继续,它将为我们提供"XWiki Enterprise Readme Note",如下所示:

Please read the following information:
XWiki Enterprise - Readme
XWiki Enterprise is a second generation Wiki engine, features professional features like
XWiki Enterprise also includes an advanced form and scripting engine which makes it an ideal
development environment for constructing data-based intranet applications. It has powerful extensibility features, supports scripting, extensions and is based on a highly modular
architecture. The scripting engine allows to access a powerful API for accessing the XWiki repository in read and write mode.
XWiki Enterprise is used by major companies around the world and has strong Support for a professional usage of XWiki.
Here are some pointers to get you started with XWiki once you have finished installing it:
The documentation can be found on the XWiki.org web site
If you wish to talk to XWiki users or developers please use our
You can also access XWiki's
If you need commercial support please visit the
Support page
Press 1 to continue, 2 to quit, 3 to redisplay
1

按1继续,将我们带我们到许可协议通知。

Press 1 to continue, 2 to quit, 3 to redisplay
1
See the NOTICE file distributed with this work for additional information regarding copyright ownership.
This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this software; if not, write to the Free
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org.
Press 1 to accept, 2 to reject, 3 to redisplay
1

接受许可协议后,它将通过各种安装阶段来设置安装文件夹,自动安装程序,桌面快捷方式,用户快捷方式等。
我正在继续安装程序选择的默认路径。
如果我们需要,我们可以在此部分期间设置自定义路径。

Select the installation path: [/usr/local/XWiki Enterprise 8.1]
Press 1 to continue, 2 to quit, 3 to redisplay
1
[x] Pack 'Core' required
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[x] Include optional pack 'Default Wiki'
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Enter Y for Yes, N for No:
Y
Done!
Press 1 to continue, 2 to quit, 3 to redisplay
1
[ Starting to unpack ]
[ Processing package: Core (1/2) ]
[ Processing package: Default Wiki (2/2) ]
[ Unpacking finished ]
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Create shortcuts in the Start-Menu
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Enter Y for Yes, N for No:
Y
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Create additional shortcuts on the desktop
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Enter Y for Yes, N for No:
Y
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
create shortcut for: all users
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Enter Y for Yes, N for No:
Y
Aug 7, 2016 10:11:08 AM WARNING: Shortcut 'Go to my wiki' has URL but type ('Application') is not 'Link'
Aug 7, 2016 10:11:08 AM WARNING: Shortcut 'Go to my wiki' has URL but type ('Application') is not 'Link'
Aug 7, 2016 10:11:08 AM WARNING: Shortcut 'Documentation' has URL but type ('Application') is not 'Link'
Aug 7, 2016 10:11:08 AM WARNING: Shortcut 'Documentation' has URL but type ('Application') is not 'Link'
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Generate an automatic installation script
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Enter Y for Yes, N for No:
Y
Select the installation script (path must be absolute)[/usr/local/XWiki Enterprise 8.1/auto-install.xml]
Installation was successful
application installed on /usr/local/XWiki Enterprise 8.1
[ Writing the uninstaller data ... ]
[ Console installation done ]

完成安装后,它将显示应用程序安装文件夹,如我们的输出中所示,该文件夹在"/usr/local/xwiki Enterprise 8.1""中。
现在,我们需要移动到应用程序文件夹并运行如下所示的XWiki启动脚本:

# cd /usr/local/XWiki\ Enterprise\ 8.1/
1:/usr/local/XWiki Enterprise 8.1# bash start_xwiki.sh
Starting Jetty on port 8080, please wait...
2016-08-09 09:31:08.832:INFO::main: Logging initialized @692ms
2016-08-09 09:31:09.354:INFO:oejs.Server:main: jetty-9.2.13.v20140730
2016-08-09 09:31:09.378:INFO:oejs.AbstractNCSARequestLog:main: Opened /usr/local/XWiki Enterprise 8.1/data/logs/2016_08_09.request.log
2016-08-09 09:31:09.383:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/usr/local/XWiki%20Enterprise%208.1/jetty/contexts/] at interval 0
2016-08-09 09:31:32,621 [main] INFO o.x.s.s.i.EmbeddedSolrInstance - Starting embedded Solr server... 
2016-08-09 09:31:32,633 [main] INFO o.x.s.s.i.EmbeddedSolrInstance - Using Solr home directory: [data/solr] 
2016-08-09 09:31:38,070 [coreLoadExecutor-6-thread-1] WARN o.a.s.c.SolrCore - [xwiki] Solr index directory '/usr/local/XWiki Enterprise 8.1/data/solr/xwiki/data/index' doesn't exist. Creating new index... 
2016-08-09 09:31:39,756 [main] INFO o.x.s.s.i.EmbeddedSolrInstance - Started embedded Solr server. 
2016-08-09 09:31:41.705:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@6df97b55{/xwiki,file:/usr/local/XWiki%20Enterprise%208.1/webapps/xwiki/,AVAILABLE}{/xwiki}
2016-08-09 09:31:41.802:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@389a9ff6{/,file:/usr/local/XWiki%20Enterprise%208.1/webapps/root/,AVAILABLE}{/root}
2016-08-09 09:31:41.862:INFO:oejs.ServerConnector:main: Started ServerConnector@6a6b8692{HTTP/1.1}{0.0.0.0:8080}
2016-08-09 09:31:41.862:INFO:oejs.Server:main: Started @33722ms
2016-08-09 09:31:41.862:INFO:oxtjl.NotifyListener:main: ---------------------------------
2016-08-09 09:31:41.869:INFO:oxtjl.NotifyListener:main: Server started, you can now open http://ubuntu18.example.com:8080/in your browser to access your wiki.
2016-08-09 09:31:41.871:INFO:oxtjl.NotifyListener:main: ---------------------------------

应用程序将在端口8080上自动启动。
我们需要等待几分钟才能启动应用程序。
一旦完成,我们就可以通过端口8080上的域或者服务器IP访问XWIKI。
不要关闭显示的屏幕终端窗口。
我们的XWIKI服务器需要运行。
我们可以通过终止此屏幕终端来停止此XWIKI服务器。

PS:默认情况下,应用程序在端口8080上运行。
但如果我们想使用自定义端口8081,请确保在端口8081上没有任何东西,并使用以下命令启动XWiki:

#bash start_xwiki.sh -p 8081

第3步:启动应用程序

启动XWIKI后,我们可以将浏览器指向"http://serverip或者hostname:8080 /"以访问Web界面。

我们可以使用默认的admin用户(第一个字母为大写)登录管理面板,其默认密码是admin(小写)。