Topic on Talk:Parsoid

Multiple wikis sharing the same parsoid service

3
Summary by Arlolra

url in the virtualrestconfig corresponds to the parsoid service and should be the same across wikis

LP371906 (talkcontribs)

Hi

i can't share multiple wikis on the same parsoid service.

"config.yaml" looks like that:


     mwApis:

- # First wiki

uri: 'http://wiki1.mysite.com/api.php'

  domain: 'wiki1.mysite.com'  # optional

- # If you have another wiki on a different domain

uri: 'http://wiki2.mysite.com/api.php'

domain: 'wiki2.mysite.com'  # optional


"Wiki1" is fully functionally

but in "wiki2" i can't edit a page. there is an error:

"apierror-visualeditor-docserver-http: HTTP 401"


i can do a change in "LocalSettings_wiki2.php" of Parsoid "Domain" to "wiki1.mysite.com". And now i can edit a page, but there is showing an other page of wiki1.

i have a LocalSettings.php who switch pages:

       switch ( $_SERVER['SERVER_NAME'] ) {

               case 'wiki1.mysite.com':

                       require_once 'LocalSettings_wiki1.php';

                       break;

    case 'wiki2.mysite.com':

                       require_once 'LocalSettings_wiki2.php';

                       break;


and my "LocalSettings_wiki2.php" is showing:

#Link with Parsoid

$wgVirtualRestConfig['modules']['parsoid'] = array(

   // URL to the Parsoid instance

   'url' => 'http://wiki2.mysite.com:8000',

   // Parsoid "domain", see below (optional)

   'domain' => 'wiki2.mysite.com',


LocalSettings_wiki1.php is almost similar, only "url" and "Domain" are different but also port 8000


can someone help?

thanks a lot!

PenDragyn21 (talkcontribs)

When I got this working, Parsoid had set its main service up on the top-level domain (localhost:8000 or mysite.com:8000). I believe the 'url' parameter in LocalSettings wants this value or where ever the shared instance of parsoid is running. Not the domain for your individual wikis.

First, with parsoid running, check to see if it's running on the TLD.

Either type 'curl http://mysite.com:8000' at a commandline or use a web browser to visit 'http://mysite.com:8000'. If that's where parsoid is running, you'll get back HTML code from the curl command or a 'Welcome to Parsoid' page.

If that works, change the 'url' in $wgVirtualRestConfig to just 'http://mysite.com:8000' in your LocalSettings_wiki1.php and _wiki2.php. (But leave your config.yaml as is.) See if that fixes the errors.


LP371906 (talkcontribs)

Hi PenDragyn21

i've change my LocalSettings Config to:


#Link with Parsoid

$wgVirtualRestConfig['modules']['parsoid'] = array(

   // URL to the Parsoid instance

   'url' => 'http://localhost:8000',

   // Parsoid "domain", see below (optional)

   'domain' => 'wiki2.mysite.com',

   // Parsoid "prefix", see below (optional)

   'prefix' => 'wiki2.mysite.com'

);

$wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true;



but i think the Problem was "forwardCookies" = true.


many thanks!