-
下载mediawiki的安装包
wget https://releases.wikimedia.org/mediawiki/1.31/mediawiki-1.31.0.tar.gz
-
解压
tar -zxvf mediawiki-1.31.0.tar.gz
-
复制到/var/wiki/html目录
cp -r /mediawiki-1.31.0/. /var/wiki/html
-
配置nginx
server { listen 80; server_name wiki.yourdomain.com; root /var/wiki/html; index index.php index.html index.htm; location / { try_files $uri/ /index.php?$args; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/run/php/php7.0-fpm.sock; fastcgi_index index.php; include fastcgi.conf; } location ~* \.(js|css|png|jpg|jpeg|gif|ico|eot|otf|ttf|woff)$ { add_header Access-Control-Allow-Origin *; add_header Cache-Control "public, max-age=31536000, immutable"; access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } location ~ /\. { deny all; access_log off; log_not_found off; } }
/usr/loca/nginx/sbin/nginx -s reload
-
配置域名解析
- 访问 wiki.yourdomain.com
搞定