Mediawiki Update Version 1.23.10 vers 1.24.0
L'installation initiale de MediaWiki a été faite à l'aide de la commande aptitude
. Depuis la version 1.18.1, les mises à jour sont réalisées manuellement et ce principe est repris pour la version 1.24.0. L'objectif est de mettre en place un lien /var/lib/mediawiki
pointant vers la version installée. De plus, les plugins et les contenus sont déportés dans un répertoire /var/datas/mediawiki
Sommaire
Votre avis
Nobody voted on this yet
|
|
Installation nouvelle version
L'objectif de cette installation est de maîtriser tous les fichiers et de faciliter les prochaines mises à jour. Les répertoires mis en place dans cet organisation sont:
-
/var/datas/mediawiki
: Contient les extensions installées et le répertoire de téléversement. -
/usr/share/mediawiki-1.24.0
: Installation de la version. -
/var/lib/mediawiki
: Lien vers la version à prendre en compte. -
/etc/mediawiki
: Contient les configurations.
Mise en place instance
Le fichier mediawiki-1.24.0.tar.gz
est téléchargé, depuis http://www.mediawiki.org/wiki/Download et installé:
#sudo wget -P /usr/share http://releases.wikimedia.org/mediawiki/1.24/mediawiki-1.24.0.tar.gz #sudo tar -C /usr/share -xzvf /usr/share/mediawiki-1.24.0.tar.gz #sudo rm /usr/share/mediawiki-1.24.0.tar.gz #sudo chown -R www-data:www-data /usr/share/mediawiki-1.24.0
Il référencer le fichier LocalSettings.php
depuis /etc/mediawiki
, dans la nouvelle instance.
#sudo ln -s /etc/mediawiki/LocalSettings.php /usr/share/mediawiki-1.24.0/LocalSettings.php #sudo chown -h www-data:www-data /usr/share/mediawiki-1.24.0/LocalSettings.php
La variable MW_INSTALL_PATH
avait été modifiée, lors de l'installation de 1.18.1, afin de pointer sur l'emplacement /var/lib/mediawiki
. L'utilisation du lien permet donc de ne pas avoir à modifier cette variable.
Les extensions et les contenus uploadés ont été déplacés, et il est nécessaire de les référencer dans la nouvelle instance. Concernant les extensions, cela consiste en la création de lien dans le répertoire extensions
vers /var/datas/mediawiki/extensions
, l'exemple dépend des plugins installés.
#sudo ln -s /var/datas/mediawiki/extensions/Piwik /usr/share/mediawiki-1.24.0/extensions/Piwik #sudo ln -s /var/datas/mediawiki/extensions/skins /usr/share/mediawiki-1.24.0/extensions/skins #sudo ln -s /var/datas/mediawiki/extensions/TwitterFBLike /usr/share/mediawiki-1.24.0/extensions/TwitterFBLike #sudo ln -s /var/datas/mediawiki/extensions/W4G\ Rating\ Bar /usr/share/mediawiki-1.24.0/extensions/W4G\ Rating\ Bar #sudo chown -h www-data:www-data /usr/share/mediawiki-1.24.0/extensions/Piwik #sudo chown -h www-data:www-data /usr/share/mediawiki-1.24.0/extensions/skins #sudo chown -h www-data:www-data /usr/share/mediawiki-1.24.0/extensions/TwitterFBLike #sudo chown -h www-data:www-data /usr/share/mediawiki-1.24.0/extensions/W4G\ Rating\ Bar
Ce qui donne le contenu suivant dans /usr/share/mediawiki-1.24.0/extensions
total 72 drwxr-xr-x 17 www-data www-data 4096 août 12 23:38 ./ drwxr-xr-x 13 www-data www-data 4096 août 12 23:37 ../ drwxr-xr-x 4 www-data www-data 4096 nov. 27 2014 Cite/ drwxr-xr-x 5 www-data www-data 4096 nov. 27 2014 ConfirmEdit/ drwxr-xr-x 4 www-data www-data 4096 nov. 27 2014 Gadgets/ drwxr-xr-x 3 www-data www-data 4096 nov. 27 2014 ImageMap/ drwxr-xr-x 4 www-data www-data 4096 nov. 27 2014 InputBox/ drwxr-xr-x 3 www-data www-data 4096 nov. 27 2014 Interwiki/ drwxr-xr-x 6 www-data www-data 4096 nov. 27 2014 LocalisationUpdate/ drwxr-xr-x 3 www-data www-data 4096 nov. 27 2014 Nuke/ drwxr-xr-x 3 www-data www-data 4096 nov. 27 2014 ParserFunctions/ lrwxrwxrwx 1 www-data www-data 37 août 12 23:37 Piwik -> /var/datas/mediawiki/extensions/Piwik/ drwxr-xr-x 3 www-data www-data 4096 nov. 27 2014 Poem/ -rw-r--r-- 1 www-data www-data 1053 nov. 27 2014 README drwxr-xr-x 4 www-data www-data 4096 nov. 27 2014 Renameuser/ lrwxrwxrwx 1 www-data www-data 37 août 12 23:37 skins -> /var/datas/mediawiki/extensions/skins/ drwxr-xr-x 4 www-data www-data 4096 nov. 27 2014 SpamBlacklist/ drwxr-xr-x 4 www-data www-data 4096 nov. 27 2014 SyntaxHighlight_GeSHi/ drwxr-xr-x 5 www-data www-data 4096 nov. 27 2014 TitleBlacklist/ lrwxrwxrwx 1 www-data www-data 45 août 12 23:38 TwitterFBLike -> /var/datas/mediawiki/extensions/TwitterFBLike/ lrwxrwxrwx 1 www-data www-data 46 août 12 23:38 W4G Rating Bar -> /var/datas/mediawiki/extensions/W4G Rating Bar/ drwxr-xr-x 4 www-data www-data 4096 nov. 27 2014 WikiEditor/
Le dernier lien mis en place concerne le répertoire images
, l'original est supprimé car il ne sera pas utilisé. Attention il y a un fichier .htaccess
par défaut dans ce répertoire
#sudo rm -rf /usr/share/mediawiki-1.24.0/images #sudo ln -s /var/datas/mediawiki/images /usr/share/mediawiki-1.24.0/images #sudo chown -h www-data:www-data /usr/share/mediawiki-1.24.0/images
Dans le cadre de la mise en place du sitemap, un lien a été mis en place pour rendre accessible les fichiers. Il faut recréer ces liens.
#sudo ln -s /var/datas/mediawiki/sitemap /usr/share/mediawiki-1.24.0/sitemap #sudo chown -h www-data:www-data /usr/share/mediawiki-1.24.0/sitemap
Enfin, il faut changer le lien symbolique /var/lib/mediawiki
pour activer la nouvelle version.
#sudo rm /var/lib/mediawiki #sudo ln -s /usr/share/mediawiki-1.24.0 /var/lib/mediawiki #sudo chown -h www-data:www-data /var/lib/mediawiki
Mise à jour de la base de données
Suite à la précédente mise à jour, les droits d'accès sur le compte MySql sont mis à jour pour s'éviter toutes les tentatives.
mysql> GRANT CREATE ON wikidb.* TO 'wikiuser'@'localhost';
Query OK, 0 rows affected (0.01 sec)
mysql> GRANT ALTER ON wikidb.* TO 'wikiuser'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT INDEX ON wikidb.* to 'wikiuser'@'localhost';
Query OK, 0 rows affected (0.01 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 ROWS affected (0.00 sec)
La mise à jour s'effectue par l'exécution du script update.php
, situé dans le répertoire maintenance
de l'installation:
#cd /var/lib/mediawiki/maintenance #sudo php update.php MediaWiki 1.24.0 Updater Going to run database updates for wikidb-ejnwiki_ Depending on the size of your database this may take a while! Abort with control-c in the next five seconds (skip this countdown with --quick) ... 0 Turning off Content Handler DB fields for this part of upgrade. ...have ipb_id field in ipblocks table. ...have ipb_expiry field in ipblocks table. ...already have interwiki table ...indexes seem up to 20031107 standards. ...hitcounter table already exists. ...have rc_type field in recentchanges table. ...index new_name_timestamp already set on recentchanges table. ...have user_real_name field in user table. ...querycache table already exists. ...objectcache table already exists. ...categorylinks table already exists. ...have pagelinks; skipping old links table updates ...il_from OK ...have rc_ip field in recentchanges table. ...index PRIMARY already set on image table. ...have rc_id field in recentchanges table. ...have rc_patrolled field in recentchanges table. ...logging table already exists. ...have user_token field in user table. ...have wl_notificationtimestamp field in watchlist table. ...watchlist talk page rows already present. ...user table does not contain user_emailauthenticationtimestamp field. ...page table already exists. ...have log_params field in logging table. ...logging table has correct log_title encoding. ...have ar_rev_id field in archive table. ...have page_len field in page table. ...revision table does not contain inverse_timestamp field. ...have rev_text_id field in revision table. ...have rev_deleted field in revision table. ...have img_width field in image table. ...have img_metadata field in image table. ...have user_email_token field in user table. ...have ar_text_id field in archive table. ...page_namespace is already a full int (int(11)). ...ar_namespace is already a full int (int(11)). ...rc_namespace is already a full int (int(11)). ...wl_namespace is already a full int (int(11)). ...qc_namespace is already a full int (int(11)). ...log_namespace is already a full int (int(11)). ...have img_media_type field in image table. ...already have pagelinks table. ...image table does not contain img_type field. ...already have unique user_name index. ...user_groups table exists and is in current format. ...have ss_total_pages field in site_stats table. ...user_newtalk table already exists. ...transcache table already exists. ...have iw_trans field in interwiki table. ...wl_notificationtimestamp is already nullable. ...index times already set on logging table. ...have ipb_range_start field in ipblocks table. ...no page_random rows needed to be set ...have user_registration field in user table. ...templatelinks table already exists ...externallinks table already exists. ...job table already exists. ...have ss_images field in site_stats table. ...langlinks table already exists. ...querycache_info table already exists. ...filearchive table already exists. ...have ipb_anon_only field in ipblocks table. ...index rc_ns_usertext already set on recentchanges table. ...index rc_user_text already set on recentchanges table. ...have user_newpass_time field in user table. ...redirect table already exists. ...querycachetwo table already exists. ...have ipb_enable_autoblock field in ipblocks table. ...index pl_namespace on table pagelinks includes field pl_from. ...index tl_namespace on table templatelinks includes field tl_from. ...index il_to on table imagelinks includes field il_from. ...have rc_old_len field in recentchanges table. ...have user_editcount field in user table. ...page_restrictions table already exists. ...have log_id field in logging table. ...have rev_parent_id field in revision table. ...have pr_id field in page_restrictions table. ...have rev_len field in revision table. ...have rc_deleted field in recentchanges table. ...have log_deleted field in logging table. ...have ar_deleted field in archive table. ...have ipb_deleted field in ipblocks table. ...have fa_deleted field in filearchive table. ...have ar_len field in archive table. ...have ipb_block_email field in ipblocks table. ...index cl_sortkey on table categorylinks includes field cl_from. ...have oi_metadata field in oldimage table. ...index usertext_timestamp already set on archive table. ...index img_usertext_timestamp already set on image table. ...index oi_usertext_timestamp already set on oldimage table. ...have ar_page_id field in archive table. ...have img_sha1 field in image table. ...protected_titles table already exists. ...have ipb_by_text field in ipblocks table. ...page_props table already exists. ...updatelog table already exists. ...category table already exists. ...category table already populated. ...have ar_parent_id field in archive table. ...have user_last_timestamp field in user_newtalk table. ...protected_titles table has correct pt_title encoding. ...have ss_active_users field in site_stats table. ...ss_active_users user count set... ...have ipb_allow_usertalk field in ipblocks table. ...pl_namespace, tl_namespace, il_to indices are already UNIQUE. ...change_tag table already exists. ...tag_summary table already exists. ...valid_tag table already exists. ...user_properties table already exists. ...log_search table already exists. ...have log_user_text field in logging table. ...l10n_cache table already exists. ...index ls_field_val already set on log_search table. ...index change_tag_rc_tag already set on change_tag table. ...have rd_interwiki field in redirect table. ...transcache tc_time already converted. ...*_mime_minor fields are already long enough. ...iwlinks table already exists. ...index iwl_prefix_title_from already set on iwlinks table. ...have ul_value field in updatelog table. ...have iw_api field in interwiki table. ...iwl_prefix key doesn't exist. ...have cl_collation field in categorylinks table. ...categorylinks up-to-date. ...collations up-to-date. ...msg_resource table already exists. ...module_deps table already exists. ...ar_page_revid key doesn't exist. ...index ar_revid already set on archive table. ...ll_lang is up-to-date. ...user_last_timestamp is already nullable. ...index user_email already set on user table. ...up_property in table user_properties already modified by patch patch-up_property.sql. ...uploadstash table already exists. ...user_former_groups table already exists. ...index type_action already set on logging table. ...have rev_sha1 field in revision table. ...batch conversion of user_options: nothing to migrate. done. ...user table does not contain user_options field. ...have ar_sha1 field in archive table. ...index page_redirect_namespace_len already set on page table. ...have us_chunk_inx field in uploadstash table. ...have job_timestamp field in job table. ...index page_user_timestamp already set on revision table. ...have ipb_parent_block_id field in ipblocks table. ...index ipb_parent_block_id already set on ipblocks table. ...category table does not contain cat_hidden field. ...have rev_content_format field in revision table. ...have rev_content_model field in revision table. ...have ar_content_format field in archive table. ...have ar_content_model field in archive table. ...have page_content_model field in page table. Content Handler DB fields should be usable now. ...site_stats table does not contain ss_admins field. ...recentchanges table does not contain rc_moved_to_title field. ...sites table already exists. ...have fa_sha1 field in filearchive table. ...have job_token field in job table. ...have job_attempts field in job table. ...have us_props field in uploadstash table. ...ug_group in table user_groups already modified by patch patch-ug_group-length-increase-255.sql. ...ufg_group in table user_former_groups already modified by patch patch-ufg_group-length-increase-255.sql. ...index pp_propname_page already set on page_props table. ...index img_media_mime already set on image table. ...iwl_prefix_title_from index is already non-UNIQUE. ...index iwl_prefix_from_title already set on iwlinks table. ...have ar_id field in archive table. ...have el_id field in externallinks table. ...have rc_source field in recentchanges table. ...index log_user_text_type_time already set on logging table. ...index log_user_text_time already set on logging table. ...have page_links_updated field in page table. ...have user_password_expires field in user table. Adding pp_sortkey field to table page_props ...done. Table recentchanges contains rc_cur_time field. Dropping ...done. Adding index wl_user_notificationtimestamp to table watchlist ...done. Adding page_lang field to table page ...done. Adding pl_from_namespace field to table pagelinks ...done. Adding tl_from_namespace field to table templatelinks ...done. Adding il_from_namespace field to table imagelinks ...done. Modifying img_major_mime field of table image ...done. Modifying oi_major_mime field of table oldimage ...done. Modifying fa_major_mime field of table filearchive ...done. ...site_stats is populated...done. ...Update 'populate rev_len and ar_len' already logged as completed. ...Update 'populate rev_sha1' already logged as completed. ...img_sha1 column of image table already populated. ...protocol-relative URLs in externallinks table already fixed. ...fa_sha1 column of filearchive table already populated. Updating *_from_namespace fields in links tables. ...doing page_id from 1 to 200 ...doing page_id from 200 to 399 ...doing page_id from 399 to 598 ...doing page_id from 598 to 797 ...doing page_id from 797 to 996 ...doing page_id from 996 to 1195 ...doing page_id from 1195 to 1394 ...doing page_id from 1394 to 1593 ...doing page_id from 1593 to 1792 ...doing page_id from 1792 to 1991 Purging caches...done. Done in 1:06.
L'exécution a été réalisée à partir du lien /var/lib/mediawiki
, et non pas directement dans la version installée, validant ainsi la répartition des fichiers.
Lors du premier affichage, une erreur se produit et le site n'est plus disponible. Le message suivant est affiché sur la page. Erreur sur la page
MediaWiki internal error. Exception caught inside exception handler. Set $wgShowExceptionDetails = true; at the bottom of LocalSettings.php to show detailed debugging information.
Après affectation de la valeur true
à la variable $wgShowExceptionDetails
dans le fichier /var/lib/mediawiki/LocalSettings.php
, le message sur la page est plus parlant.
MediaWiki internal error. Original exception: [ff7349cb] /wiki/index.php/Accueil Exception from line 205 of /usr/share/mediawiki-1.24.0/includes/skins/SkinFactory.php: No registered builder available for fallback. Backtrace: #0 /usr/share/mediawiki-1.24.0/includes/context/RequestContext.php(384): SkinFactory->makeSkin(string) #1 /usr/share/mediawiki-1.24.0/includes/context/ContextSource.php(154): RequestContext->getSkin() #2 /usr/share/mediawiki-1.24.0/includes/parser/ParserOutput.php(90): ContextSource->getSkin() #3 [internal function]: ParserOutput->{closure}(array) #4 /usr/share/mediawiki-1.24.0/includes/parser/ParserOutput.php(98): preg_replace_callback(string, Closure, string) #5 /usr/share/mediawiki-1.24.0/includes/OutputPage.php(1724): ParserOutput->getText() #6 /usr/share/mediawiki-1.24.0/includes/OutputPage.php(1743): OutputPage->addParserOutputText(ParserOutput) #7 /usr/share/mediawiki-1.24.0/includes/page/Article.php(704): OutputPage->addParserOutput(ParserOutput) #8 /usr/share/mediawiki-1.24.0/includes/actions/ViewAction.php(44): Article->view() #9 /usr/share/mediawiki-1.24.0/includes/MediaWiki.php(414): ViewAction->show() #10 /usr/share/mediawiki-1.24.0/includes/MediaWiki.php(282): MediaWiki->performAction(Article, Title) #11 /usr/share/mediawiki-1.24.0/includes/MediaWiki.php(584): MediaWiki->performRequest() #12 /usr/share/mediawiki-1.24.0/includes/MediaWiki.php(435): MediaWiki->main() #13 /usr/share/mediawiki-1.24.0/index.php(46): MediaWiki->run() #14 {main} Exception caught inside exception handler: [852fc013] /wiki/index.php/Accueil Exception from line 205 of /usr/share/mediawiki-1.24.0/includes/skins/SkinFactory.php: No registered builder available for fallback. Backtrace: #0 /usr/share/mediawiki-1.24.0/includes/context/RequestContext.php(384): SkinFactory->makeSkin(string) #1 /usr/share/mediawiki-1.24.0/includes/context/ContextSource.php(154): RequestContext->getSkin() #2 /usr/share/mediawiki-1.24.0/includes/OutputPage.php(2168): ContextSource->getSkin() #3 /usr/share/mediawiki-1.24.0/includes/exception/MWException.php(195): OutputPage->output() #4 /usr/share/mediawiki-1.24.0/includes/exception/MWException.php(238): MWException->reportHTML() #5 /usr/share/mediawiki-1.24.0/includes/exception/MWExceptionHandler.php(45): MWException->report() #6 /usr/share/mediawiki-1.24.0/includes/exception/MWExceptionHandler.php(141): MWExceptionHandler::report(SkinException) #7 /usr/share/mediawiki-1.24.0/includes/MediaWiki.php(449): MWExceptionHandler::handle(SkinException) #8 /usr/share/mediawiki-1.24.0/index.php(46): MediaWiki->run() #9 {main}
Dans un premier temps, il faut redémarrer le serveur Apache. Le site est alors disponible et une message d'erreur plus explicite est affiché, indiquant que le style utilisé monobook
dans le cadre de cet article, n'est pas activé. Une modification a été réalisé dans la version 2.14.0, qui fait que les styles ne sont plus activés automatiquement.

Il est donc nécessaire d'activer le style précédement utilisé dans le fichier /var/lib/mediawiki/LocalSettings.php
en ajoutant les lignes suivantes.
# Enable skins
require_once("$IP/skins/MonoBook/MonoBook.php");
Les droits accordés, sur le compte d'accès à la base de données, ne sont pas nécessaires pour le bon fonctionnement du Wiki. Ils sont donc supprimés:
mysql> REVOKE CREATE ON wikidb.* FROM 'wikiuser'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> REVOKE ALTER ON wikidb.* FROM 'wikiuser'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> REVOKE INDEX ON wikidb.* FROM 'wikiuser'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 ROWS affected (0.00 sec)
Mise à jour configuration Apache
Aucune mise à jour de Apache n'est nécessaire, puisque la configuration mise en place pointe à présent sur le lien /var/lib/mediawiki