MediaWiki:設置方法
提供: robot-jp wiki
Wikiダウンロード
①SSHログイン:teratrmでサーバーに SSH接続
- サーバー ssh.*****.jp
- 接続ポート 2222
- アカウント **********t
- SSHパスワード ************************ ※shift+Insでペースト
②公開フォルダに移動
- cd web
③ダウンロード(約5秒で完了)
④解凍(約8秒で完了)
- tar xvzf mediawiki-1.35.2.tar.gz
⑤不要なファイルを削除
- rm -r mediawiki-1.35.2.tar.gz
⑥フォルダ名変更(フォルダ名が"wiki"の場合)
- mv mediawiki-1.35.2 wiki
⑦ファイルリストを確認
- ll
⑧終了処理
- exit (teratermは自動で終了)
---
Wikiの初期設定
■エントリポイントのリンクを変える
■wikiを起動して初期設定する
■アイコンファイルを作る
- /resources/assets/wiki.png
■mediawikiのextentionをダウンロード・アップロード
- /LocalSettings.php ................ https://www.mediawiki.org/wiki/Extension:Popups/ja
- /resources/assets/wiki.png .... アイコンファイル ※Wikiのバージョンアップで上書きされるので都度上書き
- /extensions/JsonConfig/ ........ JSonフォーマットによるグラフ描画機能を入れる
- /extensions/Popups/ ............. マウスオーバーによるポップアップ表示機能を入れる
- ※pngファイルは "ロリポップFTP"でアップしないと正常に表示されない事がある
■閲覧権限の再設定(必要な場合)
/LocalSettings.php
■ダウンロードフォルダに入った"LocalSettings.php"をカスタマイズ
- 46行目~ 下記内容をコピー(挿入):メール送信の設定
$wgEmergencyContact = "****@********.***"; $wgPasswordSender = "****@********.***"; $wgSMTP = [ 'host' => 'smtp.*********.jp', // could also be an IP address. Where the SMTP server is located. If using SSL or TLS, add the prefix "ssl://" or "tls://". 'IDHost' => '**********', // Generally this will be the domain name of your website (aka mywiki.org) 'port' => ***, // Port to use when connecting to the SMTP server 'auth' => ***, // Should we use SMTP authentication (true or false) 'username' => '**********', // Username to use for SMTP authentication (if being used) 'password' => '**********' // Password to use for SMTP authentication (if being used) ]; $wgEnotifUserTalk = false; # UPO $wgEnotifWatchlist = false; # UPO $wgEmailAuthentication = true;
- 72(79)行目~確認:データベースの接頭語($wgDBprefix)を確認
# MySQL specific settings $wgDBprefix = "wiki";
- 139(144)行目以降 下記内容に差し替え&サーバー上のインストールフォルダ内にアップロード
- ①monobook指定、②VisualEditor指定、③Spamフィルタをコメントアウト(alibabaにアクセスできなくなるため)
- ④アイコンを設定、⑤グラフをJsonフォーマットで描画する機能も入れておく
## Default skin: you can change the default skin. Use the internal symbolic ## names, ie 'vector', 'monobook': $wgDefaultSkin = "monobook"; # Enabled skins. # The following skins were automatically enabled: wfLoadSkin( 'MonoBook' ); wfLoadSkin( 'Timeless' ); wfLoadSkin( 'Vector' ); # Enabled extensions. Most of the extensions are enabled by adding # wfLoadExtension( 'ExtensionName' ); # to LocalSettings.php. Check specific extension documentation for more details. # The following extensions were automatically enabled: wfLoadExtension( 'CategoryTree' ); wfLoadExtension( 'Cite' ); wfLoadExtension( 'CiteThisPage' ); wfLoadExtension( 'CodeEditor' ); wfLoadExtension( 'ConfirmEdit' ); wfLoadExtension( 'Gadgets' ); wfLoadExtension( 'ImageMap' ); wfLoadExtension( 'InputBox' ); wfLoadExtension( 'Interwiki' ); wfLoadExtension( 'LocalisationUpdate' ); wfLoadExtension( 'MultimediaViewer' ); wfLoadExtension( 'Nuke' ); wfLoadExtension( 'OATHAuth' ); wfLoadExtension( 'PageImages' ); wfLoadExtension( 'ParserFunctions' ); wfLoadExtension( 'PdfHandler' ); wfLoadExtension( 'Poem' ); wfLoadExtension( 'Renameuser' ); wfLoadExtension( 'ReplaceText' ); wfLoadExtension( 'Scribunto' ); wfLoadExtension( 'SecureLinkFixer' ); #wfLoadExtension( 'SpamBlacklist' ); wfLoadExtension( 'SyntaxHighlight_GeSHi' ); wfLoadExtension( 'TemplateData' ); wfLoadExtension( 'TextExtracts' ); wfLoadExtension( 'TitleBlacklist' ); wfLoadExtension( 'VisualEditor' ); wfLoadExtension( 'WikiEditor' ); # End of automatically generated settings. # Add more configuration options below. # --------------------------------------------- # 未ログインでの参照 false:不可 $wgGroupPermissions['*']['read'] = false; # 未ログインでの編集 不可:false $wgGroupPermissions['*' ]['edit'] = true; # 一般利用者の編集 不可:false $wgGroupPermissions['user' ]['edit'] = true; # 管理者の編集 可:true $wgGroupPermissions['sysop']['edit'] = true; # ファイルのアップロード 可:true $wgEnableUploads = true; # アカウントの新規作成 不可:false $wgGroupPermissions['*']['createaccount'] = true; # アイコンの設定 $wgFavicon = "$wgResourceBasePath/resources/assets/wiki.png" ; $wgHiddenPrefs[] = 'usebetatoolbar'; # linkへのマウスオーバーでページのプレビュー wfLoadExtension( 'Popups' ); # グラフ描画をJsonフォーマット記述で行うモジュール wfLoadExtension( 'JsonConfig' );
Wikiの変更履歴の削除方法
- ページのソースを控える
- ページを削除
- 同じ名前でページを追加