Mediawiki upgrade to 1.37.1: Difference between revisions
mNo edit summary |
mNo edit summary |
||
| Line 3: | Line 3: | ||
[[Category:202203]] | [[Category:202203]] | ||
= Info = | |||
These are some notes of the Mediawiki upgrade to 1.37.1 for future use. | These are some notes of the Mediawiki upgrade to 1.37.1 for future use. | ||
* https://www.mediawiki.org/wiki/Manual:Upgrading | * https://www.mediawiki.org/wiki/Manual:Upgrading | ||
== Download and extract Mediawiki = | = PHP with Nginx webserver upgrade = | ||
What do we have now: | |||
<source lang=bash> | |||
php --version | |||
sudo dpkg -l | grep php | tee packages.txt | |||
</source> | |||
Repository key and repository: | |||
<source lang=bash> | |||
#tools | |||
sudo apt install apt-transport-https lsb-release ca-certificates wget | |||
#repository key | |||
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg | |||
#repository | |||
sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' | |||
sudo apt update | |||
</source> | |||
Install: | |||
<source lang=bash> | |||
#php | |||
sudo apt install php8.2 php8.2-cli php8.2-curl php8.2-mbstring php8.2-intl | |||
#php deamon | |||
sudo apt install php8.2-fpm | |||
</source> | |||
Remove old packages: | |||
<source lang=bash> | |||
sudo apt purge php7.3* | |||
sudo apt purge apache2 | |||
sudo apt-get autoclean | |||
sudo apt-get autoremove | |||
</source> | |||
Modify nginx website references tot php8.2-fpm | |||
<source lang=bash> | |||
sudo nano /etc/nginx/sites-available/<website> | |||
</source> | |||
<blockquote> | |||
<source lang=bash> | |||
... | |||
fastcgi_pass unix:/run/php/php8.2-fpm.sock; | |||
... | |||
</source> | |||
</blockquote> | |||
Restart webserver: | |||
<source lang=bash> | |||
sudo service nginx restart | |||
</source> | |||
= Download and extract Mediawiki = | |||
<source lang=bash> | <source lang=bash> | ||
| Line 19: | Line 80: | ||
</source> | </source> | ||
= LocalSettings.php = | |||
<source lang=bash> | <source lang=bash> | ||
| Line 25: | Line 86: | ||
sudo nano /var/www/mediawiki-*/LocalSettings.php | sudo nano /var/www/mediawiki-*/LocalSettings.php | ||
</source> | </source> | ||
= Extensions = | |||
== Extensions included in Mediawiki == | == Extensions included in Mediawiki == | ||
| Line 69: | Line 132: | ||
* https://www.mediawiki.org/wiki/Extension:MobileFrontend | * https://www.mediawiki.org/wiki/Extension:MobileFrontend | ||
== Media / uploaded files | ==Extension: TalkRight== | ||
To allow discussion for anonymous users but it does not work anymore. Not using it. | |||
* https://www.mediawiki.org/wiki/Extension:TalkRight | |||
== Extension: EditSubpages == | |||
Alternative for allowing anonymous editing of certain pages. I'm using this one now. | |||
* https://www.mediawiki.org/wiki/Manual:Preventing_access | |||
* https://www.mediawiki.org/wiki/Extension:EditSubpages | |||
Download and extract: | |||
<source lang=bash> | |||
sudo -i | |||
cd /var/www/mediawiki/extensions/ | |||
wget https://github.com/wikimedia/mediawiki-extensions-EditSubpages/archive/master.tar.gz | |||
tar -xvzf master.tar.gz | |||
rm master.tar.gz | |||
mv mediawiki-extensions-EditSubpages-master EditSubpages | |||
</source> | |||
= Media / uploaded files= | |||
Copy the original uploads and set permissions: | Copy the original uploads and set permissions: | ||
| Line 79: | Line 162: | ||
</source> | </source> | ||
= Hide time of date/time = | |||
<source lang=bash> | <source lang=bash> | ||
| Line 95: | Line 178: | ||
</source> | </source> | ||
= Replacing the OLD wiki = | |||
Rename the folder - wiki will go offline. | Rename the folder - wiki will go offline. | ||
| Line 108: | Line 191: | ||
cd /var/www/mediawiki/maintenance/ | cd /var/www/mediawiki/maintenance/ | ||
php update.php | php update.php | ||
</source> | </source> | ||
Revision as of 19:09, 28 May 2023
Info
These are some notes of the Mediawiki upgrade to 1.37.1 for future use.
PHP with Nginx webserver upgrade
What do we have now:
php --version sudo dpkg -l | grep php | tee packages.txt
Repository key and repository:
#tools sudo apt install apt-transport-https lsb-release ca-certificates wget #repository key sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg #repository sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' sudo apt update
Install:
#php sudo apt install php8.2 php8.2-cli php8.2-curl php8.2-mbstring php8.2-intl #php deamon sudo apt install php8.2-fpm
Remove old packages:
sudo apt purge php7.3* sudo apt purge apache2 sudo apt-get autoclean sudo apt-get autoremove
Modify nginx website references tot php8.2-fpm
sudo nano /etc/nginx/sites-available/<website>
... fastcgi_pass unix:/run/php/php8.2-fpm.sock; ...
Restart webserver:
sudo service nginx restart
Download and extract Mediawiki
sudo -i cd /var/www wget https://releases.wikimedia.org/mediawiki/1.37/mediawiki-1.37.1.tar.gz tar -xvzf mediawiki-*.tar.gz rm mediawiki-1.37.1.tar.gz
LocalSettings.php
cp -v /var/www/mediawiki/LocalSettings.php /var/www/mediawiki-*/LocalSettings.php sudo nano /var/www/mediawiki-*/LocalSettings.php
Extensions
Extensions included in Mediawiki
- WikiEditor
- ConfirmEdit
Extension: Highlightjs_Integration
It's faster than the bundled GeSHi extension.
Download and extract:
sudo -i cd /var/www/mediawiki-*/extensions/ wget https://github.com/Nicolas01/Highlightjs_Integration/archive/master.zip unzip master.zip mv "Highlightjs_Integration-master" "Highlightjs_Integration" rm master.zip
Style stettings:
cp -v /var/www/mediawiki/extensions/Highlightjs_Integration/extension.json /var/www/mediawiki-*/extensions/Highlightjs_Integration/extension.json
Extension: Lockdown
Limit access to pages. A number of special pages are blocked for anonymous users.
Download and extract:
sudo -i cd /var/www/mediawiki-*/extensions/ wget https://extdist.wmflabs.org/dist/extensions/Lockdown-REL1_37-5d8ea76.tar.gz tar -xvzf Lockdown-REL*.tar.gz rm Lockdown-REL*.tar.gz
Extension: MobileFrontend
Not using it currently, seems better without
Extension: TalkRight
To allow discussion for anonymous users but it does not work anymore. Not using it.
Extension: EditSubpages
Alternative for allowing anonymous editing of certain pages. I'm using this one now.
- https://www.mediawiki.org/wiki/Manual:Preventing_access
- https://www.mediawiki.org/wiki/Extension:EditSubpages
Download and extract:
sudo -i cd /var/www/mediawiki/extensions/ wget https://github.com/wikimedia/mediawiki-extensions-EditSubpages/archive/master.tar.gz tar -xvzf master.tar.gz rm master.tar.gz mv mediawiki-extensions-EditSubpages-master EditSubpages
Media / uploaded files
Copy the original uploads and set permissions:
sudo cp -rv /var/www/mediawiki/images/ /var/www/mediawiki-*/ sudo chown -R www-data:www-data /var/www/mediawiki-*/images/ sudo chmod -R 755 /var/www/mediawiki-*/images/
Hide time of date/time
sudo nano -l +66 /var/www/mediawiki-*/includes/search/searchwidgets/FullSearchResultWidget.php
Replace:
$date = $this->specialPage->getLanguage()->userTimeAndDate(
With:
$date = $this->specialPage->getLanguage()->userDate(
Replacing the OLD wiki
Rename the folder - wiki will go offline.
mv /var/www/mediawiki /var/www/mediawiki-OLD mv /var/www/mediawiki-1.37.1 /var/www/mediawiki
Upgrade database:
sudo nano /var/www/mediawiki/LocalSettings.php cd /var/www/mediawiki/maintenance/ php update.php