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版本。
CentOS上安装运行XWiKi_第1张图片
拷贝版本的链接,下载安装包。

[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
CentOS上安装运行XWiKi_第2张图片
启动过程中
CentOS上安装运行XWiKi_第3张图片
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还有超级管理员账号和密码,默认是不启动的。
CentOS上安装运行XWiKi_第4张图片
点击右上交的按钮
CentOS上安装运行XWiKi_第5张图片
点击Log-in按钮
CentOS上安装运行XWiKi_第6张图片
输入账号密码登录
CentOS上安装运行XWiKi_第7张图片
管理员账号密码登录后看到侧边栏多了些内容。若你用超级管理员账号登录把管理员账号给宰了,我是建立了半天也没有能建立管理员账号,没办法只有重装了,管理员账号就恢复了,不过以前的数据也没有了。
想XWiKi服务器正常运行就是要在服务器上起一个客户端,运行XWiKi并且不能关闭客户端。阿里云服务器通常有连接超时限制,不知道怎么启这个始终存在的客户端,这是一个问题。若服务器是你公司的一台电脑那就很容易实现了。
XWiKi服务器的设置和使用见文章《xwiki使用指南》。

你可能感兴趣的:(其它,xwiki,CentOS,firewall,start_xwiki.sh,端口冲突)