System stuff

From Innovation
Jump to: navigation, search
The version number is 1.13 as one can confirm here: Special:Version

There are several extensions useful for building a scientific MediaWiki installation. Here are some of them and the things a system administrator must do to turn them on.

Early configuration on Dreamhost

  • There's a lot of documentation about MediaWiki-on-Dreamhost in pages linked from here.
  • from ./config directory, mv LocalSettings.php .. then rm *
  • then cd .. and rmdir config
  • and chmod 400 LocalSettings.php and perhaps make a backup directory for LocalSettings.php

Security steps

1. Back up LocalSettings.php periodically

2. To lock out all who don't have passwords, add this near the end of LocalSettings.php:

## disallow edits by unregistered users and disallow the creation of accounts
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['read'] = false;          ## or set to true to let outsiders read it
#### $wgGroupPermissions['work']['read'] = true;   ## necessary?
$wgShowIPinHeader = false;                         ## I don't know the issues with this one

3. Don't leave the config file to be edited by people who aren't logged in to the shell account:

  • chmod 400 LocalSettings.php

If and when one needs to edit it, flip that back temporarily:

  • chmod 755 LocalSettings.php

4. Delete the ./config directory, or chmod 000 config.

TeX Math extension

To turn on the math tag, here are two schemes:

Scheme 1 requires more system support but works faster and produces higher quality images
  • from the shell go to ./math and run make. An OCaml compiler is required.
  • flip the toggle $wgUseTeX to true in LocalSettings.php
  • create an extensions/Math directory and unpack this file into it, roughly like this:
  • tar -xzf ~/math_tries/math.tar.gz -C ~/econterms.net/innovation/extensions
  • texvc doesn't build on DreamHost nowadays at least with the earlier OCaml statement, but a serviceable one is in math_tries
Scheme 2 doesn't require OCaml or texvc
  • get SimpleMathJax extension ; see my directory math_tries for a recent edition
  • create a directory ../extensions/SimpleMathJax and put the two .php files there
  • add these two lines to LocalSettings.php:
 require_once "$IP/extensions/SimpleMathJax/SimpleMathJax.php";
 $wgSimpleMathJaxSize = 120; 
  • that's it! the second line is optional but equations are maybe too small without it. the default size is 100

Example: [math]R_a=\frac{u(c)}{c^2}[/math]

Endless research further

Footnotes

Instructions are http://www.mediawiki.org/wiki/Extension:Cite/Cite.php

Footnotes test case

Note to Peter: Footnotes works as intended. I tested it out on the London A-Z page.

According to scientists, the Sun is pretty big.[1] The Moon, however, is not so big.[2]

Footnotes

  1. E. Miller, The Sun, (New York: Academic Press, 2005), 23-5.
  2. R. Smith, "Size of the Moon", Scientific American, 46 (April 1978): 44-6.

User merge and delete

Instructions are http://www.mediawiki.org/wiki/Extension:User_Merge_and_Delete

get the source code from their subversion installation by typing this from your site's ./extensions directory:

add these lines to LocalSettings.php, near the end but probably before the very last line:

  • require_once( $IP.'/extensions/UserMerge/UserMerge.php' );
  • $wgGroupPermissions['bureaucrat']['usermerge'] = true;
  • $wgUserMergeUnmergeable = array( 'sysop', 'bureaucrat' ); ## comment this out if nec to merge a bureaucrat user id

Later instructions suggest to use a version from git but avoid this for now. When run, going to Special Pages gives an error associated with the nonexistence of a constant __DIR__ and when I patched my way around this, it crashed with something harder to diagnose. The version of UserMerge in svn seems to work fine.

Other bibligraphic extensions

http://www.mediawiki.org/wiki/Extension:Bibliography

http://www.plaschg.net/bibwiki/

http://openwetware.org/wiki/Wikiomics:Biblio

Graphics

Gard used the program inkscape to make the green logo at the upper left.

Uploads of images and other files

To enable them, first make the upload directory (default images) writable by the web server (chmod 777 or allow the Apache user to write to it.) then set $wgEnableUploads to true in LocalSettings.php (i.e. "$wgEnableUploads = true;"). See http://www.mediawiki.org/wiki/Manual:Configuring_file_uploads for more information.

R

Not yet implemented, but there is an R extension for Mediawiki.

floating boxes in list of presentations

I'd like the "publication" box to stay to the left of the yearboxright template if both are on the same line. Haven't been able to get it to happen, but here are some resources to experiment with:

On any Cargo wiki, add a Background jobs query page or link

USDG Wiki

  • This is a new wiki with a "US government data glossary", content from the referata/eedi wiki
  • And gov-wide searchable lists and information like career categories ("job series") and org chart info
  • Aug 1 2020: Peter supposed to create this basic wiki for LTA to do an XML upload into
But Dreamhost doesn't seem to have its one-click install for mediawiki so this will be more work and require more care than expected. Peter is swamped so this creates a delay.
  • Install extensions Data Transfer, Page Forms, and Cargo, in just a few easy steps most of the time. Documentation at: Extension:Cargo/Common problems
wfLoadExtension( 'PageForms' );
wfLoadExtension( 'Cargo' );
wfLoadExtension( 'DataTransfer' );
  • Then from the maintenance directory run php update.php (otherwise a bad-looking 'database error' shows up on pages with Cargo templates).
  • Usually that's IT. Then one must rebuild any cargo tables.
To show debugging info when the wiki has a technical problem add these diagnostic instructions anywhere in the LocalSettings file
$wgShowExceptionDetails = true;  # as advised at Extension:Cargo/Common problems
$wgShowSQLErrors = true;  # as advised at Extension:Cargo/Common problems

Sometimes templates are not recognized on the wiki pages right after an import. We haven't figured out what to do about that, but it resolved after "php update.php" above.

one should remember to hide or delete the installation subdirectory mw-config/.

LTA figured out how to import XML dumps.

.htaccess

  • Tinker with this file to get the short URLs and to secure read/write on the files of the wiki.
  • We have found that the .htaccess file in the /images directory works with permissions 644.

BITplan wiki farm guidance

Query replies

  • $wgCargoDefaultQueryLimit - the number of results to show for #cargo_query if no limit is set (default is 100)
  • $wgCargoMaxQueryLimit - the maximum allowed number of results for #cargo_query (default is 5000)

Those are documented here.