« Mediawiki and Ubuntu » : différence entre les versions

De Banane Atomic
Aller à la navigationAller à la recherche
Ligne 2 : Ligne 2 :
[[Category:MediaWiki]]
[[Category:MediaWiki]]
= Upgrade =
= Upgrade =
== NGINX ==
<kode lang='bash'>
<kode lang='bash'>
# disable the website
# disable the website
# NGINX
sudo rm /etc/nginx/sites-enabled/my-site.conf
sudo rm /etc/nginx/sites-enabled/my-site.conf
sc-reload nginx
sc-reload nginx
# Apache
sudo a2dissite mediawiki.conf
sc-reload apache2


wget https://releases.wikimedia.org/mediawiki/1.40/mediawiki-1.40.0.tar.gz
wget https://releases.wikimedia.org/mediawiki/1.40/mediawiki-1.40.0.tar.gz
Ligne 29 : Ligne 32 :


# re-enable the website
# re-enable the website
# NGINX
sudo ln -s /etc/nginx/sites-available/mediawiki.conf /etc/nginx/sites-enabled/mediawiki.conf
sudo ln -s /etc/nginx/sites-available/mediawiki.conf /etc/nginx/sites-enabled/mediawiki.conf
sc-reload nginx
sc-reload nginx
 
# Apache
# delete unused folder
sudo rm -rf /var/www/mediawiki.bak
</kode>
 
== Apache ==
<kode lang='bash'>
# disable the website
sudo a2dissite mediawiki.conf
sc-reload apache2
 
wget https://releases.wikimedia.org/mediawiki/1.35/mediawiki-1.35.6.tar.gz
tar xf mediawiki-*.tar.gz
 
cd /var/www
# backup the previous version
sudo mv mediawiki mediawiki.bak
 
sudo mv -T ~/downloads/mediawiki-* mediawiki
sudo chown -R root:root mediawiki
sudo chown -R www-data:www-data mediawiki/cache
sudo chown -R www-data:www-data mediawiki/images
sudo cp -R mediawiki.bak/images/* mediawiki/images
# copy the custom extensions
sudo cp -R mediawiki.bak/extensions/MyCustomExtension mediawiki/extensions
# copy the LocalSettings
sudo cp mediawiki.bak/LocalSettings.php mediawiki
 
# upgrade the database
cd mediawiki
php maintenance/update.php
 
# re-enable the website
sudo a2ensite mediawiki.conf
sudo a2ensite mediawiki.conf
sc-reload apache2
sc-reload apache2


# delete unused folder
# delete unused folder
sudo rm -rf mediawiki.bak
sudo rm -rf /var/www/mediawiki.bak
</kode>
</kode>



Version du 9 août 2023 à 22:48

Upgrade

Bash.svg
# disable the website
# NGINX
sudo rm /etc/nginx/sites-enabled/my-site.conf
sc-reload nginx
# Apache
sudo a2dissite mediawiki.conf
sc-reload apache2

wget https://releases.wikimedia.org/mediawiki/1.40/mediawiki-1.40.0.tar.gz
tar xf mediawiki-*.tar.gz

# backup the previous version
sudo mv /var/www/mediawiki /var/www/mediawiki.bak

sudo mv -T mediawiki-* /var/www/mediawiki
sudo chown -R root:root /var/www/mediawiki
sudo chown -R www-data:www-data /var/www/mediawiki/cache
sudo chown -R www-data:www-data /var/www/mediawiki/images
sudo cp -R /var/www/mediawiki.bak/images/* /var/www/mediawiki/images
# copy the custom extensions
sudo cp -R /var/www/mediawiki.bak/extensions/MyCustomExtension /var/www/mediawiki/extensions
# copy the LocalSettings
sudo cp /var/www/mediawiki.bak/LocalSettings.php /var/www/mediawiki

# upgrade the database
cd /var/www/mediawiki
php maintenance/update.php

# re-enable the website
# NGINX
sudo ln -s /etc/nginx/sites-available/mediawiki.conf /etc/nginx/sites-enabled/mediawiki.conf
sc-reload nginx
# Apache
sudo a2ensite mediawiki.conf
sc-reload apache2

# delete unused folder
sudo rm -rf /var/www/mediawiki.bak

Installation

Dependencies

Bash.svg
ai nginx mariadb-server \
   php-fpm php-intl php-mbstring php-xml php-mysql php-apcu php-gd

Get Mediawiki

Bash.svg
wget https://releases.wikimedia.org/mediawiki/1.40/mediawiki-1.40.0.tar.gz
tar xf mediawiki-*.tar.gz
sudo mv -T mediawiki-* /var/www/mediawiki

Configuring MariaDB

Mariadb.svg
create database mediawiki;

-- create a new user and grant him access rights
grant index, create, select, insert, update, delete, alter, lock tables
  on mediawiki.* TO 'mediawiki'@'localhost' identified by 'password';

commit;

Folder rights

Folders cache and images must be writable by the nginx user www-data.

Bash.svg
sudo chown -R www-data:www-data images/
sudo chown -R www-data:www-data cache/

Configuration