3

こんにちは、私は mediawiki 1.26.2 を拡張ビジュアル エディター、nodejs、および parsoid とともにインストールしました。問題は、parsoid を起動すると、すべてのプロセスが正しく機能しているように見えますが、parsoid と visualeditor の構成がまったく表示されないことです。私のwikiの編集者。

以下に、すべての構成、parsoid の開始方法、関係する parsoid のプロセス、およびメディア wiki 構成ファイルの localsettings の構成行について説明します。

/etc/init.d/parsoid2 開始-終了スクリプト:

#!/bin/bash
#
# chkconfig: 35 90 12
# description: Foo server
#
# Get function from functions library
#. /etc/init.d/functions
# Start the service PARSOID
SCRIPT_PATH="/usr/lib/parsoid/src/bin/server.js"
DAEMON="/usr/bin/node $SCRIPT_PATH"
DAEMON_ARGS=""

start() {
    #initlog -c "echo -n Starting PARSOID server: "
      ulimit -n 64000
    /usr/bin/node  /usr/lib/parsoid/src/bin/server.js      >> /var/log/parsoid/parsoid.log 2>&1 &
    ### Create the lock file ###
    #touch /var/lock/subsys/parsoid
    success $"PARSOID server startup"
    echo
}
# Restart the service PARSOID
stop() {
    #initlog -c "echo -n Stopping PARSOID server: "
    pkill -f server.js
    ### Now, delete the lock file ###
    rm -f /var/lock/subsys/parsoid
    echo
}
### main logic ###
case "$1" in
start)
    start
    ;;
stop)
    stop
    ;;
status)
    status parsoid_nodejs.sh
    ;;
restart|reload|condrestart)
    stop
    start
    ;;
*)
    echo $"Usage: $0 {start|stop|restart|reload|status}"
    exit 1
esac
exit 0

/etc/init.d/parsoid2 start を実行した後に関係する parsoid のプロセス

root@vscj016mlinuxserver:~# ps -ef | grep parsoid
root      2244     1  0 08:21 pts/0        00:00:00 /usr/bin/node /usr/lib/parsoid/src/bin/server.js
root      2251  2244  0 08:21 pts/0    00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/bin/server.js
root      2252  2244  0 08:21 pts/0    00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/bin/server.js
root      2258  2244  0 08:21 pts/0    00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/bin/server.js
root      2264  2244  0 08:21 pts/0    00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/bin/server.js
root      2437  2023  0 08:36 pts/0    00:00:00 grep --color=auto parsoid
root@vscj016mlinuxserver:~#

Localsetting.js パーソイド構成ファイル:

exports.setup = function(parsoidConfig) {
    // Set your own user-agent string
    // Otherwise, defaults to "Parsoid/<current-version-defined-in-    package.json>"
    //parsoidConfig.userAgent = "My-User-Agent-String";

    // Configure Parsoid to point to your MediaWiki instance.
    parsoidConfig.setMwApi({
            // The "prefix" is the name given to this wiki configuration in     the
            // (deprecated) Parsoid v1 API.
            prefix: 'localhost', // optional
            // The "domain" is used for communication with Visual Editor
            // and RESTBase.  It defaults to the hostname portion of
            // the `uri` property below, but you can manually set it
            // to an arbitrary string.
            domain: 'localhost', // optional
            // This is the only required parameter:
            // the URL of you MediaWiki API endpoint.
            uri: 'http://localhost/mediawiki/api.php',
            // To specify a proxy (or proxy headers) specific to this prefix
            // (which overrides defaultAPIProxyURI). Alternatively, set     `proxy`
            // to `null` to override and force no proxying when a default     proxy
            // has been set.
            /*
            proxy: {
                    uri: 'http://my.proxy:1234/',
                    headers: { 'X-Forwarded-Proto': 'https' } // headers     are optional
            }
            */
        });

/var/www/HTML/mediawiki/Localsettings.php での VisualEditor の設定:

require_once "$IP/extensions/VisualEditor/VisualEditor.php";
wfLoadExtension ( 'VisualEditor' );
$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgDefaultUserOptions['minordefault'] = 1;
$wgHiddenPrefs[] = 'visualeditor-enable';
$wgVisualEditorParsoidURL = 'http://localhost:8000';
$wgVirtualRestConfig['modules']['parsoid'] = array('url' => 'http://localhost:8000', 'domain' => 'localhost', 'prefix' => 'localhost');
$wgSessionsInObjectCache = true;
$wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true;
4

2 に答える 2

1

parsoid のバージョンが Visual Editor のバージョンと一致していることを確認してください。古い方法で Visual Editor を構成する必要がある場合があります。

$wgVisualEditorParsoidURL = 'http://127.0.0.1:8000';
$wgVisualEditorParsoidPrefix = 'localhost';
于 2016-07-05T20:35:19.543 に答える