「Install MediaWiki on Debian Bullseye」修訂間的差異
		
		
		
		
		
		跳至導覽
		跳至搜尋
		
				
		
		
	
| (未顯示同一使用者於中間所作的 1 次修訂) | |||
| 行 15: | 行 15: | ||
|  Alias /w /var/lib/mediawiki |  Alias /w /var/lib/mediawiki | ||
|  Alias /wiki /var/lib/mediawiki/index.php |  Alias /wiki /var/lib/mediawiki/index.php | ||
| − | |||
| − |  <Directory /var/lib/mediawiki/> | ||
| − |      Options +FollowSymLinks | ||
| − |      AllowOverride All | ||
| − |      Require all deny | ||
| − |      Require ip 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 100.64.0.0/10 103.147.130.0/23 103.149.64.0/23 103.152.252.0/23 210.58.104.0/23 210.200.251.6/29 203.69.103.0/24 2405:b8c0::/32 2405:e4c0::/32 240> | ||
| − |  </Directory> | ||
| ---- | ---- | ||
| * nano /etc/mediawiki/1/LocalSettings.php | * nano /etc/mediawiki/1/LocalSettings.php | ||
於 2022年2月10日 (四) 07:10 的最新修訂
- Install MediaWiki
apt update apt upgrade --yes apt install --yes mediawiki apt install --yes imagemagick apt install --yes git
- Database Use SQLite
apt install --yes php-sqlite3 cd /var/www mkdir data chgrp www-data data chmod g+w data
- nano /etc/apache2/conf-enabled/mediawiki.conf
Alias /w /var/lib/mediawiki Alias /wiki /var/lib/mediawiki/index.php
- nano /etc/mediawiki/1/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 = "/w"; $wgScriptExtension = ".php"; $wgArticlePath = "/wiki/$1"; $wgUsePathInfo = true;
## The protocol and server name to use in fully-qualified URLs $wgServer = "https://wiki.domain"; $wgCanonicalServer = "https://wiki.domain";
#Set Default Timezone $wgLocaltimezone = "Asia/Taipei"; date_default_timezone_set( $wgLocaltimezone );
## The URL paths to the logo.  Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
$wgLogos = [
        '1x' => "$wgResourceBasePath/resources/assets/plugin/process.1x.png",
        '1.5x' => "$wgResourceBasePath/resources/assets/plugin/process.1.5x.png",
        '2x' => "$wgResourceBasePath/resources/assets/plugin/process.2x.png",
        'icon' => "$wgResourceBasePath/resources/assets/plugin/process.icon.png",
];
$wgFavicon = "$wgResourceBasePath/resources/assets/plugin/process.ico";
$wgAppleTouchIcon = "$wgResourceBasePath/resources/assets/plugin/process.ico";
## To enable image uploads, make sure the 'images' directory ## is writable, then set this to true: $wgEnableUploads = true; $wgUseImageMagick = true; $wgImageMagickConvertCommand = "/usr/bin/convert"; $wgMaxUploadSize = 4194304; $wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'ico', 'doc', 'docx', 'xls', 'xlsx', 'pdf', 'svg', 'bmp', 'webp' );
$wgFooterIcons['hostingby']['doncloud'] = [
        "src" => "$wgResourceBasePath/resources/assets/chevyne/doncloud.88x31.png",
        "url" => "http://www.doncloud.vip",
        "alt" => "Hosting by DonCloud",
];
$wgExternalLinkTarget = '_blank';