Difference between revisions of "MediaWiki Visual Editor Parsoid 404 Error"
Line 27: | Line 27: | ||
== My configuration == | == My configuration == | ||
For my config.yaml file, just two lines; | For my config.yaml (Parsoid service configuration) file, just two lines; | ||
| | ||
Line 35: | Line 35: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Also, I noticed a dash ( - ) in front of a comment hash tag ( # ) that I thought was a typo, but some people actually referenced it as it was supposed to be there, so I left it. | For my LocalSettings.php (MediaWiki configuration) file, the following code, using the same fully qualified domain name and path, plus the port number of the Parsoid service (8000 in my case).<syntaxhighlight lang="bat"> | ||
wfLoadExtension( 'VisualEditor' ); | |||
//Enable VisualEditor by default for everybody | |||
$wgDefaultUserOptions['visualeditor-enable'] = 1; | |||
// Optional: Set VisualEditor as the default for anonymous users | |||
// otherwise they will have to switch to VE | |||
// $wgDefaultUserOptions['visualeditor-editor'] = "visualeditor"; | |||
// Don't allow users to disable it | |||
$wgHiddenPrefs[] = 'visualeditor-enable'; | |||
// OPTIONAL: Enable VisualEditor's experimental code features | |||
#$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1; | |||
// Parsoid configuration | |||
$wgVirtualRestConfig['modules']['parsoid'] = array( | |||
// URL to the Parsoid instance | |||
// Use port 8142 if you use the Debian package | |||
// url must not end in a slash, otherwise it might give a 404 error | |||
'url' => 'http://DomainNameAndPath:8000', | |||
// Parsoid "domain", see below (optional) | |||
'domain' => 'localhost', | |||
// Parsoid "prefix", see below (optional) | |||
//'prefix' => 'wiki.terrabase.info', | |||
//If you run a private wiki then you have to set the following variable to true: | |||
'forwardCookies' => true | |||
); | |||
</syntaxhighlight> | |||
Also, I noticed a dash ( - ) in front of a comment hash tag ( # ) that I thought was a typo, but some people actually referenced it as it was supposed to be there. It worked, so I left it. | |||
</div> | </div> | ||
Revision as of 08:53, 16 January 2018
The Issue
I had successfully installed MediaWiki, an additional WYSIWYG editor, and as a final step I wanted to also configure the Visual Editor. To do that, one also needs to install the Parsoid service (daemon, well in CentOS 7, they seem to now favor the term service) and get them 'talking' together. So I did. I got the Parsoid service working, and...
Wait, two three side notes here. In my attempts to get the Parsoid service working I noticed that in my instance I could start the service and even if it didn't start correctly, it wouldn't notify me there was an error. I had to manually check the status to discover it wasn't actually started. So watch out for that item. For me in CentOS 7.4, the command is: systemctl status parsoid
Another item I noticed was that the config.yaml (for the Parsoid service) file was oddly picky about the spaces and tabs on every line, and if it wasn't happy, it wouldn't start. I had to copy and paste the tabs or spaces that preceded lines from other configuration lines where I had erased it on other lines.
OK, that reminds me, there's a third item I noticed too, which was that a lot of the documentation I was reading had configuration references that were for older versions. I was working with WikiMedia 1.3 and the Parsoid version available on 1.14.2018. A lot of the documentation I read referred to the localsettings.js file (Parsoid service configuration) which appears to have been deprecated at some point in favor of the config.yaml file.
Anyway, I got the Parsoid service installed and working (tested it in all the methods recommended), but it just would not 'talk' with the MediaWiki site. It kept coming up with a 404 (not found) error. Nothing I did made a dent in the issue. Plus there were different suggestions from different sites that had radically different configurations settings that on the surface would seem to suggest there was no way one of these methods ever actually worked. But I tried them anyway to no success. After I got everything working (spoiler alert), I chalked this part of the adventure up to different versions of the Visual Editor, Parsoid, and different 'flavors' of linux.
The Research
And so I googled what I wrote as the title to this page; mediawiki visual editor parsoid 404 error, and started there. As I mentioned earlier, there were a lot of good suggestions on how to fix it, but nothing worked for me.
The Solution
The Question
Have you checked your apache / HTTPD configuration?
The Solution (continued)
My configuration
For my config.yaml (Parsoid service configuration) file, just two lines;
uri: '[[Http://FullQualifiedDomainNameAndPath/api.php'|http://FullyQualifiedDomainNameAndPath/api.php']]
domain: 'localhost'
wfLoadExtension( 'VisualEditor' );
//Enable VisualEditor by default for everybody
$wgDefaultUserOptions['visualeditor-enable'] = 1;
// Optional: Set VisualEditor as the default for anonymous users
// otherwise they will have to switch to VE
// $wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";
// Don't allow users to disable it
$wgHiddenPrefs[] = 'visualeditor-enable';
// OPTIONAL: Enable VisualEditor's experimental code features
#$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;
// Parsoid configuration
$wgVirtualRestConfig['modules']['parsoid'] = array(
// URL to the Parsoid instance
// Use port 8142 if you use the Debian package
// url must not end in a slash, otherwise it might give a 404 error
'url' => 'http://DomainNameAndPath:8000',
// Parsoid "domain", see below (optional)
'domain' => 'localhost',
// Parsoid "prefix", see below (optional)
//'prefix' => 'wiki.terrabase.info',
//If you run a private wiki then you have to set the following variable to true:
'forwardCookies' => true
);
Also, I noticed a dash ( - ) in front of a comment hash tag ( # ) that I thought was a typo, but some people actually referenced it as it was supposed to be there. It worked, so I left it.
The Conclusion
And then everything worked.
Sorry if you were looking for some really detailed instructions or a summary on all the stuff I learned, but my intent was to just share my story and solution. Hopefully it helps someone.
Final Thoughts
One other item I ran into was logging for the Parsoid service. At the stage where I was trying to get that service working I figured I'd just check the log files. A large number of sites referred to the log file location at /var/log/parsoid/parsoid.log, but that didn't exist for me. Long story short, I went down the logging rabbit hole for about an hour and ended up giving up as I could never get the service to actually log anything. So if anyone has a 'how to' on that, specifically for CentOS, please write something on that subject. Thanks in advance.