« Mediawiki and Ubuntu » : différence entre les versions
De Banane Atomic
Aller à la navigationAller à la recherche
(18 versions intermédiaires par le même utilisateur non affichées) | |||
Ligne 1 : | Ligne 1 : | ||
[[Category:Ubuntu]] | [[Category:Ubuntu]] | ||
[[Category:MediaWiki]] | [[Category:MediaWiki]] | ||
= Upgrade = | |||
<kode lang='bash'> | |||
version=1.40.0 | |||
# get the new version | |||
cd /tmp | |||
wget "https://releases.wikimedia.org/mediawiki/${version%.*}/mediawiki-${version}.tar.gz" --no-verbose | |||
tar xf "mediawiki-${version}.tar.gz" | |||
# disable the website | |||
# NGINX | |||
sudo rm /etc/nginx/sites-enabled/mediawiki.conf | |||
sc-reload nginx | |||
# Apache | |||
sudo a2dissite mediawiki.conf | |||
sc-reload apache2 | |||
# backup the previous version | |||
sudo mv /var/www/mediawiki /var/www/mediawiki.bak | |||
# install the new version | |||
sudo mv "mediawiki-${version}" /var/www/mediawiki | |||
# copy settings, images | |||
cp /var/www/mediawiki.bak/LocalSettings.php /var/www/mediawiki | |||
cp -R /var/www/mediawiki.bak/images/* /var/www/mediawiki/images | |||
# copy custom extensions, remove unused folders, modify the skin, ... | |||
# upgrade the database | |||
cd /var/www/mediawiki | |||
sudo -E -u www-data php maintenance/update.php | |||
# set the access rights | |||
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 chown www-data:www-data /var/www/mediawiki/LocalSettings.php | |||
sudo chmod 640 /var/www/mediawiki/LocalSettings.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 | |||
</kode> | |||
= [https://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Debian_or_Ubuntu Installation] = | = [https://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Debian_or_Ubuntu Installation] = | ||
== Dependencies == | |||
<kode lang='bash'> | |||
ai nginx mariadb-server \ | |||
php-fpm php-intl php-mbstring php-xml php-mysql php-apcu php-gd | |||
</kode> | |||
== Get Mediawiki == | == Get Mediawiki == | ||
<kode lang='bash'> | <kode lang='bash'> | ||
Ligne 7 : | Ligne 60 : | ||
tar xf mediawiki-*.tar.gz | tar xf mediawiki-*.tar.gz | ||
sudo mv -T mediawiki-* /var/www/mediawiki | sudo mv -T mediawiki-* /var/www/mediawiki | ||
sudo chown -R root:root /var/www/mediawiki | |||
</kode> | </kode> | ||
Ligne 17 : | Ligne 71 : | ||
on mediawiki.* TO 'mediawiki'@'localhost' identified by 'password'; | on mediawiki.* TO 'mediawiki'@'localhost' identified by 'password'; | ||
flush privileges; | |||
</kode> | |||
== Folder rights == | |||
Folders {{boxx|cache}} and {{boxx|images}} must be writable by the nginx user {{boxx|www-data}}. | |||
<kode lang=bash> | |||
sudo chown -R www-data:www-data images/ | |||
sudo chown -R www-data:www-data cache/ | |||
</kode> | </kode> | ||
= Configuration = | |||
* [[Mediawiki_configuration#Pretty_%2F_Short_URL|Short URL]] |
Dernière version du 15 octobre 2023 à 10:05
Upgrade
version=1.40.0 # get the new version cd /tmp wget "https://releases.wikimedia.org/mediawiki/${version%.*}/mediawiki-${version}.tar.gz" --no-verbose tar xf "mediawiki-${version}.tar.gz" # disable the website # NGINX sudo rm /etc/nginx/sites-enabled/mediawiki.conf sc-reload nginx # Apache sudo a2dissite mediawiki.conf sc-reload apache2 # backup the previous version sudo mv /var/www/mediawiki /var/www/mediawiki.bak # install the new version sudo mv "mediawiki-${version}" /var/www/mediawiki # copy settings, images cp /var/www/mediawiki.bak/LocalSettings.php /var/www/mediawiki cp -R /var/www/mediawiki.bak/images/* /var/www/mediawiki/images # copy custom extensions, remove unused folders, modify the skin, ... # upgrade the database cd /var/www/mediawiki sudo -E -u www-data php maintenance/update.php # set the access rights 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 chown www-data:www-data /var/www/mediawiki/LocalSettings.php sudo chmod 640 /var/www/mediawiki/LocalSettings.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 |
Installation
Dependencies
ai nginx mariadb-server \ php-fpm php-intl php-mbstring php-xml php-mysql php-apcu php-gd |
Get Mediawiki
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 sudo chown -R root:root /var/www/mediawiki |
Configuring MariaDB
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'; flush privileges; |
Folder rights
Folders cache and images must be writable by the nginx user www-data.
sudo chown -R www-data:www-data images/ sudo chown -R www-data:www-data cache/ |