LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-26-2018, 02:04 PM   #1
MarkR1717
LQ Newbie
 
Registered: Jul 2018
Posts: 3

Rep: Reputation: Disabled
MediaWiki has error 500 when 2 HTML2Wiki lines are added to localsettings


Hi

HTML2Wiki is installed, (I hope) but it doesn't work, and additionally when I add:

wfLoadExtension( 'Html2Wiki' );
$wgNamespacesWithSubpages[NS_MAIN] = true; // has to be set BEFORE the wfLoadExtension()!

The web page stops working with the error 505 using debian o/s

Working webpage:
http://misconductinpublicoffice.bitn....com/Main_Page

I've followed the instructions,
https://www.mediawiki.org/wiki/Extension:Html2Wiki
but may have installed parts in a different order.

Any advice would be welcome.

Thanks
Mark
 
Old 07-27-2018, 10:56 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Hello Mark:

Page says
Add the following code at the bottom of your LocalSettings.php:
Code:
wfLoadExtension( 'Html2Wiki' );
$wgNamespacesWithSubpages[NS_MAIN] = true; // has to be set BEFORE the wfLoadExtension()!
Bottom?
Did you execute
Code:
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Html2Wiki.git
?

You have composer installed as well?
[CODE]Composer is used to manage the dependencies on 3rd-party code. Once you have the Html2Wiki code in your 'extensions' directory, follow these steps to pull in those dependencies.

Code:
cd Html2Wiki
composer install
Presumably this is "under" or below the DocumentRoot, likely /var/www/html or further into that path.
Code:
Note: If you do not have composer on your system, you can either install it [3] (it's good to have). Or, use the phar file:

cd Html2Wiki
wget https://getcomposer.org/composer.phar
php composer.phar install
One or the other of these two.
Code:
composer install
or
Code:
php composer.phar install
Let's look at the error log, assuming apache
Code:
grep -w 505 /var/log/apache2/error.log
Anything stand out?

Let us know!

Last edited by Habitual; 07-27-2018 at 11:02 AM.
 
1 members found this post helpful.
Old 07-28-2018, 09:43 AM   #3
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Quote:
wfLoadExtension( 'Html2Wiki' );
$wgNamespacesWithSubpages[NS_MAIN] = true; // has to be set BEFORE the wfLoadExtension()!
indicates to me that perhaps these lines should be flipped.
 
1 members found this post helpful.
Old 07-29-2018, 08:03 AM   #4
MarkR1717
LQ Newbie
 
Registered: Jul 2018
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks AwesomeMachine and Habitual for the replies above.

I think I've followed all the steps, but am unsure about how to do the error log part.

I've copied the following into the special MediaWiki page, but I think it must need adapting for the Bitnami installation. Is there anything obvious that I need to change?

Thanks in advance.

Mark


Code:
/*
 * THIS COMMENT CAN BE REMOVED WHEN COPYING THIS CONTENT TO YOUR WIKI
 * THIS COMMENT DESCRIBES HOW TO INSTALL THIS JAVASCRIPT
 *
 * Copy and past the contents of this file to your wiki by editing the
 * "interface" page MediaWiki:Common.js
 * e.g. http://localhost/wiki/MediaWiki:Common.js
 *
 * If there is already content in that page, PRESERVE the existing content.
 * i.e. Append the source below.
 *
 * This JavaScript adds a link (Import HTML) to the 'tools' section of your wiki
 * making it easy to access the Special:Html2Wiki page.
 */

/* Any JavaScript here will be loaded for all users on every page load. */

/**
 * Cusomize the sidebar for the Html2Wiki extension
 * @see https://www.mediawiki.org/wiki/Manual:Interface/Sidebar
 * added by Greg Rundlett <info@eQuality-Tech.com>
 */
function isObject( obj ) {
	return typeof obj == 'object' && obj !== null;
}

function isArray( obj ) {
	return isObject( obj ) && obj.constructor.toString().indexOf( 'Array' ) != -1;
}

Array.prototype.Contains = function( element, strict ) {
	for( var i in this ) {
		if( this[i] == element && !strict || this[i] === element ) {
			return true;
		}
	}
	return false;
};

function ModifySidebar( action, section, name, link ) {
	try {
		var target;
		switch ( section ) {
			case 'languages':
				target = 'p-lang';
				break;
			case 'toolbox':
				target = 'p-tb';
				break;
			case 'navigation':
				target = 'p-navigation';
				break;
			default:
				target = 'p-' + section;
				break;
		}

		if ( action == 'add' ) {
			var node = document.getElementById( target )
							   .getElementsByTagName( 'div' )[0]
							   .getElementsByTagName( 'ul' )[0];

			var aNode = document.createElement( 'a' );
			var liNode = document.createElement( 'li' );

			aNode.appendChild( document.createTextNode( name ) );
			aNode.setAttribute( 'href', link );
			liNode.appendChild( aNode );
			liNode.className = 'plainlinks';
			node.appendChild( liNode );
		}

		if ( action == 'remove' ) {
			var list = document.getElementById( target )
							   .getElementsByTagName( 'div' )[0]
							   .getElementsByTagName( 'ul' )[0];

			var listelements = list.getElementsByTagName( 'li' );

			for ( var i = 0; i < listelements.length; i++ ) {
				if (
					listelements[i].getElementsByTagName( 'a' )[0].innerHTML == name ||
					listelements[i].getElementsByTagName( 'a' )[0].href == link
				)
				{
					list.removeChild( listelements[i] );
				}
			}
		}

	} catch( e ) {
		// let's just ignore what's happened
		return;
	}
}

jQuery( document ).ready( function( $ ) {
	// adds [[Special:Html2Wiki]] to toolbox
	ModifySidebar( 'add', 'toolbox', 'Import HTML', '/wiki/Special:Html2Wiki' );
});
 
Old 07-29-2018, 12:26 PM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by MarkR1717 View Post
I've copied the following into the special MediaWiki page, but I think it must need adapting for the Bitnami installation. Is there anything obvious that I need to change?
bitnami.

You should proceed to test for, and install if not found the html2wiki package.
Proceed if it is not installed...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Script that e-mails errors only in the last 500 lines ytd Linux - Newbie 8 05-17-2018 11:27 AM
Clear all lines in a csf deny file that contains text: Added by Fail2Ban bmxakias Linux - Newbie 17 08-25-2017 09:58 AM
print a text file with long lines and line number added powah Linux - General 2 05-26-2006 02:02 PM
IBM Contributes 500,000 Lines Of Code To Apache jamaso General 2 08-04-2004 11:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration