<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="https://v1sta.xyz/wp-content/plugins/pretty-rss-feeds/xslt/pretty-feed.xsl" type="text/xsl" media="screen" ?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/">

<channel>
	<title>Dokuwiki &#8211; 景の域</title>
	<atom:link href="https://v1sta.xyz/tag/dokuwiki/feed/" rel="self" type="application/rss+xml" />
	<link>https://v1sta.xyz</link>
	<description>远景的幻想空间</description>
	<lastBuildDate>Tue, 27 Jun 2023 08:31:23 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://v1sta.xyz/wp-content/uploads/2026/03/V1sta-Orb-Output512-2-60x60.png</url>
	<title>Dokuwiki &#8211; 景の域</title>
	<link>https://v1sta.xyz</link>
	<width>32</width>
	<height>32</height>
</image> 
<atom:link rel="hub" href="https://pubsubhubbub.appspot.com"/>
<atom:link rel="hub" href="https://pubsubhubbub.superfeedr.com"/>
<atom:link rel="hub" href="https://websubhub.com/hub"/>
<atom:link rel="self" href="https://v1sta.xyz/tag/dokuwiki/feed/"/>
	<item>
		<title>Dokuwiki 安装记录</title>
		<link>https://v1sta.xyz/tech/dokuwiki-installation/</link>
					<comments>https://v1sta.xyz/tech/dokuwiki-installation/#respond</comments>
		
		<dc:creator><![CDATA[远景の域主 V1STA]]></dc:creator>
		<pubDate>Tue, 27 Jun 2023 08:31:22 +0000</pubDate>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[Dokuwiki]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Webinoly]]></category>
		<guid isPermaLink="false">https://v1sta.xyz/?p=1494</guid>

					<description><![CDATA[准备重新启动我的Minecraft服务器了。想着打算开一个服务器的Wiki，记录服务器配置与规则、模组之类的信 &#8230; <a href="https://v1sta.xyz/tech/dokuwiki-installation/" class="more-link">继续阅读<span class="screen-reader-text">Dokuwiki 安装记录</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p>准备重新启动我的Minecraft服务器了。想着打算开一个服务器的Wiki，记录服务器配置与规则、模组之类的信息，供玩家们查阅。</p>



<p>我不太想在VPS上再运行一些带数据库的Web服务，除非用SQLite，所以选择了Dokuwiki，虽然最后发现并不太合适（可能还不如用Typecho+SQLite，奈何Typecho没有我比较喜好的主题）</p>



<span id="more-1494"></span>



<h2 class="wp-block-heading">安装</h2>



<p>这次还是使用我喜爱的Webinoly运维脚本配置，和上次<a href="https://v1sta.xyz/tech/blessing-skin/" data-type="post" data-id="1174">搭建Blessing Skin</a>的过程类似，一行site命令，使用标准的php模板并配置SSL证书，一气呵成：</p>



<pre class="wp-block-preformatted">site [domain.ltd] -php -ssl=on</pre>



<p>打开 Dokuwiki 的<a href="https://download.dokuwiki.org/">官网下载</a>页面，可以选择自定义最小化的编译版本，仅保留需要的插件和语言：</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://v1sta.xyz/wp-content/uploads/2023/06/chrome_spCPC60oyz.png" data-lbwps-width="1920" data-lbwps-height="1079" data-lbwps-srcsmall="https://v1sta.xyz/wp-content/uploads/2023/06/chrome_spCPC60oyz-300x169.png"><img data-dominant-color="f3f2f2" data-has-transparency="true" style="--dominant-color: #f3f2f2;" fetchpriority="high" decoding="async" width="1024" height="575" sizes="(max-width: 1024px) 100vw, 1024px" src="https://v1sta.xyz/wp-content/uploads/2023/06/chrome_spCPC60oyz-1024x575.png" alt="" class="wp-image-1495 has-transparency" srcset="https://v1sta.xyz/wp-content/uploads/2023/06/chrome_spCPC60oyz-1024x575.png 1024w, https://v1sta.xyz/wp-content/uploads/2023/06/chrome_spCPC60oyz-300x169.png 300w, https://v1sta.xyz/wp-content/uploads/2023/06/chrome_spCPC60oyz-768x432.png 768w, https://v1sta.xyz/wp-content/uploads/2023/06/chrome_spCPC60oyz-1536x863.png 1536w, https://v1sta.xyz/wp-content/uploads/2023/06/chrome_spCPC60oyz.png 1920w" /></a></figure>
</div>


<p>然后点击下载，会自动转到下载页面，下载编译的压缩包，并提示如果没有自动下载则点击链接，复制这个链接即为wget下载链接。注意有下载时限，过一段时间后会过期，因此我也无法提供下载链接。</p>



<p>使用 <code>tar -xvzf</code> 解压后获得名为 <code>dokuwiki</code> 的目录，将其替换默认的 htdocs目录（也可以在nginx配置文件改成 dokuwiki ），并递归设置目录所有者为www-data以取得权限。</p>



<pre class="wp-block-preformatted">tar -xvzf dokuwiki-*.tgz
chown -R www-data:www-data ./htdocs
nginx -s reload</pre>



<p>此时已经可以在浏览器中访问了，在域名后面输入 <code>install.php</code> 就能够访问安装器页面，出于安全原因，这个安装器只能在全新的Dokuwiki使用一次，配置以后还需要移走 install.php 以阻止访问。</p>



<h2 class="wp-block-heading">URL重写</h2>



<p>参考Dokuwiki上的<a href="https://www.dokuwiki.org/rewrite">Rewrite页</a>。可以通过URL重写移除链接中的doku.php字样，需要在配置页 > 高级设置中设定userewrite项为 .htaccess(2)，以及打开canonical 完全标准的URL。</p>



<p>虽然userewrite表述为.htaccess，但并不是Apache HTTP Server特有的重写配置，同样也支持IIS、Nginx等多个其他的Web服务器。在此附上启用Nginx重写功能的片段，顺便设置敏感目录的阻止访问。</p>



<pre class="wp-block-preformatted">location / { try_files $uri $uri/ @dokuwiki; }
 
location @dokuwiki {
        rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
        rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
        rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&amp;id=$2 last;
        rewrite ^/(.*) /doku.php?id=$1&amp;$args last;
    }
 
    location ~ \.php$ {
        if (!-f $request_filename) { return 404; }
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param REDIRECT_STATUS 200;
        fastcgi_pass 127.0.0.1:9000;
    }
    
location ~ /(data|conf|bin|inc|vendor)/ {
    deny all;
}</pre>



<p>需注意的是，第一行的 location 配置与 Webinoly自带的 common/phpx.conf 相冲突，需要在站点Nginx主配置注释include后者以识别 @dokuwiki 。</p>



<p>这时URL重写便已经配置好了，如同WP的伪静态一样简单。</p>



<h2 class="wp-block-heading">主题</h2>



<p>Dokuwiki可以安装很多模板主题 (Template) ，它们以Wikipedia的风格居多，也有少数现代扁平化的设计。我比较喜欢 <a href="https://www.dokuwiki.org/template:sprintdoc">SprintDoc</a> 模板，是德国人开发的，基于Material设计语言，简单而优雅，而且有著浓厚的德国工业文件的风格。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="ececed" data-has-transparency="false" style="--dominant-color: #ececed;" decoding="async" width="600" height="316" sizes="(max-width: 600px) 100vw, 600px" src="https://v1sta.xyz/wp-content/uploads/2023/06/image-3.png" alt="" class="wp-image-1496 not-transparent" srcset="https://v1sta.xyz/wp-content/uploads/2023/06/image-3.png 600w, https://v1sta.xyz/wp-content/uploads/2023/06/image-3-300x158.png 300w" /></figure>
</div>


<p>在扩展管理器中搜索 SprintDoc 就可以直接下载，然后去配置页启用template，当然也可以自己下载上传压缩包安装。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">结尾</h2>



<p>最后，我还是放弃了使用Dokuwiki，研究了一会发现，Dokuwiki的结构并不是很适合我。</p>



<p>尽管Dokuwiki是一种纯文件架构（Flat-file CMS）的程序，比较类似的是Grav CMS，但是并不代表从服务器下载文件就能直接所见即所得，除非直接离线存储整个网页。</p>



<p>Dokuwiki特有的synatx格式与富文本编辑器也不太好用，虽说有插件支持Markdown，但不是文件格式存储，依然没什么优势。</p>



<p>其次，Dokuwiki对于英语/拉丁语以外的语言体系的支持并不算好，虽然并不是完全不支持亚洲语系，但是URL只能设定为英文。分类的功能也不太好用，不像Mediawiki的几个站点。</p>



<p>最初的初衷只是为了想要记录一些服务端、客户端区分的MC模组，然而本来就有先人在mcmod百科上记载了，而且也被很多支持BMCLAPI的启动器所引用，我为何不直接写文笔记附上mcmod.cn的链接呢？</p>



<p>可能还是担忧突然一夜之间内容消失的重创。</p>



<p>虽然对一个小服务器没什么影响……我还是用OneNote吧。其实，支持metaweblog发布到WP功能的旧版Word更适合记录啊。</p>

<p><a href="https://v1sta.xyz/tech/dokuwiki-installation/" rel="nofollow">来源</a></p>]]></content:encoded>
					
					<wfw:commentRss>https://v1sta.xyz/tech/dokuwiki-installation/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<enclosure url="https://v1sta.xyz/wp-content/uploads/2023/06/chrome_spCPC60oyz-1024x575.png" length="166770" type="image/png"/><media:content url="https://v1sta.xyz/wp-content/uploads/2023/06/chrome_spCPC60oyz-1024x575.png" width="1024" height="575" medium="image" type="image/png"/>	</item>
	</channel>
</rss>
