3

Hi I've installed mediawiki 1.26.2 with the extensión Visual Editor, nodejs and parsoid, the question is that when I start parsoid, it seems every process is working right but the the configuration of parsoid and visualeditor, I can't see any editor in my wiki.

I describe below all my configurations, how I start parsoid, the processes of parsoid involved and the configurations lines in localsettings of media wiki configuration file.

/etc/init.d/parsoid2 start-end script:

#!/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

processes of parsoid involved after I run /etc/init.d/parsoid2 start

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:~#

the Localsetting.js parsoid configuration file:

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
            }
            */
        });

The configuration for VisualEditor at /var/www/HTML/mediawiki/Localsettings.php:

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;
makaflay
  • 31
  • 2
  • post some logs, not only config. Api is awailable for this adress? `http://localhost/mediawiki/api.php` also, [check parsoid actually work](https://www.mediawiki.org/wiki/Parsoid/Troubleshooting) with `yourDomain:8000/_wikitext/` – teo van kot Jun 15 '16 at 12:55
  • Thanks for your answer teo van kot, I just want to explain that I receive answer at http://localhost/mediawiki/api.php, on another hand I receive answer at http://localhost:8000/_wikitext with the web answer web which says "Invalid prefix: enwiki" I do not know if that is the correct or and error answer from parsoid. – makaflay Jun 20 '16 at 08:05
  • this is the output of /var/log/parsoid/parsoid.log:[info][master][2506] initializing 4 workers [info][worker][2513] loading ... [info][worker][2514] loading ... [info][worker][2520] loading ... [info][worker][2526] loading ... [info][worker][2514] ready on :8000 [info][worker][2520] ready on :8000 [info][worker][2513] ready on :8000 [info][worker][2526] ready on :8000 [fatal/request][worker][2513] Invalid prefix: enwiki root@vscj016mlinuxserver:~# – makaflay Jun 20 '16 at 08:06
  • First, It should be `http://localhost:8000/_wikitext//`, so in your case `http://localhost:8000/_wikitext/localhost/`. Second, remove the line `require_once "$IP/extensions/VisualEditor/VisualEditor.php";` which is done by `wfLoadExtension ( 'VisualEditor' );` already. Third, check at Special:Version, if Visual Editors appears there. Also, please read my other answer below. – escalator Feb 08 '17 at 07:35

2 Answers2

1

Please ensure that your parsoid version match your Visual Editor version, there is a chance that you should use old-way to configure Visual Editor:

$wgVisualEditorParsoidURL = 'http://127.0.0.1:8000';
$wgVisualEditorParsoidPrefix = 'localhost';
wakalaka
  • 524
  • 4
  • 12
  • well, I've got those two parameters configured in my Localsettings.php as you describe, unfortunately nothing happens, maybe you are right about the version of parsoid and VisualEditor, the question is that I do not Know where I have to download the correct parsoid and VisualEditor version for mediawiki 1.27.0, I'm a bit disapointted about this, I would apreciate some help, I'm new about this product of mediawiki , VisualEditor and parsoid, thank you any way. – makaflay Jul 06 '16 at 10:06
1
escalator
  • 888
  • 9
  • 14