質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

MediaWiki

MediaWikiは、Wikipediaを運営するウィキメディア財団が開発するコラボレーションツールです。複数ユーザーによるコンテンツ管理機能を備えるなど、Wikipediaと同じ操作性や編集機能を持ちます。PHPで記述されており、MySQLやPostgreSQLをデータベースに使用できます。

Q&A

0回答

253閲覧

MediaWikiのVisualEditor導入が「curl error: 7」で先に進まない

Brython_A

総合スコア0

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

MediaWiki

MediaWikiは、Wikipediaを運営するウィキメディア財団が開発するコラボレーションツールです。複数ユーザーによるコンテンツ管理機能を備えるなど、Wikipediaと同じ操作性や編集機能を持ちます。PHPで記述されており、MySQLやPostgreSQLをデータベースに使用できます。

0グッド

0クリップ

投稿2023/04/22 08:21

実現したいこと

  • 最終的には、元のMediaWikiをアップグレードして再度公開する
  • 直近では、VisualEditorの導入・稼働させる

前提

元々は、32bit版のUbuntu 18.04.x LTSで動いていました。
サポート終了にともない、64bit版に載せ替え、Ubuntuだけでなく、MediaWikiもアップグレードさせましたが、VisualEditor導入の部分で躓いております。
元のMediaWikiは、その手順を備忘録がてら公開しています。
そのMediaWiki関連のページがこちらになり、
http://ateliertrigger.mac-in.net/2018/11/10/%e5%8f%a4%e3%81%84mac%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e8%87%aa%e5%ae%85%e3%82%b5%e3%83%bc%e3%83%8f%e3%82%99%e3%83%bc%e3%82%92%e6%a7%8b%e7%af%89%ef%bc%8f%e3%81%9d%e3%81%ae%ef%bc%94/
それを主な参考にして、バージョンによる相違などをぐぐりながら作業を進めていました。
一度は、新しい方でもVisualEditorが正常に稼働するところまで行ったのですが、ぐちゃぐちゃにいじったものを綺麗に入れ直すため、導入前の時点にバックアップから復元し再度導入しようとして、ハマっているところです。
なお、ぐちゃぐちゃになっていた時点のバックアップはしていませんでした。

発生している問題・エラーメッセージ

MediaWikiの「編集」を押すと、

Error contacting the Parsoid/RESTBase server: (curl error: 7) Couldn't connect to server

というエラーが表示され動作しません。

端末でsudo systemctl status parsoidを実行してちゃんと稼働していたのですけれど、その時も駄目でした。
現在は、failedになっています。

× parsoid.service - Mediawiki Parsoid web service on node.js Loaded: loaded (/etc/systemd/system/parsoid.service; enabled; vendor prese> Active: failed (Result: exit-code) since Sat 2023-04-22 16:30:26 JST; 577m> Docs: http://www.mediawiki.org/wiki/Parsoid Process: 14300 ExecStart=/usr/bin/nodejs /var/www/html/nd/extensions/parsoi> Main PID: 14300 (code=exited, status=1/FAILURE) CPU: 2.548s 4月 22 16:30:22 apple2c-Macmini nodejs[14300]: {"name":"parsoid","hostname":"a> 4月 22 16:30:23 apple2c-Macmini nodejs[14333]: {"name":"parsoid","hostname":"a> 4月 22 16:30:24 apple2c-Macmini nodejs[14300]: {"name":"parsoid","hostname":"a> 4月 22 16:30:24 apple2c-Macmini nodejs[14300]: {"name":"parsoid","hostname":"a>

該当のソースコード

おそらく、parsoidがらみが原因だと思いますけれど、一応、LocalSettings.phpも載せておきます。

config.yaml

1(略) 2worker_heartbeat_timeout: 300000 3 4logging: 5 level: info 6 7#metrics: 8# type: log 9 10services: 11 - module: lib/index.js 12 entrypoint: apiServiceWorker 13 conf: 14 # For backwards compatibility, and to continue to support non-static 15 # configs for the time being, optionally provide a path to a 16 # localsettings.js file. See localsettings.example.js 17 localsettings: ./localsettings.js 18 19 # Set your own user-agent string 20 # Otherwise, defaults to: 21 # 'Parsoid/<current-version-defined-in-package.json>' 22 #userAgent: 'My-User-Agent-String' 23 24 # Configure Parsoid to point to your MediaWiki instances. 25 mwApis: 26 - # This is the only required parameter, 27 # the URL of you MediaWiki API endpoint. 28 uri: 'http://localhost/nd/api.php' 29 # The "domain" is used for communication with Visual Editor 30 # and RESTBase. It defaults to the hostname portion of 31 # the `uri` property above, but you can manually set it 32 # to an arbitrary string. It must match the "domain" set 33 # in $wgVirtualRestConfig. 34 #domain: 'localhost' # optional 35 # To specify a proxy (or proxy headers) specific to this prefix 36 # (which overrides defaultAPIProxyURI). Alternatively, set `proxy` 37 # to `null` to override and force no proxying when a default proxy 38 # has been set. 39 #proxy: 40 # uri: 'http://my.proxy:1234/' 41 # headers: # optional 42 # 'X-Forwarded-Proto': 'https' 43(略) 44

localsettings.js

1(略) 2'use strict'; 3 4exports.setup = function(parsoidConfig) { 5parsoidConfig.setMwApi({ 6uri: 'http://localhost/nd/api.php', 7domain: 'localhost', 8prefix: '' 9}); 10};

parsoid.env

1PORT=8000 2NODE_PATH=/var/www/html/nd/extensions/parsoid/node_modules/

LocalSettings.php

1<?php 2(略) 3# Protect against web entry 4if ( !defined( 'MEDIAWIKI' ) ) { 5 exit; 6} 7 8 9## Uncomment this to disable output compression 10# $wgDisableOutputCompression = true; 11 12$wgSitename = "ニッチでドワーフなWiki"; 13 14## The URL base path to the directory containing the wiki; 15## defaults for all runtime URL paths are based off of this. 16## For more information on customizing the URLs 17## (like /w/index.php/Page_title to /wiki/Page_title) please see: 18## https://www.mediawiki.org/wiki/Manual:Short_URL 19$wgScriptPath = "/nd"; 20 21## The protocol and server name to use in fully-qualified URLs 22$wgServer = "http://localhost"; 23 24## The URL path to static resources (images, scripts, etc.) 25$wgResourceBasePath = $wgScriptPath; 26 27## The URL paths to the logo. Make sure you change this from the default, 28## or else you'll overwrite your logo when you upgrade! 29$wgLogos = [ 30 '1x' => "$wgResourceBasePath/resources/assets/change-your-logo.svg", 31 'icon' => "$wgResourceBasePath/resources/assets/change-your-logo.svg", 32]; 33 34## UPO means: this is also a user preference option 35 36$wgEnableEmail = true; 37$wgEnableUserEmail = true; # UPO 38 39$wgEmergencyContact = "www-data@localhost"; 40$wgPasswordSender = "www-data@localhost"; 41 42$wgEnotifUserTalk = false; # UPO 43$wgEnotifWatchlist = false; # UPO 44$wgEmailAuthentication = true; 45 46## Database settings 47$wgDBtype = "mysql"; 48$wgDBserver = "localhost"; 49$wgDBname = "ndwiki"; 50$wgDBuser = "root"; 51$wgDBpassword = "Pineapple"; 52 53# MySQL specific settings 54$wgDBprefix = "nd_"; 55 56# MySQL table options to use during installation or update 57$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary"; 58 59# Shared database table 60# This has no effect unless $wgSharedDB is also set. 61$wgSharedTables[] = "actor"; 62 63## Shared memory settings 64$wgMainCacheType = CACHE_NONE; 65$wgMemCachedServers = []; 66 67## To enable image uploads, make sure the 'images' directory 68## is writable, then set this to true: 69$wgEnableUploads = false; 70#$wgUseImageMagick = true; 71#$wgImageMagickConvertCommand = "/usr/bin/convert"; 72 73# InstantCommons allows wiki to use images from https://commons.wikimedia.org 74$wgUseInstantCommons = false; 75 76# Periodically send a pingback to https://www.mediawiki.org/ with basic data 77# about this MediaWiki instance. The Wikimedia Foundation shares this data 78# with MediaWiki developers to help guide future development efforts. 79$wgPingback = true; 80 81# Site language code, should be one of the list in ./includes/languages/data/Names.php 82$wgLanguageCode = "ja"; 83 84# Time zone 85$wgLocaltimezone = "Asia/Tokyo"; 86 87## Set $wgCacheDirectory to a writable directory on the web server 88## to make your wiki go slightly faster. The directory should not 89## be publicly accessible from the web. 90#$wgCacheDirectory = "$IP/cache"; 91 92$wgSecretKey = "eb5b8f6349404a39ba383bd33e5b1c991cd1abb20e31979976f4e6d5ebb6715d"; 93 94# Changing this will log out all existing sessions. 95$wgAuthenticationTokenVersion = "1"; 96 97# Site upgrade key. Must be set to a string (default provided) to turn on the 98# web installer while LocalSettings.php is in place 99$wgUpgradeKey = "2563e6e57eec571c"; 100 101## For attaching licensing metadata to pages, and displaying an 102## appropriate copyright notice / icon. GNU Free Documentation 103## License and Creative Commons licenses are supported so far. 104$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright 105$wgRightsUrl = ""; 106$wgRightsText = ""; 107$wgRightsIcon = ""; 108 109# Path to the GNU diff3 utility. Used for conflict resolution. 110$wgDiff3 = "/usr/bin/diff3"; 111 112# The following permissions were set based on your choice in the installer 113$wgGroupPermissions['*']['edit'] = false; 114 115## Default skin: you can change the default skin. Use the internal symbolic 116## names, e.g. 'vector' or 'monobook': 117$wgDefaultSkin = "vector"; 118 119# End of automatically generated settings. 120# Add more configuration options below. 121 122 123 124wfLoadSkin( 'Vector' ); 125$wgVectorUseSimpleSearch = true; 126$wgVectorUseIconWatch = true; 127 128 129 130wfLoadExtension( 'VisualEditor' ); 131 132## VisualEditor&Parsoid 133$wgVisualEditorEnableWikitext = true; 134$wgDefaultUserOptions['visualeditor-enable'] = 1; 135$wgDefaultUserOptions['visualeditor-editor'] = "visualeditor"; 136$wgHiddenPrefs[] = 'visualeditor-enable'; 137# $wgHiddenPrefs[] = 'visualeditor-newwikitext'; 138$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1; 139# $wgDefaultUserOptions['visualeditor-newwikitext'] = 1; 140$wgVisualEditorAvailableNamespaces = [ 141 NS_MAIN => true, 142 NS_USER => true, 143 102 => true, 144 "_merge_strategy" => "array_plus" 145]; 146$wgVisualEditorAvailableNamespaces = [ 147 "Help" => true, 148 "Extra" => true, 149 "Category" => true, 150 "Project" => true, 151 "Template" => true, 152 "User" => true, 153 "(main)" => true, 154 "talk" => true 155]; 156$wgVirtualRestConfig['modules']['parsoid'] = array( 157 'url' => 'https://localhost:8143', 158 'domain' => 'localhost', 159 'prefix' => 'localhost' 160);

試したこと

php8.1-curlはインストールしてみました。
設定などをいじるたびにsudo systemctl restart apache2でapacheは再起動しています。

parsoidのインストールに何通りかあるようです。
ググってでてきたものは試そうとしましたが、これだけはうまくできません。
https://blog.tsukumijima.net/article/mediawiki-visualeditor-parsoid/
どうやら、apt-keyが使えなくなったようです。
ググって他にも色々と試したのですけれど、混乱しているのでイチから全部を何度もやり直しました。
アドバイス頂いたら、「すでにやった」とか言わずに、もう一度やります。
何か初歩的なミスをしていたり、何か肝心なことを忘れていたりするかもしれません。
なので、「これは既にやっただろう」などと推測せずに、ヒントでもいいので何かアドバイスをください。

補足情報(FW/ツールのバージョンなど)

  • 自宅サーバー LAN内で稼働中
  • Ubuntu 22.04.2 LTS (Desktop)
  • Server version: Apache/2.4.52 (Ubuntu)
    Server built: 2023-03-08T17:32:01
  • PHP 8.1.2-1ubuntu2.11 (cli) (built: Feb 22 2023 22:56:18) (NTS)
  • mysql Ver 8.0.32-0ubuntu0.22.04.2 for Linux on x86_64 ((Ubuntu))
  • MediaWiki 1.39.3 (3dae40d) 2023年4月18日 (火) 14:26
  • node v12.22.9
  • Parsoid 0.8.1

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問