Difference between revisions of "Wikispooks:Site Backup"
m (first draft complete - more info on required php + other apps to be collated and entered) |
|||
Line 1: | Line 1: | ||
− | |||
{{HelpSection|image=SiteBackup.png}} | {{HelpSection|image=SiteBackup.png}} | ||
<div style="font-size:86%; text-align:center; border:1px solid #aaaaaa; background-color:#f9f9f9; color:black; margin-left:1em; padding:0em; float:right; clear:right;"> | <div style="font-size:86%; text-align:center; border:1px solid #aaaaaa; background-color:#f9f9f9; color:black; margin-left:1em; padding:0em; float:right; clear:right;"> | ||
Line 26: | Line 25: | ||
Set up your web server; create a blank MySQL database; download {{BULink|site-latest.zip}} to your server root and unpack it; import file <code>''path-to-server-root''/backups/ws.sql</code> into your blank MySQL database; edit <code>''path-to-server-root''/w/LocalSettings.php</code> 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. | Set up your web server; create a blank MySQL database; download {{BULink|site-latest.zip}} to your server root and unpack it; import file <code>''path-to-server-root''/backups/ws.sql</code> into your blank MySQL database; edit <code>''path-to-server-root''/w/LocalSettings.php</code> 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=== | |
*[http://www.mediawiki.org/wiki/Manual:Short_URL Pretty urls] are required for full site functionality. Add the following to the bottom of your server or virtual server config file:<br/> | *[http://www.mediawiki.org/wiki/Manual:Short_URL Pretty urls] are required for full site functionality. Add the following to the bottom of your server or virtual server config file:<br/> | ||
:<code>Alias /wiki ''path-to-server root''/w/index.php</code>.<br/> | :<code>Alias /wiki ''path-to-server root''/w/index.php</code>.<br/> | ||
Line 41: | Line 40: | ||
:<code>''path-to-server-root''/w/images/</code> | :<code>''path-to-server-root''/w/images/</code> | ||
+ | ===The MySQL database=== | ||
+ | The database must be created manually (see [http://www.mediawiki.org/wiki/Manual:MySQL MySQL manual].<br/> | ||
+ | Database name <code>wikispooks</code> and user <code>WSuser</code> are assumed in the downloaded <code>LocalSettings.php</code>.<br/> | ||
+ | You can use different names but these must be entered into <Code>LocalSettings.php</code> - see below. | ||
− | === | + | ===LocalSettings.php=== |
− | + | The file is located at <code>''path-to-server-root''/w/LocalSettings.php</code>. It contains the following code:<poem><code> | |
+ | :## Database settings | ||
+ | :include("../../cgi-bin/WsDbInfo.php"); | ||
+ | :#$wgDBtype = "mysql"; | ||
+ | :#$wgDBserver = "localhost"; | ||
+ | :#$wgDBname = "wikispooks"; | ||
+ | :#$wgDBuser = ""; | ||
+ | :#$wgDBpassword = ""; | ||
+ | :#$wgDBadminuser = ""; | ||
+ | :#$wgDBadminpassword = ""; | ||
+ | </code></poem> | ||
+ | Delete the line beginning: <code>include</code>. Delete all <code>#</code> charcters and enter your new database credentials in the corresponding lines. | ||
− | + | ===Import the Wikispooks content into your database=== | |
Import <code>''path-to-server-root/backups/''ws.sql</code> into the new database. | Import <code>''path-to-server-root/backups/''ws.sql</code> into the new database. | ||
Line 56: | Line 70: | ||
::<code>$wgShowSQLErrors = 1;</code> | ::<code>$wgShowSQLErrors = 1;</code> | ||
It's recommended to take these lines out once things are working OK. | It's recommended to take these lines out once things are working OK. | ||
− | |||
− | |||
− | |||
==Running A Live Site Mirror== | ==Running A Live Site Mirror== | ||
Line 64: | Line 75: | ||
===Known Issues=== | ===Known Issues=== | ||
− | |||
− | |||
* Some of the in-text links (especially on 'Category:IFrame' pages) may take you to the master Wikispooks site. This is because urls which ought to be coded as relative, have in fact been entered as absolute urls. It is easy to manually change any such URLs in your browser address-bar at run time (simply replace 'https://wikispooks.com/' with 'localhost/your_root_dir_name/'. This issue will be addressed at source as and when. | * Some of the in-text links (especially on 'Category:IFrame' pages) may take you to the master Wikispooks site. This is because urls which ought to be coded as relative, have in fact been entered as absolute urls. It is easy to manually change any such URLs in your browser address-bar at run time (simply replace 'https://wikispooks.com/' with 'localhost/your_root_dir_name/'. This issue will be addressed at source as and when. | ||
Revision as of 11:22, 4 June 2015
![SiteBackup.png](/w/images/9/9f/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 (~2.9Gb) in case it goes offline for any reason. The site is open licenced so you are free to copy it's content and publish it elsewhere, either as an exact mirror or as part of another website. The more people around the world who keep a backup, the better the odds that the site content will not be lost.
Contents
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 filesite-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 it's original launch in 2006 to 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
A single main site backup file contains everything needed to run a copy or mirror of the Wikispooks site on a suitably configured web server. Apache running on Linux is the web server used by Wikispooks and assumed in these instructions although NginX, IIS and other web servers can be configured to run Mediawiki.
N.B. Either WampServer or Xampp provides all the Apache web-server software need to run the Wikispooks site locally on either a Linux or Windows machine.
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>
- 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.
LocalSettings.php
The file is located at path-to-server-root/w/LocalSettings.php
. It contains the following code:
## Database settings
include("../../cgi-bin/WsDbInfo.php");
#$wgDBtype = "mysql";
#$wgDBserver = "localhost";
#$wgDBname = "wikispooks";
#$wgDBuser = "";
#$wgDBpassword = "";
#$wgDBadminuser = "";
#$wgDBadminpassword = "";
Delete the line beginning: include
. Delete all #
charcters and enter your new database credentials in the corresponding lines.
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 -p password -h localhost data-base-name < ws.sql
Error reporting
If things don't go smoothly, adding the following lines to LocalSettings.php will give you some diagnostic output:
$wgShowExceptionDetails = true;
$wgShowSQLErrors = 1;
It's recommended to take these lines out once things are working OK.
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
- Some of the in-text links (especially on 'Category:IFrame' pages) may take you to the master Wikispooks site. This is because urls which ought to be coded as relative, have in fact been entered as absolute urls. It is easy to manually change any such URLs in your browser address-bar at run time (simply replace 'https://wikispooks.com/' with 'localhost/your_root_dir_name/'. This issue will be addressed at source as and when.
- Suggestions, Queries etc? - Either Email the admin (non-WikiSpooks members) or use this discussion page (WikiSpooks members)
| ||||||
|