windows搭建wiki_如何在Windows PC上设置自己的强大Wiki

windows搭建wiki_如何在Windows PC上设置自己的强大Wiki

windows搭建wiki

windows搭建wiki_如何在Windows PC上设置自己的强大Wiki

A wiki is a collaborative web-based writing environment where anybody with an account can create and link articles. In today’s article, we’ll explain how to install and configure MediaWiki without having to read a book.

Wiki是基于Web的协作式写作环境,任何拥有帐户的人都可以创建和链接文章。 在今天的文章中,我们将解释如何无需阅读书籍即可安装和配置MediaWiki。

We’ll start with a quick five minute installation guide, and we’ll cover some administration tips, for example: creating users, assigning them to groups, and how to brighten up your content pages using custom skins.

我们将从五分钟的快速安装指南开始,并介绍一些管理技巧,例如:创建用户,将用户分配给组以及如何使用自定义外观使内容页面变亮。

Original Image by Szeke

Szeke的原始图片

媒体Wiki安装 (Media Wiki Installation)

To use Media Wiki, you need to have an apache web server, MySQL database, and PHP 5. You have the option to set them up one by one, however, EasyPHP will take care all the installation with just a few clicks of your mouse.

要使用Media Wiki,您需要拥有一个Apache Web服务器,MySQL数据库和PHP5。您可以选择一个一个地设置它们,但是EasyPHP只需单击几下鼠标即可完成所有安装。 。

Head over to their website, download the installer, follow the installation wizard, and you’ll have an environment for running MediaWiki.

转到他们的网站 ,下载安装程序,按照安装向导进行操作,您将拥有一个运行MediaWiki的环境。

windows搭建wiki_如何在Windows PC上设置自己的强大Wiki

At the end of the installation process, you should see EasyPHP appears in your system tray. The system tray short cut gives you access to administrative part of your web server. The first thing that you might want to check is the “Administration” page. This page gives an overview of what running on the web server. If you see this page, this means that you have a working webserver, and you are ready to install MediaWiki.

在安装过程结束时,您应该看到EasyPHP出现在系统托盘中。 系统托盘快捷方式使您可以访问Web服务器的管理部分。 您可能要检查的第一件事是“管理”页面。 该页面概述了Web服务器上正在运行的内容。 如果看到此页面,则意味着您有一个正在运行的Web服务器,并且可以安装MediaWiki。

windows搭建wiki_如何在Windows PC上设置自己的强大Wiki

EasyPHP creates a “www” directory, and it will pick up Media Wiki if you extract its distribution under this folder. If you are a Windows users, you might not be familiar with MediaWiki’s distribution file format, which is a tar file.Don’t worry, simply install 7zip, and use it to extract MediaWiki under the “www” folder. Once you’ve done that EasyPHP will display this folder in the administration page.

EasyPHP创建一个“ www”目录,如果您在该文件夹下提取其分发,它将选择Media Wiki。 如果您是Windows用户,则可能不熟悉MediaWiki的分发文件格式(即tar文件)。不用担心,只需安装7zip并将其解压缩到“ www”文件夹下的MediaWiki。 完成后,EasyPHP将在管理页面中显示此文件夹。

windows搭建wiki_如何在Windows PC上设置自己的强大Wiki

Once you’ve done that, EasyPHP immediately deploy MediaWiki, and you’ll see MediaWiki’s homepage link under the Root icon. Click that link, and you’ll see MediaWiki’s installation page.

完成此操作后,EasyPHP立即部署MediaWiki,您将在Root图标下看到MediaWiki的主页链接。 单击该链接,您将看到MediaWiki的安装页面。

windows搭建wiki_如何在Windows PC上设置自己的强大Wiki

The installation wizard will walk you through the setup process. You should be fine if you just stick with the default settings that the wizard gives you.

安装向导将引导您完成设置过程。 如果仅使用向导为您提供的默认设置,则应该没问题。

windows搭建wiki_如何在Windows PC上设置自己的强大Wiki

Don’t forget to enable image uploads, if you’re planning to place pictures on your Wiki.

如果您打算在Wiki上放置图片,请不要忘记启用图像上传。

windows搭建wiki_如何在Windows PC上设置自己的强大Wiki

At the end of the installation process, the wizard will generate a file called LocalSettings.php. This file has heaps of settings, and MediaWiki maintains a manual that tells you what these settings mean. Put this file inside the MediaWiki folder that you extracted earlier.

在安装过程结束时,向导将生成一个名为LocalSettings.php的文件。 该文件具有大量的设置,MediaWiki维护着一本手册 ,告诉您这些设置的含义。 将此文件放入先前提取的MediaWiki文件夹中。

媒体Wiki快速浏览 (Quick Tour of Media Wiki)

MediaWiki comes with a very popular white crisp theme called MonoBook, and there are plenty of other themes for your Wiki. Before we show you how to do that, let’s get ourselves familiar with the standard theme.

MediaWiki带有一个非常流行的白色主题“ MonoBook”,而您的Wiki还有许多其他主题。 在向您展示如何做到这一点之前,让我们熟悉一下标准主题。

windows搭建wiki_如何在Windows PC上设置自己的强大Wiki

There are three important links on this page that you might want to know: “log in/create account” link, “edit” tab, and “Special pages” link. Out of the box, anyone can edit your Wiki, even people who do not have an account in your Wiki. If you want to secure your wiki, add this command into the LocalSettings.php file:

您可能想知道此页面上的三个重要链接:“登录/创建帐户”链接,“编辑”选项卡和“特殊页面”链接。 开箱即用,任何人都可以编辑您的Wiki,即使是没有您Wiki帐户的人。 如果要保护您的Wiki,请将此命令添加到LocalSettings.php文件中:

$wgGroupPermissions['*']['edit'] = false;

$wgGroupPermissions['*']['edit'] = false;

If you want to start editing pages, head over to the edit tab. You might need to learn wiki mark-ups to edit your content. It may be awkward at first, but with enough practice, you’ll find that these mark-ups save a lot of your time.

如果要开始编辑页面,请转到“编辑”选项卡。 您可能需要学习Wiki标记才能编辑内容。 一开始可能很尴尬,但是经过足够的练习,您会发现这些加价节省了您很多时间。

On the top right hand corner, you’ll find a link to create a new account. Click that link, create a user account, and assign that account to the appropriate user group. If you want to learn more about the user groups, click the Special pages link. The special page gives you access to all sort of administrative tool for your Wiki. You can check for broken pages, add or delete users, and much more, but for today tutorial, we’ll explore three sections: the “login/sign up”page, the preferences page, and the user rights management page.

在右上角,您会找到一个用于创建新帐户的链接。 单击该链接,创建一个用户帐户,然后将该帐户分配给适当的用户组。 如果要了解有关用户组的更多信息,请单击“特殊页面”链接。 特殊页面使您可以访问Wiki的各种管理工具。 您可以检查页面是否损坏,添加或删除用户等等,但是对于今天的教程,我们将探索三个部分:“登录/注册”页面,首选项页面和用户权限管理页面。

windows搭建wiki_如何在Windows PC上设置自己的强大Wiki

MediaWiki用户维护 (MediaWiki Users Maintenance)

The “Login in/ create account” page lets you create user, and assign them to any user group you have. If you have lots of user, adding them one by one might not be the most efficient way. No problem. User Import Extension let you create multiple users using a CSV file. Download that extension under the extensions folder, and place this command in your LocalSettings.php.

“登录/创建帐户”页面使您可以创建用户,并将其分配给您拥有的任何用户组。 如果您有很多用户,则将它们一个接一个地添加可能不是最有效的方法。 没问题。 用户导入扩展允许您使用CSV文件创建多个用户。 在扩展程序文件夹下下载该扩展程序,并将此命令放在LocalSettings.php中。

require_once("$IP/extensions/ImportUsers/ImportUsers.php")

require_once("$IP/extensions/ImportUsers/ImportUsers.php")

All you have to do is prepare a CSV file with all your users in it, and upload the file from the version page.

您所要做的就是准备一个包含所有用户的CSV文件,然后从版本页面上载该文件。

User ID Password Email User Name
thegeek [email protected] [email protected] The Geek
用户身份 密码 电子邮件 用户名
极客 s4f3p @ assword [email protected] 极客
windows搭建wiki_如何在Windows PC上设置自己的强大Wiki

Once you added your users, you can control what each user can do; this is why MediaWiki has a bunch of user groups for us. Head over to the user rights management page, and assign your users to the appropriate user group.

添加用户后,您可以控制每个用户可以执行的操作; 这就是MediaWiki为我们提供大量用户组的原因。 转到用户权限管理页面,然后将用户分配给适当的用户组。

windows搭建wiki_如何在Windows PC上设置自己的强大Wiki

If you want give your users custom priviliges, you can declare those users in LocalSettings.php. For example, this command will create a new user group called trusted that has the same permissions as a “user” group, but with no permission to send email.

如果要为用户提供自定义权限,则可以在LocalSettings.php中声明这些用户。 例如,此命令将创建一个名为Trusted的新用户组,该用户组具有与“用户”组相同的权限,但没有发送电子邮件的权限。

$wgGroupPermissions['Trusted'] = $wgGroupPermissions['user'];
$wgGroupPermissions['Trusted'] ['sendemail'] = false;

$wgGroupPermissions['Trusted'] = $wgGroupPermissions['user'];
$wgGroupPermissions['Trusted'] ['sendemail'] = false;

自定义您的Wiki (Customising Your Wiki)

We just covered the basic features of MediaWiki, now it’s time to show you how to brighten up your Wiki with custom skins, your own logo, and let users upload all sort of file types. Most of this customisation requires you to add a little bit of PHP code into php.ini, or LocalSettings.php file.

我们仅介绍了MediaWiki的基本功能,现在该向您展示如何使用自定义外观,您自己的徽标来增强Wiki的外观,并让用户上传各种文件类型。 大多数自定义要求您将一点PHP代码添加到php.ini或LocalSettings.php文件中。

windows搭建wiki_如何在Windows PC上设置自己的强大Wiki

You can open the PHP.ini file from EasyPHP system tray shortcut. The upload_max_file_size determines the size of images that you can upload to your wiki, and PHP limits the files to 2 MB. If you need to upload bigger files, give this variable a bigger value, for example, 20 M (20 megabyte).

您可以从EasyPHP系统托盘快捷方式中打开PHP.ini文件。 upload_max_file_size确定可以上传到Wiki的图像的大小,PHP将文件限制为2 MB。 如果您需要上传更大的文件,请为该变量指定一个更大的值,例如20 M(20兆字节)。

windows搭建wiki_如何在Windows PC上设置自己的强大Wiki

Media Wiki supports all sort of file types, PDF, Microsoft office, Open Office, but you need to add this PHP code into you LocalSettings.php file:

Media Wiki支持各种文件类型,包括PDF,Microsoft Office,Open Office,但是您需要将此PHP代码添加到LocalSettings.php文件中:

$wgFileExtensions = array('png','gif','jpg','jpeg','doc','xls','mpp','pdf','ppt','tiff','bmp','docx', 'xlsx', 'pptx','ps','odt','ods','odp','odg');

$wgFileExtensions = array('png','gif','jpg','jpeg','doc','xls','mpp','pdf','ppt','tiff','bmp','docx', 'xlsx', 'pptx','ps','odt','ods','odp','odg');

Head over to the preference page, and you’ll find a gallery of skin for your Wiki. If you’re not happy with these selections, you can create, or better yet, install ready to use skins from MediaWiki’s gallery. Download anything you like, and put it under the skin folder:

转到首选项页面,您将为Wiki找到皮肤库。 如果您对这些选择不满意,可以从MediaWiki的Gallery中创建或更好地安装即可使用的外观。 下载所需的任何内容,并将其放在外观文件夹下:

C:\Program Files (x86)\EasyPHP-5.3.6.0\www\mediawiki-1.17.0\skins

C:\Program Files (x86)\EasyPHP-5.3.6.0\www\mediawiki-1.17.0\skins

Once you’ve done that you should see be able to check out your new skin from the preference page. If you happen to have a matching logo with your skins, put it under this folder: C:\Program Files (x86)\EasyPHP-5.3.6.0\www\mediawiki-1.17.0\skins\common\images,and type this command into the LocalSettings.php file:

完成后,您应该可以从首选项页面中检出新皮肤。 如果您的皮肤碰巧有一个匹配的徽标,请将其放在以下文件夹中:C:\ Program Files(x86)\ EasyPHP-5.3.6.0 \ www \ mediawiki-1.17.0 \ skins \ common \ images,然后键入命令放入LocalSettings.php文件:

$wgLogo="$wgScriptPath/skins/common/images/htg-logo.png";

$wgLogo="$wgScriptPath/skins/common/images/htg-logo.png";

Note: Replace htg-logo with your own logo.

注意:将htg-logo替换为您自己的徽标。

windows搭建wiki_如何在Windows PC上设置自己的强大Wiki


MediaWiki still has plenty of good stuff that we have not covered, but if you have read this far, we hope that you have learned how to host your own Wiki with MediaWiki. Try it out, and tell the other fellow readers what you think about it in the comments section.

MediaWiki仍然有很多我们没有介绍的好东西,但是,如果您已经阅读了到目前为止,我们希望您已经学会了如何使用MediaWiki托管自己的Wiki。 尝试一下,并在评论部分告诉其他读者您对此的看法。

Download Media Wiki

下载媒体维基

翻译自: https://www.howtogeek.com/67717/how-to-setup-your-own-powerful-wiki-on-your-windows-pc/

windows搭建wiki