“MediaWiki”的版本间的差异
跳到导航
跳到搜索
(→配置) |
|||
第26行: | 第26行: | ||
== 配置 == | == 配置 == | ||
− | Nginx 配置 | + | === Nginx 配置 === |
+ | |||
<syntaxhighlight lang=nginx> | <syntaxhighlight lang=nginx> | ||
server { | server { | ||
第57行: | 第58行: | ||
* [https://www.nginx.com/resources/wiki/start/topics/recipes/mediawiki/ Nginx MediaWiki 配置] | * [https://www.nginx.com/resources/wiki/start/topics/recipes/mediawiki/ Nginx MediaWiki 配置] | ||
* [https://www.nginx.com/resources/wiki/start/topics/examples/phpfcgi/ Nginx PHP FastCGI Example] | * [https://www.nginx.com/resources/wiki/start/topics/examples/phpfcgi/ Nginx PHP FastCGI Example] | ||
+ | |||
+ | === MediaWiki 配置 === | ||
+ | |||
+ | <syntaxhighlight lang=php> | ||
+ | $wgArticlePath = "/wiki/$1"; | ||
+ | $wgFavicon = "/images/favicon.ico"; | ||
+ | |||
+ | # 权限 | ||
+ | $wgGroupPermissions['*']['createaccount'] = false; | ||
+ | $wgGroupPermissions['*']['edit'] = false; | ||
+ | $wgGroupPermissions['sysop']['interwiki'] = true; | ||
+ | |||
+ | # 移动版皮肤 | ||
+ | wfLoadSkin('MinervaNeue'); | ||
+ | $wgMFDefaultSkinClass = 'SkinMinerva'; | ||
+ | </syntaxhighlight> | ||
== 扩展 == | == 扩展 == |
2021年4月14日 (三) 22:17的版本
入门
安装
在 Ubuntu Server 中安装,使用 Nginx 服务器和 SQLite 数据库
sudo apt install php php-fpm php-sqlite3 php-intl php-xml php-mbstring cd /srv/mediawiki curl -O https://releases.wikimedia.org/mediawiki/1.31/mediawiki-1.31.14.tar.gz tar xzf mediawiki-1.31.14.tar.gz
然后打开网站,跟随向导。
参考
配置
Nginx 配置
server {
server_name wiki.ruo-chen.wang;
root /srv/mediawiki/mediawiki;
index index.php;
client_max_body_size 5m;
client_body_timeout 60;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/wiki/(.*)$ /index.php?title=$1&$args;
}
location ~ [^/]\.php(/|$) {
fastcgi_param HTTP_PROXY "";
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
参考
MediaWiki 配置
$wgArticlePath = "/wiki/$1";
$wgFavicon = "/images/favicon.ico";
# 权限
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['sysop']['interwiki'] = true;
# 移动版皮肤
wfLoadSkin('MinervaNeue');
$wgMFDefaultSkinClass = 'SkinMinerva';
扩展
SyntaxHighlight_GeSHi
语法高亮。在 MediaWiki 1.31 中已自带。启用后可使用 <syntaxhighlight>
标签。
wfLoadExtension('SyntaxHighlight_GeSHi');
MobileFrontend
移动版本。[1]
wfLoadSkin('MinervaNeue');
$wgMFDefaultSkinClass = 'SkinMinerva';
wfLoadExtension('MobileFrontend');
升级
更新文件后访问 /mw-config/index.php
,跟随向导。