如何在 Debian 12 上安装 XWiki。

Linux命令 Edge插件网 1年前 (2023-08-23) 392次浏览 已收录 0个评论

XWiki是一个功能强大且多功能的开源协作平台,允许团队有效地创建,组织和共享知识。

如何在 Debian 12 上安装 XWiki。

在 Debian 12 书虫上安装 XWiki。

第 1 步。在我们安装任何软件之前,通过在终端中运行以下命令来确保您的系统是最新的非常重要:apt

<span class="pln">sudo apt update
sudo apt upgrade</span>

第 2 步。安装 OpenJDK。

现在我们使用以下命令安装默认的 OpenJDK 包:

<span class="pln">sudo apt install </span><span class="kwd">default</span><span class="pun">-</span><span class="pln">jdk</span>

通过运行以下命令确认 Java 已正确安装:

<span class="pln">java </span><span class="pun">-</span><span class="pln">version</span>

有关安装 Java 的其他资源,请阅读下面的帖子:

  • 如何在 Debian Linux √ 上安装 Java

第 3 步。在 Debian 12安装 XWiki。

默认情况下,XWiki 在 Debian 12 基础仓库中不可用。所以,现在我们需要添加存储库和 GPG 密钥,因为它们没有添加到 Debian 12 的默认存储库中:

<span class="pln">wget https</span><span class="pun">:</span><span class="com">//maven.xwiki.org/xwiki-keyring.gpg -O /usr/share/keyrings/xwiki-keyring.gpg</span><span class="pln">
wget </span><span class="str">"https://maven.xwiki.org/stable/xwiki-stable.list"</span> <span class="pun">-</span><span class="pln">O </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">apt</span><span class="pun">/</span><span class="pln">sources</span><span class="pun">.</span><span class="pln">list</span><span class="pun">.</span><span class="pln">d</span><span class="pun">/</span><span class="pln">xwiki</span><span class="pun">-</span><span class="pln">stable</span><span class="pun">.</span><span class="pln">list</span>

更新存储库后,您可以使用以下命令安装最新版本的 XWiki:

<span class="pln">sudo apt install xwiki</span><span class="pun">-</span><span class="pln">tomcat9</span><span class="pun">-</span><span class="pln">mariadb</span>

在安装过程中,在第一个窗口中,点击。它用于MySQL确认。

如何在 Debian 12 上安装 XWiki。

选择 Yes 并按回车键。您需要为 XWiki 数据库设置密码,如下所示:

如何在 Debian 12 上安装 XWiki。

第 4 步。为 XWiki 配置 Nginx。

现在我们运行以下命令将 Nginx 安装到您的 Debian 系统中:

<span class="pln">sudo apt install nginx</span>

安装完成后,启动 Nginx 并将其添加为使用以下方法在系统启动时自动启动:

<span class="pln">sudo systemctl start nginx
sudo systemctl enable nginx</span>

验证安装:

<span class="pln">nginx </span><span class="pun">-</span><span class="pln">v</span>

Now create an Nginx configuration file and set up the reverse proxy so you can access it via the domain name:

<span class="pln">nano </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">nginx</span><span class="pun">/</span><span class="pln">conf</span><span class="pun">.</span><span class="pln">d</span><span class="pun">/</span><span class="pln">xwiki</span><span class="pun">.</span><span class="pln">conf</span>

添加以下代码行:

<span class="pln">server </span><span class="pun">{</span><span class="pln">
    listen       </span><span class="lit">80</span><span class="pun">;</span><span class="pln">
    server_name  </span><b><span class="pln">your</span><span class="pun">-</span><span class="pln">domian</span><span class="pun">.</span><span class="pln">com</span></b><span class="pun">;</span><span class="pln">
    charset utf</span><span class="pun">-</span><span class="lit">8</span><span class="pun">;</span><span class="pln">
    client_max_body_size </span><span class="lit">64M</span><span class="pun">;</span><span class="pln">

    root </span><span class="pun">/</span><span class="kwd">var</span><span class="pun">/</span><span class="pln">www</span><span class="pun">/</span><span class="pln">html</span><span class="pun">;</span><span class="pln">

    location </span><span class="pun">/</span>
    <span class="pun">{</span><span class="pln">
        rewrite </span><span class="pun">^</span><span class="pln"> $scheme</span><span class="pun">:</span><span class="com">//$server_name/xwiki$request_uri? permanent;</span>
    <span class="pun">}</span><span class="pln">

    location </span><span class="pun">^~</span> <span class="pun">/</span><span class="pln">xwiki
    </span><span class="pun">{</span><span class="pln">
       proxy_pass              http</span><span class="pun">:</span><span class="com">//127.0.0.1:8080;</span><span class="pln">
       proxy_cache             off</span><span class="pun">;</span><span class="pln">
       proxy_set_header        X</span><span class="pun">-</span><span class="typ">Real</span><span class="pun">-</span><span class="pln">IP $remote_addr</span><span class="pun">;</span><span class="pln">
       proxy_set_header        X</span><span class="pun">-</span><span class="typ">Forwarded</span><span class="pun">-</span><span class="typ">For</span><span class="pln"> $proxy_add_x_forwarded_for</span><span class="pun">;</span><span class="pln">
       proxy_set_header        </span><span class="typ">Host</span><span class="pln"> $host</span><span class="pun">;</span><span class="pln">
       proxy_set_header        X</span><span class="pun">-</span><span class="typ">Forwarded</span><span class="pun">-</span><span class="typ">Proto</span><span class="pln"> $scheme</span><span class="pun">;</span><span class="pln">
       expires                 $expires</span><span class="pun">;</span>
    <span class="pun">}</span>
<span class="pun">}</span>

保存并关闭文件,然后使用以下命令激活 Nginx 虚拟主机:

<span class="pln">sudo systemctl restart nginx</span>

第5步。配置防火墙。

如果您有活动防火墙,请打开必要的端口以允许与XWiki的传入连接。例如,要启用 HTTP 和 HTTPS 访问,请使用以下命令:

<span class="pln">sudo ufw allow </span><span class="typ">OpenSSH</span><span class="pln">
sudo ufw allow </span><span class="str">'Nginx Full'</span><span class="pln">
sudo ufw enable</span>

第 6 步。访问XWiki网页界面。

成功安装后,打开您的网络浏览器并使用 URL 访问 XWiki 网页用户界面。您将被重定向到以下页面:http://xwiki.your-domain.com

如何在 Debian 12 上安装 XWiki。

 

感谢您使用本教程在 Debian 12 (Bookworm) 上安装最新版本的 XWiki。如需其他帮助或有用信息,我们建议您查看 XWiki 官方网站


Edge插件网 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:如何在 Debian 12 上安装 XWiki。
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址