CentOS上安装运行XWiKi

简介: CentOS上安装运行XWiKi

现在XWiKi已经一行命令支持安装java -jar xwiki-enterprise-installer-generic-9.4-standard.jar。

war安装我搞了三天都没有搞定,参考了《CentOS 7上安装XWiki 8.2.1 详解》和《开源框架XWIKI搭建介绍》。我直接怀疑XWiKi是否还支持web安装(xwiki一代),写哪些web安装的文章是否亲自安装过。

下面介绍XWiKi二代安装方式,zip安装。

XWiki 要求

Java 8 或更高版本

支持 Servlet 3.0.1 的 Servlet 容器

用于支持数据库的 JDBC 4 驱动程序

至少 2GB RAM(对于较小的 wiki 是 1GB)

你可以从阿里云等云服务商购买一个 VPS,可以使用一键部署的 Java 环境

centos7和红帽系统相似,具体查看《Linux就该这么学》

我们将在本教程中使用 CentOS 7 服务器。

1.安装前准备,安装 CentOS系统,安装yum, 安装nano 和 wget。

安装操作系统不用说了。

安装yum:

[root@localhost gitlab]# yum install -y patch
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.163.com
正在解决依赖关系

已安装:
  patch.x86_64 0:2.7.1-10.el7_5

安装 nano 和 wget:yum install nano wget

2.安装 Java。见《CentOS上安装openjdk》

如java都没有安装成功,那么以后都免谈了。

3.下载XWiKi,先查看最新版本

[root@localhost XWiki]# wget http://download.forge.ow2.org/xwiki/xwiki-enterprise-installer-generic-9.4-standard.jar

目前最新版本是9.4版本。

拷贝版本的链接,下载安装包。

[root@localhost jre]# cd /usr/local/XWiki
[root@localhost XWiki]# cd ..
[root@localhost local]# ls
apache-tomcat-9.0.13.zip  bin  etc  games  git  got  include  lib  lib64  libexec  sbin  share  src  xwiki  XWiki  xwiki_tomcat
[root@localhost local]# wget http://download.forge.ow2.org/xwiki/xwiki-enterprise-installer-generic-9.4-standard.jar
--2018-12-13 11:45:27--  http://download.forge.ow2.org/xwiki/xwiki-enterprise-installer-generic-9.4-standard.jar
正在解析主机 download.forge.ow2.org (download.forge.ow2.org)... 195.154.179.52
正在连接 download.forge.ow2.org (download.forge.ow2.org)|195.154.179.52|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:279542819 (267M) [application/java-archive]
正在保存至: “xwiki-enterprise-installer-generic-9.4-standard.jar”

100%[======================================================================================================================================================>] 279,542,819 10.6MB/s 用时 31s

2018-12-13 11:46:01 (8.65 MB/s) - 已保存 “xwiki-enterprise-installer-generic-9.4-standard.jar” [279542819/279542819])

[root@localhost local]# ls
apache-tomcat-9.0.13.zip  bin  etc  games  git  got  include  lib  lib64  libexec  sbin  share  src  xwiki  XWiki  xwiki-enterprise-installer-generic-9.4-standard.jar  xwiki_tomcat

4.建立xwiki文件夹mkdir xwiki。

安装XWiKi:

java -jar xwiki-enterprise-installer-generic-9.4-standard.jar

在Select the installation path: [/usr/local/XWiki Enterprise 9.4]输入你想安装的目录/usr/local/xwiki并回车。遇到Press 1 to continue, 2 to quit, 3 to redisplay都选1,回车,遇到Enter Y for Yes, N for No:输入Y并回车。需要你选择目录时,若不想指定目录,直接回车就可以,如Select the installation script (path must be absolute)[/usr/local/xwiki/auto-install.xml]。

[root@localhost local]# java -jar xwiki-enterprise-installer-generic-9.4-standard.jar
2018-12-13 11:48:29 信息: Logging initialized at level 'INFO'
2018-12-13 11:48:29 信息: Commandline arguments:
2018-12-13 11:48:30 信息: Detected platform: linux,version=3.10.0-514.el7.x86_64,arch=x64,symbolicName=null,javaVersion=1.8.0_191
Welcome to the installation of XWiki Enterprise 9.4!
The homepage is at: http://xwiki.org/

Press 1 to continue, 2 to quit, 3 to redisplay
1
Please read the following information:

 XWiki Enterprise - Readme


 XWiki Enterprise Overview
XWiki Enterprise is a second generation Wiki engine, features professional features like
 Wiki, Blog, Comments, User Rights, LDAP Authentication, PDF Export, and a lot more.
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.
 Pointers
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 notice any issue please file a an issue in our issue tracker
If you wish to talk to XWiki users or developers please use our
 Mailing lists & Forum
You can also access XWiki's
 source code
If you need commercial support please visit the
 Support page



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 9.4]
/usr/local/xwiki

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
2018-12-13 11:53:30 警告: Shortcut 'Go to my wiki' has URL but type ('Application') is not 'Link'
2018-12-13 11:53:30 警告: Shortcut 'Go to my wiki' has URL but type ('Application') is not 'Link'
2018-12-13 11:53:30 警告: Shortcut 'Documentation' has URL but type ('Application') is not 'Link'
2018-12-13 11:53:30 警告: 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/auto-install.xml]

Installation was successful
application installed on /usr/local/xwiki
[ Writing the uninstaller data ... ]
[ Console installation done ]

4.切换到xwiki目录cd /usr/local/xwiki。运行XWiKi:bash start_xwiki.sh或./start_xwiki.sh。

这种启动方法使用是默认的端口号8080,请用查看8080端口号是否被其它应用占用,我们的服务器的8080端口号就是被占用了,所以启动不起来。这个默认端口8080太火热了,还是换个端口用吧!如何换xwiki默认端口见《修改xwiki启动的默认端口》。

[root@localhost xwiki]# netstat  -anp  |grep 8080
tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      64199/unicorn worke
tcp        0      0 127.0.0.1:8080          127.0.0.1:42140         TIME_WAIT   -
tcp        0      0 127.0.0.1:8080          127.0.0.1:42136         TIME_WAIT   -
tcp        0      0 127.0.0.1:8080          127.0.0.1:42138         TIME_WAIT   -
tcp        0      0 127.0.0.1:8080          127.0.0.1:42134         TIME_WAIT   -

制定端口启动xwiki:bash start_xwiki.sh -p 8180


5.当启动到这一句日志2018-12-13 14:47:32.461:INFO:oxtjl.NotifyListener:main: Server started, you can now open http://localhost:8180/ in your browser to access your wiki.时,可以在浏览器打开你的xwiki主页地址:http://192.168.1.156:8180/xwiki,其中192.168.1.156是你服务器主机的ip。若你不打开主页地址它就会停在哪里了2018-12-13 14:47:32.461:INFO:oxtjl.NotifyListener:main: ----------------------------------。

如打不开请另起一个客户端查看你的防火墙是否开通了8180端口的访问权限irewall-cmd --zone=public --list-ports。

若没有开通该端口的访问权限请使用firewall-cmd --zone=public --add-port=8180/tcp --permanent开通它该端口。然后重启防火墙firewall-cmd --reload。然后再查看防火墙开放的端口。

[root@localhost ~]# firewall-cmd --zone=public --list-ports
8180/tcp 8888/tcp

若你加错端口或感觉开放的端口需要收回权限可以删除防火墙开放的端口firewall-cmd --zone=public --remove-port=8088/tcp --permanent,然后重启防火墙firewall-cmd --reload

启动过程中

XWiKi主页,有向导提示框可以直接擦掉向导提示框。

[root@localhost xwiki]# bash start_xwiki.sh -p 8180
An XWiki lock file exists at /var/tmp/xwiki-8180.lck but no XWiki is executing. Removing lock file...
Starting Jetty on port 8180, please wait...
2018-12-13 14:45:41.534:INFO::main: Logging initialized @624ms
2018-12-13 14:45:41.953:INFO:oejs.Server:main: jetty-9.2.13.v20150730
2018-12-13 14:45:41.983:INFO:oejs.AbstractNCSARequestLog:main: Opened /usr/local/xwiki/data/logs/2018_12_13.request.log
2018-12-13 14:45:41.986:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/usr/local/xwiki/jetty/contexts/] at interval 0
2018-12-13 14:45:42.352:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@47f6473{/,file:/usr/local/xwiki/webapps/root/,AVAILABLE}{/root}
2018-12-13 14:45:43.436:WARN:oeja.AnnotationConfiguration:main: ServletContainerInitializers: detected. Class hierarchy: empty
2018-12-13 14:47:23,470 [main] INFO  o.x.s.s.i.EmbeddedSolrInstance - Starting embedded Solr server...
2018-12-13 14:47:23,508 [main] INFO  o.x.s.s.i.EmbeddedSolrInstance - Using Solr home directory: [data/solr]
2018-12-13 14:47:26,403 [coreLoadExecutor-6-thread-1] WARN  o.a.s.c.SolrResourceLoader     - Solr loaded a deprecated plugin/analysis class [solr.SynonymFilterFactory]. Please consult documentation how to replace it accordingly.
2018-12-13 14:47:30,364 [main] INFO  o.x.s.s.i.EmbeddedSolrInstance - Started embedded Solr server.
2018-12-13 14:47:32.423:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@5383967b{/xwiki,file:/usr/local/xwiki/webapps/xwiki/,AVAILABLE}{/xwiki}
2018-12-13 14:47:32.459:INFO:oejs.ServerConnector:main: Started ServerConnector@32f45e15{HTTP/1.1}{0.0.0.0:8180}
2018-12-13 14:47:32.459:INFO:oejs.Server:main: Started @111550ms
2018-12-13 14:47:32.459:INFO:oxtjl.NotifyListener:main: ----------------------------------
2018-12-13 14:47:32.461:INFO:oxtjl.NotifyListener:main: Server started, you can now open http://localhost:8180/ in your browser to access your wiki.
2018-12-13 14:47:32.461:INFO:oxtjl.NotifyListener:main: ----------------------------------
2018-12-13 14:59:19,738 [XWiki initialization] INFO  .HibernateDataMigrationManager - Storage schema updates and data migrations are enabled
2018-12-13 14:59:20,065 [XWiki initialization] INFO  .HibernateDataMigrationManager - No data migration to apply for wiki [xwiki] currently in version [93000]
2018-12-13 14:59:20,065 [XWiki initialization] INFO  .HibernateDataMigrationManager - Checking Hibernate mapping and updating schema if needed for wiki [xwiki]
2018-12-13 14:59:28,597 [solr/indexer job group daemon thread - org.xwiki.search.solr.internal.job.IndexerJob@41e8dcdf] INFO  o.x.s.s.i.j.IndexerJob         - Starting job of type [solr.indexer] with identifier [[solr, indexer]]
2018-12-13 14:59:32,639 [solr/indexer job group daemon thread - org.xwiki.search.solr.internal.job.IndexerJob@41e8dcdf] INFO  o.x.s.s.i.j.IndexerJob         - 904 documents added, 0 deleted and 0 updated during the synchronization of the Solr index.
2018-12-13 14:59:32,639 [solr/indexer job group daemon thread - org.xwiki.search.solr.internal.job.IndexerJob@41e8dcdf] INFO  o.x.s.s.i.j.IndexerJob         - Finished job of type [solr.indexer] with identifier [[solr, indexer]]

客户端看到- Finished job of type [solr.indexer] with identifier [[solr, indexer]]说明XWiKi启动完毕。注意千万别关闭客户端。若关闭客户端或客户端断连那么XWiKi服务器就关了。若想不关闭客户端就关闭XWiKi服务器,只需要按control键和c键就可以关闭XWiKi服务器。

^C2018-12-13 15:20:51.803:INFO:oxtjl.NotifyListener:Thread-1: ----------------------------------
2018-12-13 15:20:51.803:INFO:oxtjl.NotifyListener:Thread-1: Server stopping, please wait while all resources are closed...
2018-12-13 15:20:51.844:INFO:oejs.ServerConnector:Thread-1: Stopped ServerConnector@32f45e15{HTTP/1.1}{0.0.0.0:8180}
2018-12-13 15:21:22.389:INFO:oejsh.ContextHandler:Thread-1: Stopped o.e.j.w.WebAppContext@5383967b{/xwiki,file:/usr/local/xwiki/webapps/xwiki/,UNAVAILABLE}{/xwiki}
2018-12-13 15:21:22.414:INFO:oejsh.ContextHandler:Thread-1: Stopped o.e.j.w.WebAppContext@47f6473{/,file:/usr/local/xwiki/webapps/root/,UNAVAILABLE}{/root}
2018-12-13 15:21:22.417:INFO:oxtjl.NotifyListener:Thread-1: Done!

6.XWiKi的管理员账户的登录。XWiKi的默认管理员账号和密码是Admin/admin。XWiKi还有超级管理员账号和密码,默认是不启动的。

点击右上交的按钮

点击Log-in按钮

输入账号密码登录

管理员账号密码登录后看到侧边栏多了些内容。若你用超级管理员账号登录把管理员账号给宰了,我是建立了半天也没有能建立管理员账号,没办法只有重装了,管理员账号就恢复了,不过以前的数据也没有了。

想XWiKi服务器正常运行就是要在服务器上起一个客户端,运行XWiKi并且不能关闭客户端。阿里云服务器通常有连接超时限制,不知道怎么启这个始终存在的客户端,这是一个问题。若服务器是你公司的一台电脑那就很容易实现了。

XWiKi服务器的设置和使用见文章《xwiki使用指南》。


目录
相关文章
|
5月前
|
存储 Ubuntu Linux
VMware-安装CentOS系统教程及安装包
虚拟机相当于是一个独立于你电脑的环境,在这个环境上面,你可以安装Linux、Windows、Ubuntu等各个类型各个版本的系统,在这个系统里面你不用担心有病读等,不用担心文件误删导致系统崩溃。 虚拟机也和正常的电脑系统是一样的,也可以开关机,不用的时候,你关机就可以了,也不会占用你的系统资源,使用起来还是比较方便 这里也有已经做好的CentOS 7系统,下载下来解压后直接用VMware打开就可以使用
1050 69
|
4月前
|
存储 分布式计算 Linux
安装篇--CentOS 7 虚拟机安装
VMware 装 CentOS 7 不知道从哪下手?这篇超详细图文教程手把手教你在 VMware Workstation 中完成 CentOS 7 桌面系统的完整安装流程。从 ISO 镜像下载、虚拟机配置,到安装图形界面、设置用户密码,每一步都有截图讲解,适合零基础新手快速上手。装好之后无论你是要搭 Hadoop 集群,还是练 Linux ,这个环境都够你折腾一整天!
1635 2
|
5月前
|
Ubuntu Linux 索引
Centos 7、Debian及Ubuntu系统中安装和验证tree命令的指南。
通过上述步骤,我们可以在CentOS 7、Debian和Ubuntu系统中安装并验证 `tree`命令。在命令行界面中执行安装命令,然后通过版本检查确认安装成功。这保证了在多个平台上 `tree`命令的一致性和可用性,使得用户无论在哪种Linux发行版上都能使用此工具浏览目录结构。
458 78
|
6月前
|
Linux 网络安全 Apache
针对在Centos/Linux安装Apache过程中出现的常见问题集锦
以上每个问题的解决方案应深入分析错误日志、系统消息和各种配置文件,以找到根本原因并加以解决。务必保持系统和Apache软件包更新到最新版本,以修复已知的bugs和安全漏洞。安装和管理Web服务器是一项需要细致关注和不断学习的任务。随着技术的发展,推荐定期查看官方文档和社区论坛,以保持知识的更新。
271 80
|
4月前
|
安全 关系型数据库 MySQL
CentOS 7 yum 安装 MySQL教程
在CentOS 7上安装MySQL 8,其实流程很清晰。首先通过官方Yum仓库来安装服务,然后启动并设为开机自启。最重要的环节是首次安全设置:需要先从日志里找到临时密码来登录,再修改成你自己的密码,并为远程连接创建用户和授权。最后,也别忘了在服务器防火墙上放行3306端口,这样远程才能连上。
738 16
|
5月前
|
存储 关系型数据库 MySQL
在CentOS 8.x上安装Percona Xtrabackup工具备份MySQL数据步骤。
以上就是在CentOS8.x上通过Perconaxtabbackup工具对Mysql进行高效率、高可靠性、无锁定影响地实现在线快速全量及增加式数据库资料保存与恢复流程。通过以上流程可以有效地将Mysql相关资料按需求完成定期或不定期地保存与灾难恢复需求。
441 10
|
6月前
|
人工智能 数据挖掘 Linux
Centos安装Python3.7(亲测可用)
本指南详细介绍了在基于Linux(以CentOS系统为例,使用yum包管理器)的系统上安装Python 3.7版本的完整流程。Python是一种广泛使用的高级编程语言,在各种领域如软件开发、数据分析、人工智能和区块链开发等都有着重要的应用。
589 2
|
7月前
|
机器人 Linux
CentOS 7系统中安装特定版本CMake 3.21.2的方法。
到这里,过程已经全部完成。如果你跟随上面的步骤来,那么你现在已经拥有了一个全新的CMake版本在你的CentOS 7系统上了。这个过程就像是你通过一系列仪式,唤醒了一个沉睡已久的古老机器人,它现在完全按照你的意愿来帮你构建和编译软件了。
566 18
|
5月前
|
运维 网络协议 Linux
CentOS下Bind服务的安装与故障排查
通过以上的步骤,您应该能够在CentOS系统上安装并配置BIND DNS服务,并进行基本的故障排查。
471 0
|
5月前
|
存储 Ubuntu Linux
安卓手机免root安装各种Linux系统:Ubuntu, Centos,Kali等
此外还可以安装Slackware、Archstrike等系统,还可以通过github查找方法安装更多有趣的东西。 昨日小编就是通过Termux安装的Kali Linux工具包。