先去mediawiki官網下載安裝包,最新版本是1.39.2
然後上傳到nas的web路徑下,解壓縮,例如/web/mediawiki
接著去mariadb建立明為mediawiki的空資料庫,順便新建一個專用的使用者給mediawiki庫用
輸入http://NAS/mediawiki/install.php,正確的話會出現安裝導引,下面步驟就不多解釋了
最後是如何美化網址,預設的wiki網址會是長這樣 http://NAS/index.php?title=xxx,想要呈現為http://NAS/xxx
首先,開啟LocalSettings.php,找到下面這段照著我的範例修改:
## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
## For more information on customizing the URLs
## (like /w/index.php/Page_title to /wiki/Page_title) please see:
## https://www.mediawiki.org/wiki/Manual:Short_URL
$wgScriptPath = "";
$wgArticlePath = "/$1";
$wgUsePathInfo = true;
然後在mediawiki根目錄下新增.htaccess檔,內容請參考我的範本
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/index.php [L]
美化後的網址會類似這種形式