How to configure a replica of this Wiki/es

Zur Navigation springen Zur Suche springen

<languages />


Porque hacer una replica? Porque dejar que otros hagan replicas? Porque ayudar a copiar y distribuir copias de este proyecto?

La respuesta corta: Para sobrevivir!

La mas larga: Para sobrevivir!

Instalar Mediawiki[Bearbeiten]

Una mini guía resumida para instalar mediawiki en un sistema basado en debian.<ref></ref>

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install apache2 mysql-server php5 php5-mysql libapache2-mod-php5
$ sudo apt-get install php-apc php5-intl imagemagick phpmyadmin vsftpd php5-cli

A continuación se descarga y se hace la primera configuración de mediawiki
Cambia x por la versión por defecto de Mediawiki.

$ cd Downloads
$ wget
$ tar -xvzf /pathtofile/mediawiki-*.tar.gz
$ sudo mkdir /var/lib/mediawiki
$ sudo mv mediawiki-*/* /var/lib/mediawiki
$ cd /var/www/html
$ sudo ln -s /var/lib/mediawiki mediawiki

Opcionalmente podemos configurar otras variables

$ sudo nano /etc/php5/apache2/php.ini
upload_max_filesize = 2M
memory_limit = 128M

El archivo de configuración usado por I2PWiki

# This file was automatically generated by the MediaWiki 1.25.2
# installer. If you make manual changes, please keep track in case you
# need to recreate them later.
# See includes/DefaultSettings.php for all configurable settings
# and their default values, but don't forget to make changes in _this_
# file, not there.
# Further documentation for configuration settings may be found at:
ini_set("log_errors", 1);
ini_set("error_log", "/tmp/wiki-error.log");
# Protect against web entry

if ( !defined( 'MEDIAWIKI' ) ) {

# Enables use of WikiEditor by default but still allows users to disable it in preferences
$wgDefaultUserOptions['usebetatoolbar'] = 1;

# Enables link and table wizards by default but still allows users to disable them in preferences
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;

# Displays the Preview and Changes tabs
$wgDefaultUserOptions['wikieditor-preview'] = 1;

# Displays the Publish and Cancel buttons on the top right side
$wgDefaultUserOptions['wikieditor-publish'] = 1;

$wgShowIPinHeader = false;
$wgPutIPinRC = false;
## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;

$wgSitename = "I2PWiki";
## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
## For more information on customizing the URLs
## (like /w/index.php/Page_title to /wiki/Page_title) please see:
$wgScriptPath = "";
$wgScriptExtension = ".php";
//$wgArticlePath      = "/wiki/$1";
$wgUsePathInfo      = false;

//$wgFavicon = "$wgScriptPath/favicon.ico";

$actions = array( 'edit', 'watch', 'unwatch', 'delete','revert', 'rollback',
  'protect', 'unprotect', 'markpatrolled', 'render', 'submit', 'history', 'purge', 'info',
  'page', 'translate' );

/*foreach ( $actions as $action ) { 
  $wgActionPaths[$action] = "/wiki/$action/$1";

## The protocol and server name to use in fully-qualified URLs
$wgServer = "http://i2pwiki.i2p";

## The relative URL path to the skins directory
$wgStylePath = "$wgScriptPath/skins";
$wgResourceBasePath = $wgScriptPath;

## The relative URL path to the logo.  Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
$wgLogo = "$wgResourceBasePath/resources/assets/logo_wiki.png";

## UPO means: this is also a user preference option

$wgEnableEmail = false;
$wgEnableUserEmail = false; # UPO

$wgEmergencyContact = "apache@";
$wgPasswordSender = "apache@";

$wgEnotifUserTalk = false; # UPO
$wgEnotifWatchlist = false; # UPO
$wgEmailAuthentication = true;

## Database settings
$wgDBtype = "mysql";
$wgDBserver = "localhost";
$wgDBname = "yourDBname";
$wgDBuser = "yourDBuser";
$wgDBpassword = "yourDBpassword";

# MySQL specific settings
$wgDBprefix = "wik_";

# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=utf8";

# Experimental charset support for MySQL 5.0.
$wgDBmysql5 = false;

## Shared memory settings
$wgMemCachedServers = array( '' );

## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads = true;
#$wgUseImageMagick = true;
#$wgImageMagickConvertCommand = "/usr/bin/convert";

# InstantCommons allows wiki to use images from
$wgUseInstantCommons = false;

## If you use ImageMagick (or any other shell command) on a
## Linux server, this will need to be set to the name of an
## available UTF-8 locale
$wgShellLocale = "en_US.utf8";

## If you want to use image uploads under safe mode,
## create the directories images/archive, images/thumb and
## images/temp, and make them all writable. Then uncomment
## this, if it's not already uncommented:
#$wgHashedUploadDirectory = false;

## Set $wgCacheDirectory to a writable directory on the web server
## to make your wiki go slightly faster. The directory should not
## be publically accessible from the web.
#$wgCacheDirectory = "$IP/cache";

# Site language code, should be one of the list in ./languages/Names.php
$wgLanguageCode = "en";


# Site upgrade key. Must be set to a string (default provided) to turn on the
# web installer while LocalSettings.php is in place
$wgUpgradeKey = "xxxxxxxxxxxxxxxx";

## For attaching licensing metadata to pages, and displaying an
## appropriate copyright notice / icon. GNU Free Documentation
## License and Creative Commons licenses are supported so far.
$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl = "";
$wgRightsText = "Creative Commons Zero (Public Domain)";
$wgRightsIcon = "$wgResourceBasePath/resources/assets/licenses/cc-0.png";

# Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "/usr/bin/diff3";

## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'vector', 'monobook':
$wgDefaultSkin = "vector";

# Enabled skins.
# The following skins were automatically enabled:
wfLoadSkin( 'CologneBlue' );
wfLoadSkin( 'Modern' );
wfLoadSkin( 'MonoBook' );
wfLoadSkin( 'Vector' );

# End of automatically generated settings.
# Add more configuration options below.

 * Disable links to talk pages of anonymous users (IPs) in listings on special
 * pages like page history, Special:Recentchanges, etc.
## $wgDisableAnonTalk = true;
$EXT = "$IP/extensions";

if (!$wgCommandLineMode) {
wfLoadExtension( 'WikiEditor' );
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
$wgNamespacesWithSubpages[NS_MAIN] = true;
require_once "$EXT/Html2Wiki/Html2Wiki.php";
//require_once "$EXT/Multilang/Multilang.php";
//require_once "$EXT/Polyglot/Polyglot.php";
/*$wgPolyglotLanguages = array('en', 'de', 'fr');
require_once "$EXT/LanguageSelector/LanguageSelector.php";
$wgLanguageSelectorLanguages=array('en', 'de', 'fr');
$wgLanguageSelectorDetectLanguage = LANGUAGE_SELECTOR_USE_CONTENT_LANG;*/
//$wgLanguageSelectorLocation = LANGUAGE_SELECTOR_MANUAL;
//$wfPolyglotFollowRedirects = true;

$wgExtensionAssetsPath = "{$wgScriptPath}/extensions";
//require_once "$EXT/Babel/Babel.php";

require_once "$EXT/cldr/cldr.php";

/*wfLoadExtension( 'CleanChanges' );
$wgCCUserFilter = false;
$wgCCTrailerFilter = true;*/
$wgDefaultUserOptions['usenewrc'] = 1;

require_once "$EXT/LocalisationUpdate/LocalisationUpdate.php";
$wgLocalisationUpdateDirectory = "$IP/cache";

require_once "$EXT/Translate/Translate.php";
$wgGroupPermissions['user']['translate'] = true;
$wgGroupPermissions['user']['translate-messagereview'] = true;
$wgGroupPermissions['user']['translate-groupreview'] = true;
$wgGroupPermissions['user']['translate-import'] = true;
$wgGroupPermissions['sysop']['pagetranslation'] = true;
$wgGroupPermissions['sysop']['translate-manage'] = true;
$wgTranslateDocumentationLanguageCode = 'qqq';
$wgExtraLanguageNames['qqq'] = 'Message documentation'; # No linguistic content. Used for documenting messages
require_once "$EXT/UniversalLanguageSelector/UniversalLanguageSelector.php";
$wgULSGeoService = false;
//$wgShowExceptionDetails = true;  //enable for error details
//require_once "$EXT/Random/Random.php";
require_once "$EXT/RandomInclude/RandomInclude.php";
$wgRandomInclude['pattern'] = '*';    // default pattern to use as boundary between items (use '----' to get previous behaviour)
$wgRandomInclude['separator'] = '';   // default separator rendered between items
$wgRandomInclude['count'] = 1;        // default number of items
$wgRandomInclude['limit'] = 20;       // default limit on runaway loop
$wgRandomInclude['seed'] = 'none';      // default seed value
$wgRandomInclude['hash'] = 'none';      // default hash value
$wgRandomInclude['period'] = 'none';    // default period as minute, hour, day, week or seconds (integer)
$wgRandomInclude['mode'] = 'none';         // default mode is none or ordered depending on count
$wgRandomInclude['cache'] = 'disable';// default cache strategy, set to 'disable' to do no caching
$wgRandomInclude['format'] = 'none';  // default format string, set to 'none' to do no formatting of output
wfLoadExtension( 'HitCounters' );
require_once "$EXT/ConfirmEdit/ConfirmEdit.php";
wfLoadExtension( 'ConfirmEdit/FancyCaptcha' );
$wgCaptchaClass = 'FancyCaptcha';
$wgCaptchaDirectory = "/path/to/captcha";
$wgCaptchaDirectoryLevels = 0; // Set this to a value greater than zero to break the images into subdirectories
$wgCaptchaSecret = "xxxxxxxxxx"; // same value you used in --key option in
$wgCaptchaTriggers['edit']          = true; 
$wgCaptchaTriggers['create']        = true; 
$wgCaptchaTriggers['addurl']        = true; 
$wgCaptchaTriggers['createaccount'] = true;
$wgCaptchaTriggers['badlogin']      = true;
wfLoadExtension( 'Cite' );
wfLoadExtension( 'ParserFunctions' );

Reiniciamos el servidor web

$ sudo apache2ctl restart

Y deberíamos estar en posición de iniciar mediawiki y hacer sus primeras configuraciones.


Después de terminar las configuraciones básicas podemos movemos el archivo con estas.

$ sudo mv /var/lib/mediawiki/config/LocalSettings.php /var/lib/mediawiki

Hacer la replica[Bearbeiten]

Actualmente estamos analizando los caminos para hacer replicas de lawiki sin poner en riesgo ni la seguridad del servidor central, ni la de los eventuales espejos.

Hemos descubierto los siguientes métodos:

Copia a mano[Bearbeiten]

OK, es realmente lento y de mucho trabajo tener que abrir cada articulo y copiar uno a uno a la nueva wiki.


1. Escogemos los artículos desde Especial:Todas

2. Vamos a la pagina Especial:Exportar

3. Rellenamos con el nombre del articulo a descargar y automáticamente al hacer click sobre el botón exportar se obtendrá un archivo XML

4. Importar fácilmente en tu propia wiki desde

Y solo necesitaras escoger el/los archivo(s) descargado(s) desde la carpeta de descargas y subirlo. Después de algunos segundos ya debería poder estar disponible localmente.

I2PWiki XML DUMP[Bearbeiten]

Dump script help:

Cron job made every 6 hours:
php /path/to/the/script/dumpBackup.php --current --include-files --uploads --output=gzip:/path/to/xml_dump/i2pwiki_current.xml.gz
php /path/to/the/script/dumpBackup.php --full --include-files --uploads --output=gzip:/path/to/xml_dump/i2pwiki_full.xml.gz

Dumps download page:

Para importar/recuperar desde un Mediawiki funcionando:


Tahoe (sobre I2P) tiene la ventaja de ser un servicio distribuido de almacenamiento disponible universalmente.

Lawiki2p comenzara a subir regularmente un archivo XML con todos los artículos de la wiki, que podrás importar tal cual se describió en el punto anterior.

La única condición es que se debe tener acceso a tahoe vía I2P.

El procedimiento recomendado es el que se describe a continuación.

2. De esta manera se puede acceder a


3. En ese directorio se encontrara junto al archivo i2pwiki_current.xml.gz or i2pwiki_full.xml.gz los ultimos 30 subidos

4. Se puede descargar manualmente o en su defecto, usar el siguiente comando junto a crontab para descargarlo

$ tahoe cp URI:DIR-RO..../i2pwiki_current.xml.gz ./

Véase También[Bearbeiten]


<references />