如何在 CentOS 中安装 XWiki
wiki DokuWiki XWiki
由于大家的强烈要求，这里有另外一篇在 CentOS 7 服务器中用 XWiki 安装 wiki 的教程。我们已经发布了一篇[如何在 Ubuntu 中安装 DokuWiki](/article-8178-1.html) 的教程，但如果你需要一个 DokuWiki 的替代品，XWiki 是一个很好的选择。


![](/data/attachment/album/201702/16/010000frml7m42mmk0ybbh.jpg)


### XWiki 信息


首先最重要的是：它是自由而开源的！这是一些 XWiki 的功能：


* 一个非常强大的所见即所得编辑器
* 强大的 wiki 语法
* 强大的权限管理
* 响应式皮肤
* 高级搜索
* 独特的应用程序集
* 还有更多功能……


### 为何使用 XWiki？


它已经开发了 10 多年，XWiki 被许多知名公司使用作为：


* 知识库
* 内网协作
* 公开网站
* 商业应用
* 其他等……


### XWiki 要求


* Java 8 或更高版本
* 支持 Servlet 3.0.1 的 Servlet 容器
* 用于支持数据库的 JDBC 4 驱动程序
* 至少 2GB RAM（对于较小的 wiki 是 1GB）
* 你可以从[阿里云等云服务商购买一个 VPS](http://click.aliyun.com/m/9815/)，可以使用一键部署的 Java 环境


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


### CentOS 7 中 XWiki 安装指南


让我们开始吧。首先登录 CentOS VPS，更新你的系统：



```
yum update

```

如果你还没有安装 nano 和 wget，就先安装：



```
yum install nano wget

```

### 安装 Java


XWiki 基于并运行于 Java 环境，因此我们需要安装 Java。要安装它，运行下面的命令：



```
yum install java

```

要验证是否已经成功安装，运行：



```
java -version

```

### 下载并安装 XWiki


目前，XWiki 最新的版本是 8.4.4，如果还有更新的版本，你可以用更新命令更新。


要下载 XWiki 安装器，运行：



```
wget http://download.forge.ow2.org/xwiki/xwiki-enterprise-installer-generic-8.4.4-standard.jar

```

要运行安装器，输入下面的命令：



```
java -jar xwiki-enterprise-installer-generic-8.4.4-standard.jar

```

现在，安装器会有提示地询问你几个问题，分别输入 `1`（接受）、`2`（退出）、`3`（重新显示）。大多数提示可以回答 `1`（接受）。这个安装器是不言自明的，易于理解，因此只要遵循其每步建议就行。


### 启动 XWiki


要启动 XWiki，你需要进入你先前选择的目录：



```
cd /usr/local/"XWiki Enterprise 8.4.4"

```

并运行脚本：



```
bash start_xwiki.sh

```

等待脚本执行完毕就行了。XWiki 已经安装并已启动。就是这么简单。


现在你可以在 8080 端口上通过域名或者服务器 IP 访问 XWiki 了：



```
http://server-ip:8080

```

或者



```
http://example.com:8080

```

XWiki 默认运行在 8080 端口，但如果你想要使用 80 端口，确保没有其他程序运行在 80 端口，并用下面的命令启动 XWiki：



```
bash start_xwiki.sh -p 80

```

现在你可以不用指定端口访问 XWiki 了。当你访问时，你应该会看见默认的 XWiki 主页。


XWiki 默认的管理员用户及密码为：


* 用户名：Admin
* 密码：admin


使用它们登录并访问管理面板。祝你在新的 wiki 中使用愉快！




---


via: <https://thishosting.rocks/how-to-build-your-own-wiki-with-xwiki-on-centos/>


作者：[thishosting.rocks](https://thishosting.rocks) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
Due to popular demand, here’s another tutorial on how to install your own self-hosted wiki with XWiki on a CentOS 7 server. We’ve already published a tutorial on [how to install DokuWiki on Ubuntu](https://thishosting.rocks/build-your-own-wiki-on-ubuntu-with-dokuwiki/), but if you need an alternative to DokuWiki, XWiki is a great choice.






## XWiki Info

First and most important: it’s free and open source! Here are some of XWiki’s features:

- a very robust WYSIWYG editor
- a powerful wiki syntax
- strong rights management
- responsive skin
- advanced search
- unique set of applications
- … and many more.

### Why use XWiki?

Developed for more than 10 years, XWiki is being used by many high profile companies as:

- Knowledge base
- Collaborative intranet
- Public website
- Business applications
- … or other use cases.

### XWiki Requirements

- Java 8 or greater
- A Servlet Container supporting Servlet 3.0.1
- A JDBC 4 Driver for your database
- At least 2 GB RAM (or 1 GB for smaller wikis)
- You can get a 2 GB RAM VPS from
[Linode](https://thishosting.rocks/go/linode)for $10. But, it’s[unmanaged](https://thishosting.rocks/cheap-cloud-hosting-providers-comparison/). If you want a[Managed VPS](https://thishosting.rocks/best-cheap-managed-vps/), then check out these providers. If you get a Managed VPS, they will probably install XWiki for you.

We’ll be using a CentOS 7 server for this tutorial.

## XWiki Installation Instructions for CentOS 7

Let’s start. Login to your CentOS VPS and before we do anything, update your system with:

yum update

If you don’t have them already installed, install nano and wget:

yum install nano wget

### Install Java

XWiki is built and run on Java, so we’ll need to install java. To do so, run the following command:

yum install java

To verify that it’s successfully installed, run:

java -version

### Download and install XWiki

Currently, the latest version of XWiki is 8.4.4, but you can update the command if there’s a newer version of XWiki.

To download the XWiki installer, run:

wget http://download.forge.ow2.org/xwiki/xwiki-enterprise-installer-generic-8.4.4-standard.jar

To run the installer, enter the following command:

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

Now, the installer will ask you several questions with a prompt to enter 1 (accept) 2 (quit) 3 (redisplay). Most of the prompts can be answered with 1 (accept). The installer is pretty self-explanatory and easy to understand, so just follow the instructions.

### Start XWiki

To start XWiki, you need to navigate to the directory you chose in the previous step:

cd /usr/local/"XWiki Enterprise 8.4.4"

and run the start script:

bash start_xwiki.sh

Wait for the script to do its job and you are done. XWiki is installed and started. It’s that easy.

Now, you can visit XWiki via your domain or server IP on port 8080:

http://server-ip:8080

or

http://example.com:8080

By default, XWiki runs on port 8080, but if you’d like to use port 80, make sure there’s nothing already running on port 80 and start XWiki with the following command:

bash start_xwiki.sh -p 80

Now, you can access XWiki without specifying a port. When you access it, you should see the default XWiki homepage, similar to this:

The default XWiki administrator username and password are:

Username: Admin Password: admin

Use them to login and access the admin panel. Have fun editing and using your new wiki!

## 2 thoughts on “How to Build Your Own Wiki with XWiki on CentOS”

Hello. I’m trying this installation setup but cannot open xwiki. I’m on a production server with tomcat 9 already running, with CentOS Linux release 7.6.1810, Java 8, and for xwiki I will use a PostgreSQL remote db. I probably missed some steps ,where to find documentation? Thank you.

xwiki enterprise version has discontinue, can you make a new tutorial for Xwiki Pro 12.3 ?