Difference between revisions of "Wikispooks:Site Backup"

From Wikispooks
Jump to navigation Jump to search
(Expand troubleshooting section)
Line 105: Line 105:
 
:Put a <code>#</code> character at the beginning of this and the following 2 lines to disable the Piwik stats extension.
 
:Put a <code>#</code> character at the beginning of this and the following 2 lines to disable the Piwik stats extension.
  
==Errors==
+
==Troubleshooting==
 
If things don't go smoothly, the first thing you should do is go to the end of the file where you will see the following lines:  
 
If things don't go smoothly, the first thing you should do is go to the end of the file where you will see the following lines:  
 
::<code>#$wgShowExceptionDetails = true;</code>
 
::<code>#$wgShowExceptionDetails = true;</code>
Line 115: Line 115:
 
::<code>$wgMainCacheType = CACHE_ACCEL;</code>
 
::<code>$wgMainCacheType = CACHE_ACCEL;</code>
 
::<code>#$wgMainCacheType = CACHE_DB;</code>
 
::<code>#$wgMainCacheType = CACHE_DB;</code>
Try commenting the first of these out, and uncommenting the second. If this doesn't work, the easiest way to get it running is to do without a cache and comment them both out.
+
Try commenting the first of these out, and uncommenting the second. If this doesn't work, the easiest way to get it running is to comment them both out. This disables the cache, which will impact performance, but that problem can be tackled later if need arises.
 +
 
 +
===<small>{{t|Lua error: Internal error: The interpreter exited with status 2}}</small>===
 +
If some pages are not displaying properly, but instead giving the above (clickable) red error message, you could try raising the amount of memory available by inserting the following line:<ref>https://www.mediawiki.org/wiki/Extension:Scribunto#Lua_error:_Internal_error:_The_interpreter_exited_with_status_2</ref>
 +
::<code>$wgMaxShellMemory = 409600; # in KB</code>
 +
 
 +
===<small>{{t|Lua error: Internal error: Error reading from pipe.}}</small>===
 +
This error message can also occur.<ref>https://www.mediawiki.org/wiki/Topic:Sftr334fvttqt3qm</ref>
  
 
==Running A Live Site Mirror==
 
==Running A Live Site Mirror==

Revision as of 08:50, 25 September 2015

SiteBackup.png

Even if you are a casual reader and not a contributor to the wikispooks project, you are encouraged to download and keep a backup copy of the site (~3Gb) in case it goes offline for any reason. The site is open licenced so you are free to publish the content elsewhere, either as an exact mirror or as part of another website. The more people around the world who keep a backup, the better.

Content of the 'Backups' directory

  • Available files are listed in the Backup files list box on the right. The main site backup files are in the form site-YYYY-MM-DD.zip indicating the date taken and there will usually be at least 4 generations of them. The file site-latest.zip links to the most up-to-date of the site backups.
  • wikileaks.zip contains Bit-Torrent files for the entire wikileaks site between its launch in 2006 and February 2010.
  • From time-to-time there may be other Wikispooks project-related files made available for download.

Notes

The following items are not included in the main site backup files:

  • The 'Anon Uploads Form'
  • 'Piwik stats'
  • Wikileaks 'Torrents' - Separate download here

Setting up and running a Copy Of The Site

Gnome-system-software-installer.svg System requirements

The backup file contains everything you need to run a mirror of this site on a suitably configured web server; Separate installation of Mediawiki is NOT required.

The web server currently used by Wikispooks is Apache running on Centos 7 Linux. These instructions assume Apache, though NginX, IIS and other web servers may work just as well. The instructions have been slightly modified to try to suit other Linux distos as well.

N.B. WampServer or Xampp provide all the Apache web-server software required (except for Xcache) to run the Wikispooks site locally on either a Linux or Windows machine.. If you do not install either Xcache or APC separately, then you must change $wgMainCacheType = CACHE_ACCEL; to $wgMainCacheType = CACHE_DB; in /w/LocalSettings.php.

Overview

Set up your web server; create a blank MySQL database; download site-latest.zip to your server root and unpack it; import file path-to-server-root/backups/ws.sql into your blank MySQL database; edit path-to-server-root/w/LocalSettings.php and enter your database name and user credentials; navigate to your web-server root from your web browser to browse your local copy of Wikispooks.

Web server directives

  • Pretty urls are required for full site functionality. Add the following to the bottom of your server or virtual server config file:
Alias /wiki path-to-server-root/w/index.php.
Apache config files are usually located at /etc/httpd/.
  • for correct display of the Site backups list box. Add the following to your server config file:

<Directory "path-to-server-root/backups">
     Options +Indexes
  IndexIgnore .. header.html
     HeaderName header.html
     IndexOptions FancyIndexing SuppressDescription SuppressLastModified
</Directory>

  • Linux only: you may have to tweek a few directory permission for the site to run smoothly. In particular the following require user (Usually Apache) write permissions:
path-to-server-root/w/cache/
path-to-server-root/w/images/

The MySQL database

The database must be created manually (see MySQL manual).
Database name wikispooks and user WSuser are assumed in the downloaded LocalSettings.php.
You can use different names but these must be entered into LocalSettings.php - see below.

The backup file

Place your downloaded latest-site.zip file in the server root directory and and unzip it. This will create a directory structure containing all application and associated site files. It will also place the database content file ws.sql in the path-to-server-root/backups/ directory.

Import the Wikispooks content into your database

Import path-to-server-root/backups/ws.sql into the new database.

N.B. The file is too large for a default configuration of phpMyAdmin to handle. Try a MySQL command for this, e.g.

$ mysql -u username --password=password --host=localhost data-base-name < ws.sql

LocalSettings.php

The file is located at path-to-server-root/w/LocalSettings.php.

Database credentials

Locate the following code block:

## Database settings
include("../../cgi-bin/WsDbInfo.php");
#$wgDBtype = "mysql";
#$wgDBserver = "localhost";
#$wgDBname = "wikispooks";
#$wgDBuser = "";
#$wgDBpassword = "";
#$wgDBadminuser = "";
#$wgDBadminpassword = "";

Delete the line beginning: include. Delete all # characters and enter your new database credentials in the corresponding lines.

Host name and miscellaneous settings

Search and replace/edit where your-host can be either the host name or IP address of your web server:

Replace with: $wgServer = "http://your-host";
Replace with: $wgAllowExternalImagesFrom = array('http://your-host','http://127.0.0.1');
  • search for: enableSemantics('wikispooks.com');
Replace with: enableSemantics('your-host');
  • search for: require_once ('extensions/piwik/Piwik.php');.
Put a # character at the beginning of this and the following 2 lines to disable the Piwik stats extension.

Troubleshooting

If things don't go smoothly, the first thing you should do is go to the end of the file where you will see the following lines:

#$wgShowExceptionDetails = true;
#$wgShowSQLErrors = 1;

Remove the leading # character to get some diagnostic output and help you debug. It's recommended to take comment lines out again once things are working OK.

CACHE_ACCEL requested but no suitable object cache is present.

This means that the ACCEL cache is not available on your webserver. The first thing to try is to find the following lines:

$wgMainCacheType = CACHE_ACCEL;
#$wgMainCacheType = CACHE_DB;

Try commenting the first of these out, and uncommenting the second. If this doesn't work, the easiest way to get it running is to comment them both out. This disables the cache, which will impact performance, but that problem can be tackled later if need arises.

Lua error: Internal error: The interpreter exited with status 2

If some pages are not displaying properly, but instead giving the above (clickable) red error message, you could try raising the amount of memory available by inserting the following line:[1]

$wgMaxShellMemory = 409600; # in KB

Lua error: Internal error: Error reading from pipe.

This error message can also occur.[2]

Running A Live Site Mirror

If you have interest and resources to set up a realtime site mirror on your server, you are encouraged to do so. We may also be able to provide you with some technical assistance if needed. Requests for help setting up realtime mirrors should be addressed to admin[at]wikispooks.org and encrypted with this key.

Known Issues

  • xdebug is a php debugging tool which produces output similar (but considerably more verbose) to $wgShowExceptionDetails above. It is installed and enabled by default in both Wamp server and Xampp. Wikispooks admins have found it useful in tracking down common installation problems but that a default setting results in ungraceful out of memory failures on some of the more common installation issues, rendering it useless in tracking them down. Either disable it by commenting out the [xdebug] block in php.ini or increase max_nesting_level from the default 100 with the following if you wish to use it: xdebug.max_nesting_level=300
  • Many internal wikilinks are of the form [[Wikispooks:...]], so will not work unless your project is identically named. This can be tackled with a global search and replace (to "[[Project:...]]"). This issue is being gradually addressed, for easier portability.
  • Suggestions, Queries etc? - Either Email the admin (non-WikiSpooks members) or use this discussion page (WikiSpooks members)
Wikispooks logo.png Policy.png Wikispooks to do.png Tools2.png
Wikispooks
Technical
SMW.png Help.png